Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSubmissions ¶
func CreateSubmissions(up StreamUpdate) ([]xchain.Submission, error)
CreateSubmissions splits the update into multiple submissions that are each small enough (wrt calldata and gas) to be submitted on-chain.
Types ¶
type Config ¶
type Config struct { RPCEndpoints xchain.RPCEndpoints PrivateKey string HaloURL string Network netconf.ID MonitoringAddr string StateFile string }
func DefaultConfig ¶
func DefaultConfig() Config
type CreateFunc ¶
type CreateFunc func(streamUpdate StreamUpdate) ([]xchain.Submission, error)
CreateFunc is a function that creates one or more submissions from the given stream update.
type SendFunc ¶
type SendFunc func(ctx context.Context, submission xchain.Submission) error
SendFunc sends a submission to the destination chain by invoking "xsubmit" on portal contract.
type Sender ¶ added in v0.1.2
type Sender struct {
// contains filtered or unexported fields
}
Sender uses txmgr to send transactions to the destination chain.
func NewSender ¶ added in v0.1.2
func NewSender(chain netconf.Chain, rpcClient ethclient.Client, privateKey ecdsa.PrivateKey, chainNames map[uint64]string) (Sender, error)
NewSender creates a new sender that uses txmgr to send transactions to the destination chain.
func (Sender) SendTransaction ¶ added in v0.1.2
SendTransaction sends the submission to the destination chain.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents the state of the relayer. It keeps track of the last successfully processed block.
func LoadCursors ¶
LoadCursors loads a file state from the given path.
func NewEmptyState ¶
NewEmptyState creates a new empty state with the given file path.
type StreamUpdate ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func NewWorker ¶
func NewWorker(destChain netconf.Chain, network netconf.Network, cProvider cchain.Provider, xProvider xchain.Provider, creator CreateFunc, sendProvider func() (SendFunc, error), state *State, awaitValSet awaitValSet, ) *Worker
NewWorker creates a new worker for a single destination chain.