Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- gethTypes.Log) (ethereum.Subscription, error)
}
Logger subscribe filtered log on the PoW chain
type POWBlockFetcher ¶
type POWBlockFetcher interface {
BlockByHash(ctx context.Context, hash common.Hash) (*gethTypes.Block, error)
}
POWBlockFetcher defines a struct that can retrieve mainchain blocks.
type Reader ¶
type Reader interface {
SubscribeNewHead(ctx context.Context, ch chan<- *gethTypes.Header) (ethereum.Subscription, error)
}
Reader defines a struct that can fetch latest header events from a web3 endpoint.
type Web3Service ¶
type Web3Service struct {
// contains filtered or unexported fields
}
Web3Service fetches important information about the canonical Ethereum PoW chain via a web3 endpoint using an essclient. The Random Beacon Chain requires synchronization with the PoW chain's current blockhash, block number, and access to logs within the Validator Registration Contract on the PoW chain to kick off the beacon chain's validator registration process.
func NewWeb3Service ¶
func NewWeb3Service(ctx context.Context, config *Web3ServiceConfig) (*Web3Service, error)
NewWeb3Service sets up a new instance with an essclient when given a web3 endpoint as a string.
func (*Web3Service) LatestBlockHash ¶
func (w *Web3Service) LatestBlockHash() common.Hash
LatestBlockHash is a getter for blockHash to make it read-only.
func (*Web3Service) LatestBlockNumber ¶
func (w *Web3Service) LatestBlockNumber() *big.Int
LatestBlockNumber is a getter for blockNumber to make it read-only.
func (*Web3Service) Stop ¶
func (w *Web3Service) Stop() error
Stop the web3 service's main event loop and associated goroutines.
func (*Web3Service) ValidatorRegistered ¶
func (w *Web3Service) ValidatorRegistered() bool
ValidatorRegistered is a getter for validatorRegistered to make it read-only.