relayer

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultFlushInterval = 5 * time.Minute

	SaveHeightMaxAfter = 10
	RouteDuration      = 1 * time.Second

	FinalityInterval = 5 * time.Second
)

Functions

This section is empty.

Types

type Chain

type Chain struct {
	ChainProvider provider.ChainProvider
	// contains filtered or unexported fields
}

func NewChain

func NewChain(log *zap.Logger, prov provider.ChainProvider, debug bool) *Chain

func (*Chain) NID

func (c *Chain) NID() string

func (*Chain) String

func (c *Chain) String() string

type ChainRuntime

type ChainRuntime struct {
	Provider provider.ChainProvider

	LastBlockHeight uint64
	LastSavedHeight uint64
	MessageCache    *types.MessageCache
	// contains filtered or unexported fields
}

func NewChainRuntime

func NewChainRuntime(log *zap.Logger, chain *Chain) (*ChainRuntime, error)

type Chains

type Chains map[string]*Chain

Chains is a collection of Chain (mapped by chain_name)

func (Chains) Get

func (c Chains) Get(nid string) (*Chain, error)

Get returns the configuration for a given chain

func (Chains) GetAll

func (c Chains) GetAll() map[string]*Chain

type Relayer

type Relayer struct {
	// contains filtered or unexported fields
}

func NewRelayer

func NewRelayer(log *zap.Logger, db store.Store, chains map[string]*Chain, fresh bool) (*Relayer, error)

func (*Relayer) CheckFinality

func (r *Relayer) CheckFinality(ctx context.Context)

func (*Relayer) ClearMessages

func (r *Relayer) ClearMessages(ctx context.Context, msgs []*types.MessageKey, srcChain *ChainRuntime) error

func (*Relayer) ExecuteCall added in v1.1.0

func (r *Relayer) ExecuteCall(ctx context.Context, msg *types.RouteMessage, dst *ChainRuntime)

ExecuteCall

func (*Relayer) FindChainRuntime

func (r *Relayer) FindChainRuntime(nId string) (*ChainRuntime, error)

func (*Relayer) GetAllChainsRuntime

func (r *Relayer) GetAllChainsRuntime() []*ChainRuntime

func (*Relayer) GetBlockStore

func (r *Relayer) GetBlockStore() *store.BlockStore

GetBlockStore returns the block store

func (*Relayer) GetMessageStore

func (r *Relayer) GetMessageStore() *store.MessageStore

GetBlockStore returns the block store

func (*Relayer) HandleMessageFailed

func (r *Relayer) HandleMessageFailed(routeMessage *types.RouteMessage, dst, src *ChainRuntime)

func (*Relayer) PruneDB

func (r *Relayer) PruneDB() error

PruneDB removes all the messages from db

func (*Relayer) RouteMessage

func (r *Relayer) RouteMessage(ctx context.Context, m *types.RouteMessage, dst, src *ChainRuntime)

func (*Relayer) SaveBlockHeight

func (r *Relayer) SaveBlockHeight(ctx context.Context, chainRuntime *ChainRuntime, height uint64, messageCount int) error

func (*Relayer) Start

func (r *Relayer) Start(ctx context.Context, flushInterval time.Duration, fresh bool) (chan error, error)

main start loop

func (*Relayer) StartBlockProcessors

func (r *Relayer) StartBlockProcessors(ctx context.Context, errorChan chan error)

func (*Relayer) StartChainListeners

func (r *Relayer) StartChainListeners(ctx context.Context, errCh chan error)

func (*Relayer) StartFinalityProcessor

func (r *Relayer) StartFinalityProcessor(ctx context.Context)

func (*Relayer) StartRouter

func (r *Relayer) StartRouter(ctx context.Context, flushInterval time.Duration)

Directories

Path Synopsis
chains
evm

Jump to

Keyboard shortcuts

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