Documentation
¶
Index ¶
- type ChannelExecutor
- func (e *ChannelExecutor) ExecuteIBTP(wIbtp *model.WrappedIBTP) (*pb.IBTP, error)
- func (e *ChannelExecutor) QueryCallbackMeta() map[string]uint64
- func (e *ChannelExecutor) QueryIBTPReceipt(originalIBTP *pb.IBTP) (*pb.IBTP, error)
- func (e *ChannelExecutor) QueryInterchainMeta() map[string]uint64
- func (e *ChannelExecutor) Rollback(ibtp *pb.IBTP, isSrcChain bool)
- func (e *ChannelExecutor) Start() error
- func (e *ChannelExecutor) Stop() error
- type Executor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelExecutor ¶
type ChannelExecutor struct {
// contains filtered or unexported fields
}
ChannelExecutor represents the necessary data for executing interchain txs in appchain
func New ¶
func New(client plugins.Client, pierID string, storage storage.Storage, cryptor txcrypto.Cryptor, logger logrus.FieldLogger) (*ChannelExecutor, error)
New creates new instance of Executor. agent is for interacting with counterpart chain client is for interacting with appchain, meta is for recording interchain tx meta information and ds is for persisting some runtime messages
func (*ChannelExecutor) ExecuteIBTP ¶ added in v1.5.0
func (e *ChannelExecutor) ExecuteIBTP(wIbtp *model.WrappedIBTP) (*pb.IBTP, error)
ExecuteIBTP handles ibtps of any type, which can be categorized into: 1. ibtp for interchain operations, then a ibtp-encoded receipt will be returned. And this receipt should be sent back to counterparty. 2. ibtp for confirmation from counterparty. This kind of ibtp is used to confirm the status of ibtp invoked by this pier, and it will return nothing.
func (*ChannelExecutor) QueryCallbackMeta ¶ added in v1.5.0
func (e *ChannelExecutor) QueryCallbackMeta() map[string]uint64
func (*ChannelExecutor) QueryIBTPReceipt ¶ added in v1.5.0
getReceipt only generates one receipt given source chain id and interchain tx index
func (*ChannelExecutor) QueryInterchainMeta ¶ added in v1.5.0
func (e *ChannelExecutor) QueryInterchainMeta() map[string]uint64
type Executor ¶
type Executor interface { // Start starts the service of executor Start() error // Stop stops the service of executor Stop() error // ExecuteIBTP handles interchain ibtps from other appchains // and return the receipt ibtp for ack or callback ExecuteIBTP(wIbtp *model.WrappedIBTP) (*pb.IBTP, error) // Rollback rollbacks ibtp on appchain Rollback(ibtp *pb.IBTP, isSrcChain bool) // QueryInterchainMeta queries latest index map of ibtps executed on appchain // For the returned map, key is the source chain ID, // and value is the latest index of tx executed on appchain QueryInterchainMeta() map[string]uint64 // QueryCallbackMeta queries latest index map of ibtps callbacks executed on appchain // For the returned map, key is the destination chain ID, // and value is the latest index of callback executed on appchain QueryCallbackMeta() map[string]uint64 // QueryIBTPReceipt query receipt for original interchain ibtp QueryIBTPReceipt(originalIBTP *pb.IBTP) (*pb.IBTP, error) }
Directories
¶
Path | Synopsis |
---|---|
Package mock_executor is a generated GoMock package.
|
Package mock_executor is a generated GoMock package. |