teleportstarknet

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

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

New creates a new instance of TeleportEventProvider.

func (*TeleportEventProvider) Events

func (tp *TeleportEventProvider) Events() chan *messages.Event

Events implements the publisher.Listener interface.

func (*TeleportEventProvider) Start

func (tp *TeleportEventProvider) Start(ctx context.Context) error

Start 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL