Documentation ¶
Index ¶
- type Backend
- type BlockHash
- type BlockStatus
- type EventSystem
- type MockBackend
- func (b *MockBackend) ConsensusInfoByEpochRange(fromEpoch uint64) []*eventTypes.MinimalEpochConsensusInfo
- func (b *MockBackend) CurrentEpoch() uint64
- func (b *MockBackend) FetchPanBlockStatus(slot uint64, hash common.Hash) (status Status, err error)
- func (b *MockBackend) FetchVanBlockStatus(slot uint64, hash common.Hash) (status Status, err error)
- func (b *MockBackend) GetPendingHashes() (response *PendingHashesResponse, err error)
- func (mb *MockBackend) GetSlotStatus(ctx context.Context, slot uint64, requestType bool) Status
- func (b *MockBackend) SubscribeNewEpochEvent(ch chan<- *eventTypes.MinimalEpochConsensusInfo) event.Subscription
- type PendingHashesResponse
- type PublicFilterAPI
- func (api *PublicFilterAPI) ConfirmPanBlockHashes(ctx context.Context, requests []*BlockHash) ([]*BlockStatus, error)
- func (api *PublicFilterAPI) ConfirmVanBlockHashes(ctx context.Context, requests []*BlockHash) (response []*BlockStatus, err error)
- func (api *PublicFilterAPI) GetPendingHashes() (response *PendingHashesResponse, err error)
- func (api *PublicFilterAPI) MinimalConsensusInfo(ctx context.Context, epoch uint64) (*rpc.Subscription, error)
- type RealmPair
- type Status
- type Subscription
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { CurrentEpoch() uint64 ConsensusInfoByEpochRange(fromEpoch uint64) []*generalTypes.MinimalEpochConsensusInfo SubscribeNewEpochEvent(chan<- *generalTypes.MinimalEpochConsensusInfo) event.Subscription FetchPanBlockStatus(slot uint64, hash common.Hash) (status Status, err error) FetchVanBlockStatus(slot uint64, hash common.Hash) (status Status, err error) GetPendingHashes() (response *PendingHashesResponse, err error) GetSlotStatus(ctx context.Context, slot uint64, requestType bool) Status }
type BlockStatus ¶ added in v0.7.0
type EventSystem ¶
type EventSystem struct {
// contains filtered or unexported fields
}
EventSystem creates subscriptions, processes events and broadcasts them to the subscription which match the subscription criteria.
func NewEventSystem ¶
func NewEventSystem(backend Backend) *EventSystem
NewEventSystem creates a new manager that listens for event on the given mux, parses and filters them. It uses the all map to retrieve filter changes. The work loop holds its own index that is used to forward events to filters.
The returned manager has a loop that needs to be stopped with the Stop function or by stopping the given mux.
func (*EventSystem) SubscribeConsensusInfo ¶
func (es *EventSystem) SubscribeConsensusInfo(consensusInfo chan *types.MinimalEpochConsensusInfo, epoch uint64) *Subscription
SubscribePendingTxs creates a subscription that writes transaction hashes for transactions that enter the transaction pool.
type MockBackend ¶
type MockBackend struct { ConsensusInfoFeed event.Feed ConsensusInfos []*eventTypes.MinimalEpochConsensusInfo CurEpoch uint64 }
func (*MockBackend) ConsensusInfoByEpochRange ¶
func (b *MockBackend) ConsensusInfoByEpochRange(fromEpoch uint64) []*eventTypes.MinimalEpochConsensusInfo
func (*MockBackend) CurrentEpoch ¶
func (b *MockBackend) CurrentEpoch() uint64
func (*MockBackend) FetchPanBlockStatus ¶
func (*MockBackend) FetchVanBlockStatus ¶
func (*MockBackend) GetPendingHashes ¶
func (b *MockBackend) GetPendingHashes() (response *PendingHashesResponse, err error)
func (*MockBackend) GetSlotStatus ¶ added in v0.7.0
func (*MockBackend) SubscribeNewEpochEvent ¶
func (b *MockBackend) SubscribeNewEpochEvent(ch chan<- *eventTypes.MinimalEpochConsensusInfo) event.Subscription
type PendingHashesResponse ¶
type PendingHashesResponse struct { VanguardHashes []*generalTypes.HeaderHash PandoraHashes []*generalTypes.HeaderHash VanguardHashesLen int64 PandoraHashesLen int64 UnixTime int64 }
This is for debug purpose only
type PublicFilterAPI ¶
type PublicFilterAPI struct {
// contains filtered or unexported fields
}
PublicFilterAPI offers support to create and manage filters. This will allow external clients to retrieve various information related to the Ethereum protocol such als blocks, transactions and logs.
func NewPublicFilterAPI ¶
func NewPublicFilterAPI(backend Backend, timeout time.Duration) *PublicFilterAPI
NewPublicFilterAPI returns a new PublicFilterAPI instance.
func (*PublicFilterAPI) ConfirmPanBlockHashes ¶ added in v0.7.0
func (api *PublicFilterAPI) ConfirmPanBlockHashes( ctx context.Context, requests []*BlockHash, ) ([]*BlockStatus, error)
ConfirmPanBlockHashes should be used to get the confirmation about known state of Pandora block hashes
func (*PublicFilterAPI) ConfirmVanBlockHashes ¶ added in v0.7.0
func (api *PublicFilterAPI) ConfirmVanBlockHashes( ctx context.Context, requests []*BlockHash, ) (response []*BlockStatus, err error)
ConfirmVanBlockHashes should be used to get the confirmation about known state of Vanguard block hashes
func (*PublicFilterAPI) GetPendingHashes ¶
func (api *PublicFilterAPI) GetPendingHashes() (response *PendingHashesResponse, err error)
GetPendingHashes This is only for debug purpose
func (*PublicFilterAPI) MinimalConsensusInfo ¶
func (api *PublicFilterAPI) MinimalConsensusInfo(ctx context.Context, epoch uint64) (*rpc.Subscription, error)
MinimalConsensusInfo
type RealmPair ¶
type RealmPair struct { Slot uint64 VanguardHash *generalTypes.HeaderHash PandoraHashes []*generalTypes.HeaderHash }
type Status ¶
type Status string
func FromDBStatus ¶
func FromDBStatus(status generalTypes.Status) (eventStatus Status)
TODO: consider it to merge into only string-based statuses
type Subscription ¶
Subscription is created when the client registers itself for a particular event.
func (*Subscription) Err ¶
func (sub *Subscription) Err() <-chan error
Err returns a channel that is closed when unsubscribed.
func (*Subscription) Unsubscribe ¶
func (sub *Subscription) Unsubscribe()
Unsubscribe uninstalls the subscription from the event broadcast loop.