Documentation ¶
Index ¶
- func GetBlockBody(v *spec.VersionedSignedBeaconBlock) any
- func GetExecutionExtraData(v *spec.VersionedSignedBeaconBlock) ([]byte, error)
- type Block
- func (block *Block) AwaitBlock(ctx context.Context, timeout time.Duration) *spec.VersionedSignedBeaconBlock
- func (block *Block) AwaitHeader(ctx context.Context, timeout time.Duration) *phase0.SignedBeaconBlockHeader
- func (block *Block) EnsureBlock(loadBlock func() (*spec.VersionedSignedBeaconBlock, error)) (bool, error)
- func (block *Block) EnsureHeader(loadHeader func() (*phase0.SignedBeaconBlockHeader, error)) error
- func (block *Block) GetBlock() *spec.VersionedSignedBeaconBlock
- func (block *Block) GetHeader() *phase0.SignedBeaconBlockHeader
- func (block *Block) GetParentRoot() *phase0.Root
- func (block *Block) GetSeenBy() []*Client
- func (block *Block) SetHeader(header *phase0.SignedBeaconBlockHeader)
- func (block *Block) SetSeenBy(client *Client)
- type BlockCache
- func (cache *BlockCache) AddBlock(root phase0.Root, slot phase0.Slot) (*Block, bool)
- func (cache *BlockCache) GetBlockDistance(blockRoot, headRoot phase0.Root) (linked bool, distance uint64)
- func (cache *BlockCache) GetCachedBlockByRoot(root phase0.Root) *Block
- func (cache *BlockCache) GetCachedBlocks() []*Block
- func (cache *BlockCache) GetCachedBlocksBySlot(slot phase0.Slot) []*Block
- func (cache *BlockCache) GetFinalizedCheckpoint() (phase0.Epoch, phase0.Root)
- func (cache *BlockCache) GetGenesis() *v1.Genesis
- func (cache *BlockCache) GetSpecValues() map[string]interface{}
- func (cache *BlockCache) GetSpecs() *ChainSpec
- func (cache *BlockCache) GetWallclock() *ethwallclock.EthereumBeaconChain
- func (cache *BlockCache) InitWallclock()
- func (cache *BlockCache) IsCanonicalBlock(blockRoot, headRoot phase0.Root) bool
- func (cache *BlockCache) SetClientSpecs(specValues map[string]interface{}) error
- func (cache *BlockCache) SetFinalizedCheckpoint(finalizedEpoch phase0.Epoch, finalizedRoot phase0.Root)
- func (cache *BlockCache) SetGenesis(genesis *v1.Genesis) error
- func (cache *BlockCache) SetMinFollowDistance(followDistance uint64)
- func (cache *BlockCache) SubscribeBlockEvent(capacity int) *Subscription[*Block]
- func (cache *BlockCache) SubscribeFinalizedEvent(capacity int) *Subscription[*FinalizedCheckpoint]
- func (cache *BlockCache) SubscribeWallclockEpochEvent(capacity int) *Subscription[*ethwallclock.Epoch]
- func (cache *BlockCache) SubscribeWallclockSlotEvent(capacity int) *Subscription[*ethwallclock.Slot]
- type ChainSpec
- type Client
- func (client *Client) GetClientType() ClientType
- func (client *Client) GetEndpointConfig() *ClientConfig
- func (client *Client) GetIndex() uint16
- func (client *Client) GetLastError() error
- func (client *Client) GetLastEventTime() time.Time
- func (client *Client) GetLastHead() (phase0.Slot, phase0.Root)
- func (client *Client) GetName() string
- func (client *Client) GetRPCClient() *rpc.BeaconClient
- func (client *Client) GetStatus() ClientStatus
- func (client *Client) GetVersion() string
- func (client *Client) SubscribeBlockEvent(capacity int) *Subscription[*Block]
- func (client *Client) SubscribeFinalizedEvent(capacity int) *Subscription[*FinalizedCheckpoint]
- func (client *Client) UnsubscribeBlockEvent(subscription *Subscription[*Block])
- func (client *Client) UnsubscribeFinalizedEvent(subscription *Subscription[*FinalizedCheckpoint])
- type ClientConfig
- type ClientStatus
- type ClientType
- type Dispatcher
- type FinalizedCheckpoint
- type ForkVersion
- type HeadFork
- type Pool
- func (pool *Pool) AddEndpoint(endpoint *ClientConfig) (*Client, error)
- func (pool *Pool) AwaitReadyEndpoint(ctx context.Context, clientType ClientType) *Client
- func (pool *Pool) GetAllEndpoints() []*Client
- func (pool *Pool) GetBlockCache() *BlockCache
- func (pool *Pool) GetCanonicalFork(forkDistance int64) *HeadFork
- func (pool *Pool) GetHeadForks(forkDistance int64) []*HeadFork
- func (pool *Pool) GetReadyEndpoint(clientType ClientType) *Client
- func (pool *Pool) GetValidatorSet() map[phase0.ValidatorIndex]*v1.Validator
- func (pool *Pool) IsClientReady(client *Client) bool
- type PoolConfig
- type SchedulerMode
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockBody ¶ added in v0.0.10
func GetBlockBody(v *spec.VersionedSignedBeaconBlock) any
func GetExecutionExtraData ¶ added in v0.0.9
func GetExecutionExtraData(v *spec.VersionedSignedBeaconBlock) ([]byte, error)
Types ¶
type Block ¶
func (*Block) AwaitBlock ¶
func (*Block) AwaitHeader ¶
func (*Block) EnsureBlock ¶
func (*Block) EnsureHeader ¶
func (block *Block) EnsureHeader(loadHeader func() (*phase0.SignedBeaconBlockHeader, error)) error
func (*Block) GetBlock ¶
func (block *Block) GetBlock() *spec.VersionedSignedBeaconBlock
func (*Block) GetHeader ¶
func (block *Block) GetHeader() *phase0.SignedBeaconBlockHeader
func (*Block) GetParentRoot ¶
func (*Block) SetHeader ¶
func (block *Block) SetHeader(header *phase0.SignedBeaconBlockHeader)
type BlockCache ¶
type BlockCache struct {
// contains filtered or unexported fields
}
func NewBlockCache ¶
func NewBlockCache(ctx context.Context, logger logrus.FieldLogger, followDistance uint64) (*BlockCache, error)
func (*BlockCache) GetBlockDistance ¶
func (cache *BlockCache) GetBlockDistance(blockRoot, headRoot phase0.Root) (linked bool, distance uint64)
func (*BlockCache) GetCachedBlockByRoot ¶
func (cache *BlockCache) GetCachedBlockByRoot(root phase0.Root) *Block
func (*BlockCache) GetCachedBlocks ¶
func (cache *BlockCache) GetCachedBlocks() []*Block
func (*BlockCache) GetCachedBlocksBySlot ¶
func (cache *BlockCache) GetCachedBlocksBySlot(slot phase0.Slot) []*Block
func (*BlockCache) GetFinalizedCheckpoint ¶
func (cache *BlockCache) GetFinalizedCheckpoint() (phase0.Epoch, phase0.Root)
func (*BlockCache) GetGenesis ¶
func (cache *BlockCache) GetGenesis() *v1.Genesis
func (*BlockCache) GetSpecValues ¶ added in v0.0.11
func (cache *BlockCache) GetSpecValues() map[string]interface{}
func (*BlockCache) GetSpecs ¶
func (cache *BlockCache) GetSpecs() *ChainSpec
func (*BlockCache) GetWallclock ¶
func (cache *BlockCache) GetWallclock() *ethwallclock.EthereumBeaconChain
func (*BlockCache) InitWallclock ¶
func (cache *BlockCache) InitWallclock()
func (*BlockCache) IsCanonicalBlock ¶
func (cache *BlockCache) IsCanonicalBlock(blockRoot, headRoot phase0.Root) bool
func (*BlockCache) SetClientSpecs ¶
func (cache *BlockCache) SetClientSpecs(specValues map[string]interface{}) error
func (*BlockCache) SetFinalizedCheckpoint ¶
func (cache *BlockCache) SetFinalizedCheckpoint(finalizedEpoch phase0.Epoch, finalizedRoot phase0.Root)
func (*BlockCache) SetGenesis ¶
func (cache *BlockCache) SetGenesis(genesis *v1.Genesis) error
func (*BlockCache) SetMinFollowDistance ¶
func (cache *BlockCache) SetMinFollowDistance(followDistance uint64)
func (*BlockCache) SubscribeBlockEvent ¶
func (cache *BlockCache) SubscribeBlockEvent(capacity int) *Subscription[*Block]
func (*BlockCache) SubscribeFinalizedEvent ¶
func (cache *BlockCache) SubscribeFinalizedEvent(capacity int) *Subscription[*FinalizedCheckpoint]
func (*BlockCache) SubscribeWallclockEpochEvent ¶
func (cache *BlockCache) SubscribeWallclockEpochEvent(capacity int) *Subscription[*ethwallclock.Epoch]
func (*BlockCache) SubscribeWallclockSlotEvent ¶
func (cache *BlockCache) SubscribeWallclockSlotEvent(capacity int) *Subscription[*ethwallclock.Slot]
type ChainSpec ¶
type ChainSpec struct { PresetBase string `yaml:"PRESET_BASE"` ConfigName string `yaml:"CONFIG_NAME"` MinGenesisTime time.Time `yaml:"MIN_GENESIS_TIME"` GenesisForkVersion phase0.Version `yaml:"GENESIS_FORK_VERSION"` AltairForkVersion phase0.Version `yaml:"ALTAIR_FORK_VERSION"` AltairForkEpoch uint64 `yaml:"ALTAIR_FORK_EPOCH"` BellatrixForkVersion phase0.Version `yaml:"BELLATRIX_FORK_VERSION"` BellatrixForkEpoch uint64 `yaml:"BELLATRIX_FORK_EPOCH"` CappellaForkVersion phase0.Version `yaml:"CAPELLA_FORK_VERSION"` CappellaForkEpoch uint64 `yaml:"CAPELLA_FORK_EPOCH"` SecondsPerSlot time.Duration `yaml:"SECONDS_PER_SLOT"` SlotsPerEpoch uint64 `yaml:"SLOTS_PER_EPOCH"` MaxCommitteesPerSlot uint64 `yaml:"MAX_COMMITTEES_PER_SLOT"` }
https://github.com/ethereum/consensus-specs/blob/dev/configs/mainnet.yaml
func (*ChainSpec) CheckMismatch ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetClientType ¶
func (client *Client) GetClientType() ClientType
func (*Client) GetEndpointConfig ¶
func (client *Client) GetEndpointConfig() *ClientConfig
func (*Client) GetLastError ¶
func (*Client) GetLastEventTime ¶
func (*Client) GetRPCClient ¶
func (client *Client) GetRPCClient() *rpc.BeaconClient
func (*Client) GetStatus ¶
func (client *Client) GetStatus() ClientStatus
func (*Client) GetVersion ¶
func (*Client) SubscribeBlockEvent ¶
func (client *Client) SubscribeBlockEvent(capacity int) *Subscription[*Block]
func (*Client) SubscribeFinalizedEvent ¶
func (client *Client) SubscribeFinalizedEvent(capacity int) *Subscription[*FinalizedCheckpoint]
func (*Client) UnsubscribeBlockEvent ¶
func (client *Client) UnsubscribeBlockEvent(subscription *Subscription[*Block])
func (*Client) UnsubscribeFinalizedEvent ¶
func (client *Client) UnsubscribeFinalizedEvent(subscription *Subscription[*FinalizedCheckpoint])
type ClientStatus ¶
type ClientStatus uint8
var ( ClientStatusOnline ClientStatus = 1 ClientStatusOffline ClientStatus = 2 ClientStatusSynchronizing ClientStatus = 3 ClientStatusOptimistic ClientStatus = 4 )
type ClientType ¶
type ClientType int8
var ( AnyClient ClientType UnknownClient ClientType = -1 LighthouseClient ClientType = 1 LodestarClient ClientType = 2 NimbusClient ClientType = 3 PrysmClient ClientType = 4 TekuClient ClientType = 5 GrandineClient ClientType = 6 CaplinClient ClientType = 7 )
func ParseClientType ¶
func ParseClientType(name string) ClientType
func (ClientType) String ¶
func (clientType ClientType) String() string
type Dispatcher ¶
type Dispatcher[T interface{}] struct {
// contains filtered or unexported fields
}
func (*Dispatcher[T]) Fire ¶
func (d *Dispatcher[T]) Fire(data T)
func (*Dispatcher[T]) Subscribe ¶
func (d *Dispatcher[T]) Subscribe(capacity int) *Subscription[T]
func (*Dispatcher[T]) Unsubscribe ¶
func (d *Dispatcher[T]) Unsubscribe(subscription *Subscription[T])
type ForkVersion ¶
type HeadFork ¶
type HeadFork struct { Slot phase0.Slot Root phase0.Root ReadyClients []*Client AllClients []*Client }
func (*HeadFork) IsClientReady ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewPool ¶
func NewPool(ctx context.Context, config *PoolConfig, logger logrus.FieldLogger) (*Pool, error)
func (*Pool) AddEndpoint ¶
func (pool *Pool) AddEndpoint(endpoint *ClientConfig) (*Client, error)
func (*Pool) AwaitReadyEndpoint ¶ added in v0.0.6
func (pool *Pool) AwaitReadyEndpoint(ctx context.Context, clientType ClientType) *Client
func (*Pool) GetAllEndpoints ¶
func (*Pool) GetBlockCache ¶
func (pool *Pool) GetBlockCache() *BlockCache
func (*Pool) GetCanonicalFork ¶
func (*Pool) GetHeadForks ¶
func (*Pool) GetReadyEndpoint ¶
func (pool *Pool) GetReadyEndpoint(clientType ClientType) *Client
func (*Pool) GetValidatorSet ¶ added in v0.0.5
func (pool *Pool) GetValidatorSet() map[phase0.ValidatorIndex]*v1.Validator
func (*Pool) IsClientReady ¶
type PoolConfig ¶
type Subscription ¶
type Subscription[T interface{}] struct {
// contains filtered or unexported fields
}
func (*Subscription[T]) Channel ¶
func (s *Subscription[T]) Channel() <-chan T
func (*Subscription[T]) Unsubscribe ¶
func (s *Subscription[T]) Unsubscribe()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.