Documentation ¶
Overview ¶
Package checkpointeuracle is a wrapper of checkpoint euracle contract with additional rules defined. This package can be used both in LES client or server side for offering euracle related APIs.
Index ¶
- type CheckpointEuracle
- func (euracle *CheckpointEuracle) Contract() *checkpointeuracle.CheckpointEuracle
- func (euracle *CheckpointEuracle) IsRunning() bool
- func (euracle *CheckpointEuracle) StableCheckpoint() (*params.TrustedCheckpoint, uint64)
- func (euracle *CheckpointEuracle) Start(backend bind.ContractBackend)
- func (euracle *CheckpointEuracle) VerifySigners(index uint64, hash [32]byte, signatures [][]byte) (bool, []common.Address)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckpointEuracle ¶
type CheckpointEuracle struct {
// contains filtered or unexported fields
}
CheckpointEuracle is responsible for offering the latest stable checkpoint generated and announced by the contract admins on-chain. The checkpoint can be verified by clients locally during the checkpoint syncing.
func New ¶
func New(config *params.CheckpointEuracleConfig, getLocal func(uint64) params.TrustedCheckpoint) *CheckpointEuracle
New creates a checkpoint euracle handler with given configs and callback.
func (*CheckpointEuracle) Contract ¶
func (euracle *CheckpointEuracle) Contract() *checkpointeuracle.CheckpointEuracle
Contract returns the underlying raw checkpoint euracle contract.
func (*CheckpointEuracle) IsRunning ¶
func (euracle *CheckpointEuracle) IsRunning() bool
IsRunning returns an indicator whether the euracle is running.
func (*CheckpointEuracle) StableCheckpoint ¶
func (euracle *CheckpointEuracle) StableCheckpoint() (*params.TrustedCheckpoint, uint64)
StableCheckpoint returns the stable checkpoint which was generated by local indexers and announced by trusted signers.
func (*CheckpointEuracle) Start ¶
func (euracle *CheckpointEuracle) Start(backend bind.ContractBackend)
Start binds the contract backend, initializes the euracle instance and marks the status as available.
func (*CheckpointEuracle) VerifySigners ¶
func (euracle *CheckpointEuracle) VerifySigners(index uint64, hash [32]byte, signatures [][]byte) (bool, []common.Address)
VerifySigners recovers the signer addresses according to the signature and checks whether there are enough approvals to finalize the checkpoint.