Documentation ¶
Index ¶
- type Block
- func (block *Block) AwaitBlock(ctx context.Context, timeout time.Duration) *types.Block
- func (block *Block) AwaitSeenBy(ctx context.Context, client *Client) bool
- func (block *Block) EnsureBlock(loadBlock func() (*types.Block, error)) (bool, error)
- func (block *Block) GetBlock() *types.Block
- func (block *Block) GetParentHash() *common.Hash
- func (block *Block) GetSeenBy() []*Client
- func (block *Block) SetSeenBy(client *Client)
- type BlockCache
- func (cache *BlockCache) AddBlock(hash common.Hash, number uint64) (*Block, bool)
- func (cache *BlockCache) GetBlockDistance(blockRoot, headRoot common.Hash) (linked bool, distance uint64)
- func (cache *BlockCache) GetCachedBlockByRoot(hash common.Hash) *Block
- func (cache *BlockCache) GetCachedBlocks() []*Block
- func (cache *BlockCache) GetChainID() *big.Int
- func (cache *BlockCache) GetSpecs() *rpc.ChainSpec
- func (cache *BlockCache) IsCanonicalBlock(blockRoot, headRoot common.Hash) bool
- func (cache *BlockCache) SetClientSpecs(specs *rpc.ChainSpec) error
- func (cache *BlockCache) SetMinFollowDistance(followDistance uint64)
- func (cache *BlockCache) SubscribeBlockEvent(capacity int) *Subscription[*Block]
- func (cache *BlockCache) UnsubscribeBlockEvent(subscription *Subscription[*Block])
- 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() (uint64, common.Hash)
- func (client *Client) GetName() string
- func (client *Client) GetRPCClient() *rpc.ExecutionClient
- func (client *Client) GetStatus() ClientStatus
- func (client *Client) GetVersion() string
- func (client *Client) NotifyNewBlock(hash common.Hash, number uint64)
- type ClientConfig
- type ClientStatus
- type ClientType
- type Dispatcher
- 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) GetReadyEndpoints(shuffle bool) []*Client
- func (pool *Pool) IsClientReady(client *Client) bool
- type PoolConfig
- type SchedulerMode
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
func (*Block) AwaitBlock ¶
func (*Block) AwaitSeenBy ¶ added in v0.0.12
func (*Block) EnsureBlock ¶
func (*Block) GetParentHash ¶
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 common.Hash) (linked bool, distance uint64)
func (*BlockCache) GetCachedBlockByRoot ¶
func (cache *BlockCache) GetCachedBlockByRoot(hash common.Hash) *Block
func (*BlockCache) GetCachedBlocks ¶
func (cache *BlockCache) GetCachedBlocks() []*Block
func (*BlockCache) GetChainID ¶
func (cache *BlockCache) GetChainID() *big.Int
func (*BlockCache) GetSpecs ¶
func (cache *BlockCache) GetSpecs() *rpc.ChainSpec
func (*BlockCache) IsCanonicalBlock ¶
func (cache *BlockCache) IsCanonicalBlock(blockRoot, headRoot common.Hash) bool
func (*BlockCache) SetClientSpecs ¶
func (cache *BlockCache) SetClientSpecs(specs *rpc.ChainSpec) error
func (*BlockCache) SetMinFollowDistance ¶
func (cache *BlockCache) SetMinFollowDistance(followDistance uint64)
func (*BlockCache) SubscribeBlockEvent ¶
func (cache *BlockCache) SubscribeBlockEvent(capacity int) *Subscription[*Block]
func (*BlockCache) UnsubscribeBlockEvent ¶
func (cache *BlockCache) UnsubscribeBlockEvent(subscription *Subscription[*Block])
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.ExecutionClient
func (*Client) GetStatus ¶
func (client *Client) GetStatus() ClientStatus
func (*Client) GetVersion ¶
type ClientStatus ¶
type ClientStatus uint8
var ( ClientStatusOnline ClientStatus = 1 ClientStatusOffline ClientStatus = 2 ClientStatusSynchronizing ClientStatus = 3 )
type ClientType ¶
type ClientType int8
var ( AnyClient ClientType UnknownClient ClientType = -1 BesuClient ClientType = 1 ErigonClient ClientType = 2 EthjsClient ClientType = 3 GethClient ClientType = 4 NethermindClient ClientType = 5 RethClient ClientType = 6 )
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 HeadFork ¶
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) GetReadyEndpoints ¶
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.