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 DBDir 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 SendAsync ¶ added in v0.10.0
type SendAsync func(ctx context.Context, submission xchain.Submission) <-chan error
SendAsync sends a submission to the destination chain asynchronously by invoking "xsubmit" on portal contract. It returns a channel that will receive an error if the submission fails or nil when it succeeds. Nonces are however reserved synchronously, so ordering of submissions is preserved.
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender uses txmgr to send transactions to a specific destination chain.
func NewSender ¶
func NewSender( network netconf.ID, chain netconf.Chain, rpcClient ethclient.Client, privateKey ecdsa.PrivateKey, chainNames map[xchain.ChainVersion]string, onSubmit onSubmitFunc, ) (Sender, error)
NewSender returns a new sender.
type StreamUpdate ¶
type StreamUpdate struct { xchain.StreamID MsgTree xchain.MsgTree Attestation xchain.Attestation // Attestation for the xmsgs Msgs []xchain.Msg // msgs that increment the cursor ValSet []cchain.PortalValidator }
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() (SendAsync, error), awaitValSet awaitValSet, cursors *cursor.Store, ) *Worker
NewWorker creates a new worker for a single destination chain.