Documentation ¶
Index ¶
Constants ¶
View Source
const LoggerTag = "STARKNET_TELEPORT"
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 TeleportEventProvider ¶
type TeleportEventProvider struct {
// contains filtered or unexported fields
}
TeleportEventProvider 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 New ¶
func New(cfg TeleportEventProviderConfig) *TeleportEventProvider
New creates a new instance of TeleportEventProvider.
func (*TeleportEventProvider) Events ¶
func (tp *TeleportEventProvider) Events() chan *messages.Event
Events implements the publisher.Listener interface.
type TeleportEventProviderConfig ¶
type TeleportEventProviderConfig 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 provider 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. 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 }
TeleportEventProviderConfig contains a configuration options for New.
Click to show internal directories.
Click to hide internal directories.