Documentation
¶
Index ¶
- func FilterTopics() []common.Hash
- type BlockWatcher
- type EventDecoder
- type OrchestratorWatcher
- type SenderWatcher
- func (sw *SenderWatcher) ClaimedReserve(reserveHolder ethcommon.Address, claimant ethcommon.Address) (*big.Int, error)
- func (sw *SenderWatcher) Clear(addr ethcommon.Address)
- func (sw *SenderWatcher) GetSenderInfo(addr ethcommon.Address) (*pm.SenderInfo, error)
- func (sw *SenderWatcher) Stop()
- func (sw *SenderWatcher) Watch()
- type ServiceRegistryWatcher
- type TimeWatcher
- func (tw *TimeWatcher) GetTranscoderPoolSize() *big.Int
- func (tw *TimeWatcher) LastInitializedBlockHash() [32]byte
- func (tw *TimeWatcher) LastInitializedRound() *big.Int
- func (tw *TimeWatcher) LastSeenBlock() *big.Int
- func (tw *TimeWatcher) Stop()
- func (tw *TimeWatcher) SubscribeBlocks(sink chan<- *big.Int) event.Subscription
- func (tw *TimeWatcher) SubscribeRounds(sink chan<- types.Log) event.Subscription
- func (tw *TimeWatcher) Watch() error
- type UnbondingWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterTopics ¶
FilterTopics returns a list of topics to be used when filtering logs
Types ¶
type BlockWatcher ¶
type BlockWatcher interface { Subscribe(sink chan<- []*blockwatch.Event) event.Subscription GetLatestBlock() (*blockwatch.MiniHeader, error) }
type EventDecoder ¶
type EventDecoder struct {
// contains filtered or unexported fields
}
EventDecoder decodes logs into events for known contracts
func NewEventDecoder ¶
func NewEventDecoder(addr ethcommon.Address, abiJSON string) (*EventDecoder, error)
NewEventDecoder returns a new instance of EventDecoder with a contract binding to the provided ABI string
func (*EventDecoder) Decode ¶
func (e *EventDecoder) Decode(eventName string, log types.Log, decodedLog interface{}) error
Decode decodes a log into an event struct. An error will be returned if the log is not emitted from a known contract or if it does not map to a known event
func (*EventDecoder) FindEventName ¶
func (e *EventDecoder) FindEventName(log types.Log) (string, error)
FindEventName returns the event name for a log. An error will be returned if the log is not emitted from a known contract or if it does not map to a known event
type OrchestratorWatcher ¶ added in v0.5.1
type OrchestratorWatcher struct {
// contains filtered or unexported fields
}
func NewOrchestratorWatcher ¶ added in v0.5.1
func NewOrchestratorWatcher(bondingManagerAddr ethcommon.Address, watcher BlockWatcher, store common.OrchestratorStore, lpEth eth.LivepeerEthClient, tw timeWatcher) (*OrchestratorWatcher, error)
func (*OrchestratorWatcher) Stop ¶ added in v0.5.1
func (ow *OrchestratorWatcher) Stop()
Stop watching for events
func (*OrchestratorWatcher) Watch ¶ added in v0.5.1
func (ow *OrchestratorWatcher) Watch()
Watch starts the event watching loop
type SenderWatcher ¶
type SenderWatcher struct {
// contains filtered or unexported fields
}
SenderWatcher maintains a concurrency-safe map with SenderInfo
func NewSenderWatcher ¶
func NewSenderWatcher(ticketBrokerAddr ethcommon.Address, watcher BlockWatcher, lpEth eth.LivepeerEthClient, tw timeWatcher) (*SenderWatcher, error)
NewSenderWatcher initiates a new SenderWatcher
func (*SenderWatcher) ClaimedReserve ¶
func (sw *SenderWatcher) ClaimedReserve(reserveHolder ethcommon.Address, claimant ethcommon.Address) (*big.Int, error)
ClaimedReserve returns the amount claimed from a sender's reserve by the node operator
func (*SenderWatcher) Clear ¶
func (sw *SenderWatcher) Clear(addr ethcommon.Address)
Clear removes a key-value pair from the map
func (*SenderWatcher) GetSenderInfo ¶
func (sw *SenderWatcher) GetSenderInfo(addr ethcommon.Address) (*pm.SenderInfo, error)
GetSenderInfo returns information about a sender's deposit and reserve if values for a sender are not cached an RPC call to a remote ethereum node will be made to initialize the cache
type ServiceRegistryWatcher ¶ added in v0.5.1
type ServiceRegistryWatcher struct {
// contains filtered or unexported fields
}
func NewServiceRegistryWatcher ¶ added in v0.5.1
func NewServiceRegistryWatcher(serviceRegistryAddr ethcommon.Address, watcher BlockWatcher, store common.OrchestratorStore, lpEth eth.LivepeerEthClient) (*ServiceRegistryWatcher, error)
func (*ServiceRegistryWatcher) Stop ¶ added in v0.5.1
func (srw *ServiceRegistryWatcher) Stop()
Stop watching for events
func (*ServiceRegistryWatcher) Watch ¶ added in v0.5.1
func (srw *ServiceRegistryWatcher) Watch()
Watch starts the event watching loop
type TimeWatcher ¶ added in v0.5.5
type TimeWatcher struct {
// contains filtered or unexported fields
}
TimeWatcher allows for subscriptions to certain data feeds using a caller provided sink channel consumers of the TimeWatcher can subscribe to following data feeds:
- Last Initialized Round Number
- Last Seen Block Number
func NewTimeWatcher ¶ added in v0.5.5
func NewTimeWatcher(roundsManagerAddr ethcommon.Address, watcher BlockWatcher, lpEth eth.LivepeerEthClient) (*TimeWatcher, error)
NewTimeWatcher creates a new instance of TimeWatcher and sets the initial cache through an RPC call to an ethereum node
func (*TimeWatcher) GetTranscoderPoolSize ¶ added in v0.5.5
func (tw *TimeWatcher) GetTranscoderPoolSize() *big.Int
func (*TimeWatcher) LastInitializedBlockHash ¶ added in v0.5.5
func (tw *TimeWatcher) LastInitializedBlockHash() [32]byte
LastInitializedBlockHash returns the blockhash of the block the last round was initiated in
func (*TimeWatcher) LastInitializedRound ¶ added in v0.5.5
func (tw *TimeWatcher) LastInitializedRound() *big.Int
LastInitializedRound gets the last initialized round from cache
func (*TimeWatcher) LastSeenBlock ¶ added in v0.5.5
func (tw *TimeWatcher) LastSeenBlock() *big.Int
func (*TimeWatcher) SubscribeBlocks ¶ added in v0.5.5
func (tw *TimeWatcher) SubscribeBlocks(sink chan<- *big.Int) event.Subscription
SubscribeBlocks allows one to subscribe to newly seen block numbers To unsubscribe, simply call `Unsubscribe` on the returned subscription. The sink channel should have ample buffer space to avoid blocking other subscribers. Slow subscribers are not dropped.
func (*TimeWatcher) SubscribeRounds ¶ added in v0.5.5
func (tw *TimeWatcher) SubscribeRounds(sink chan<- types.Log) event.Subscription
SubscribeRounds allows one to subscribe to new round events To unsubscribe, simply call `Unsubscribe` on the returned subscription. The sink channel should have ample buffer space to avoid blocking other subscribers. Slow subscribers are not dropped.
func (*TimeWatcher) Watch ¶ added in v0.5.5
func (tw *TimeWatcher) Watch() error
Watch the blockwatch subscription for NewRound events
type UnbondingWatcher ¶
type UnbondingWatcher struct {
// contains filtered or unexported fields
}
UnbondingWatcher watches for on-chain events to update the state of an unbonding lock store
func NewUnbondingWatcher ¶
func NewUnbondingWatcher(addr ethcommon.Address, bondingManagerAddr ethcommon.Address, bw BlockWatcher, store unbondingLockStore) (*UnbondingWatcher, error)
NewUnbondingWatcher creates an UnbondingWatcher instance
func (*UnbondingWatcher) Stop ¶
func (w *UnbondingWatcher) Stop()
Stop signals the watcher loop to exit gracefully
func (*UnbondingWatcher) Watch ¶
func (w *UnbondingWatcher) Watch()
Watch kicks off a loop that handles events from a block subscription