Documentation ¶
Index ¶
Constants ¶
View Source
const LoggerTag = "STARKNET_TELEPORT_LISTENER"
View Source
const TeleportEventType = "teleport_starknet"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sequencer ¶
type Sequencer interface { GetPendingBlock(ctx context.Context) (*starknet.Block, error) GetLatestBlock(ctx context.Context) (*starknet.Block, error) GetBlockByNumber(ctx context.Context, blockNumber uint64) (*starknet.Block, error) }
Sequencer is a Starknet sequencer.
type TeleportListener ¶
type TeleportListener struct {
// contains filtered or unexported fields
}
TeleportListener listens for TeleportGUID events on Starknet from pending blocks and, if BlockDelta is set, also from accepted blocks.
https://github.com/makerdao/dss-teleport
func NewTeleportListener ¶
func NewTeleportListener(cfg TeleportListenerConfig) *TeleportListener
NewTeleportListener creates a new instance of TeleportListener.
func (*TeleportListener) Events ¶
func (tl *TeleportListener) Events() chan *messages.Event
Events implements the publisher.Listener interface.
type TeleportListenerConfig ¶
type TeleportListenerConfig struct { // Sequencer is an instance of Ethereum RPC sequencer. Sequencer Sequencer // Addresses is a list of contracts from which events will be fetched. Addresses []*starknet.Felt // Interval specifies how often listener should check for new events. Interval time.Duration // BlocksDelta is a list of distances between the latest accepted block on // the blockchain and blocks from which events are to be fetched. If empty, // then only events from pending block will be fetched. The purpose of this // field is to ensure that older events are resent from time to time. // This is to allow other clients on the Oracle network to restore its state // and ensure that no events are missed in the event of an Oracle failure. BlocksDelta []int // BlocksLimit specifies how from many blocks events can be fetched at once. BlocksLimit int // Logger is an instance of a logger. Logger is used mostly to report // recoverable errors. Logger log.Logger }
TeleportListenerConfig contains a configuration options for NewTeleportListener.
Click to show internal directories.
Click to hide internal directories.