Documentation ¶
Index ¶
- type Chain
- func (c *Chain) GetBlock(blockHash types.Hash) (*types.SignedBlock, error)
- func (c *Chain) GetBlockHash(blockNumber uint64) (types.Hash, error)
- func (c *Chain) GetBlockHashLatest() (types.Hash, error)
- func (c *Chain) GetBlockLatest() (*types.SignedBlock, error)
- func (c *Chain) GetFinalizedHead() (types.Hash, error)
- func (c *Chain) GetHeader(blockHash types.Hash) (*types.Header, error)
- func (c *Chain) GetHeaderLatest() (*types.Header, error)
- func (c *Chain) SubscribeFinalizedHeads() (*FinalizedHeadsSubscription, error)
- func (c *Chain) SubscribeNewHeads() (*NewHeadsSubscription, error)
- type FinalizedHeadsSubscription
- type NewHeadsSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain exposes methods for retrieval of chain data
func (*Chain) GetBlock ¶
GetBlock returns the header and body of the relay chain block with the given hash
func (*Chain) GetBlockHash ¶
GetBlockHash returns the block hash for a specific block height
func (*Chain) GetBlockHashLatest ¶
GetBlockHashLatest returns the latest block hash
func (*Chain) GetBlockLatest ¶
func (c *Chain) GetBlockLatest() (*types.SignedBlock, error)
GetBlockLatest returns the header and body of the latest relay chain block
func (*Chain) GetFinalizedHead ¶
GetFinalizedHead returns the hash of the last finalized block in the canon chain
func (*Chain) GetHeaderLatest ¶
GetHeaderLatest retrieves the header of the latest block
func (*Chain) SubscribeFinalizedHeads ¶
func (c *Chain) SubscribeFinalizedHeads() (*FinalizedHeadsSubscription, error)
SubscribeFinalizedHeads subscribes the best finalized headers, returning a subscription that will receive server notifications containing the Header.
func (*Chain) SubscribeNewHeads ¶
func (c *Chain) SubscribeNewHeads() (*NewHeadsSubscription, error)
SubscribeNewHeads subscribes the best headers, returning a subscription that will receive server notifications containing the Header.
type FinalizedHeadsSubscription ¶
type FinalizedHeadsSubscription struct {
// contains filtered or unexported fields
}
FinalizedHeadsSubscription is a subscription established through one of the Client's subscribe methods.
func (*FinalizedHeadsSubscription) Chan ¶
func (s *FinalizedHeadsSubscription) Chan() <-chan types.Header
Chan returns the subscription channel.
The channel is closed when Unsubscribe is called on the subscription.
func (*FinalizedHeadsSubscription) Err ¶
func (s *FinalizedHeadsSubscription) Err() <-chan error
Err returns the subscription error channel. The intended use of Err is to schedule resubscription when the client connection is closed unexpectedly.
The error channel receives a value when the subscription has ended due to an error. The received error is nil if Close has been called on the underlying client and no other error has occurred.
The error channel is closed when Unsubscribe is called on the subscription.
func (*FinalizedHeadsSubscription) Unsubscribe ¶
func (s *FinalizedHeadsSubscription) Unsubscribe()
Unsubscribe unsubscribes the notification and closes the error channel. It can safely be called more than once.
type NewHeadsSubscription ¶
type NewHeadsSubscription struct {
// contains filtered or unexported fields
}
NewHeadsSubscription is a subscription established through one of the Client's subscribe methods.
func (*NewHeadsSubscription) Chan ¶
func (s *NewHeadsSubscription) Chan() <-chan types.Header
Chan returns the subscription channel.
The channel is closed when Unsubscribe is called on the subscription.
func (*NewHeadsSubscription) Err ¶
func (s *NewHeadsSubscription) Err() <-chan error
Err returns the subscription error channel. The intended use of Err is to schedule resubscription when the client connection is closed unexpectedly.
The error channel receives a value when the subscription has ended due to an error. The received error is nil if Close has been called on the underlying client and no other error has occurred.
The error channel is closed when Unsubscribe is called on the subscription.
func (*NewHeadsSubscription) Unsubscribe ¶
func (s *NewHeadsSubscription) Unsubscribe()
Unsubscribe unsubscribes the notification and closes the error channel. It can safely be called more than once.