Documentation
¶
Index ¶
- type Agent
- type BxhAgent
- func (agent *BxhAgent) Appchain() (*rpcx.Appchain, error)
- func (agent *BxhAgent) GetAssetExchangeSigns(id string) ([]byte, error)
- func (agent *BxhAgent) GetBlockHeader(ctx context.Context, begin, end uint64, ch chan *pb.BlockHeader) error
- func (agent *BxhAgent) GetChainMeta() (*pb.ChainMeta, error)
- func (agent *BxhAgent) GetIBTPByID(id string) (*pb.IBTP, error)
- func (agent *BxhAgent) GetInterchainMeta() (*rpcx.Interchain, error)
- func (agent *BxhAgent) GetInterchainTxWrapper(ctx context.Context, begin, end uint64, ch chan *pb.InterchainTxWrapper) error
- func (agent *BxhAgent) GetReceipt(hash string) (*pb.Receipt, error)
- func (agent *BxhAgent) SendIBTP(ibtp *pb.IBTP) (*pb.Receipt, error)
- func (agent *BxhAgent) SendTransaction(tx *pb.Transaction) (*pb.Receipt, error)
- func (agent *BxhAgent) Stop() error
- func (agent *BxhAgent) SyncBlockHeader(ctx context.Context, headerCh chan *pb.BlockHeader) error
- func (agent *BxhAgent) SyncInterchainTxWrapper(ctx context.Context, txCh chan *pb.InterchainTxWrapper) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface {
// Appchain will query if this appchain has registered to bitxhub.
// If this appchain related to the pier has registered, bitxhub will return
// some basic info about this chain. Otherwise, pier will get not exist appchain error.
Appchain() (*rpcx.Appchain, error)
// syncBlockHeaer tries to get an channel of Headers from bitxhub.
// Note: only the header beyond the height of sync-header request moment will be sent to this channel
SyncBlockHeader(ctx context.Context, ch chan *pb.BlockHeader) error
// GetBlockHeader tries to get headers whose height is in the interval of [begin, end]
// All these headers will be sent the channel.
GetBlockHeader(ctx context.Context, begin, end uint64, ch chan *pb.BlockHeader) error
// SyncInterchainTxWrapper tries to get an channel of interchain tx wrapper from bitxhub.
// Note: only the interchain tx wrappers beyond the height of sync-header request moment will be sent to this channel
SyncInterchainTxWrapper(ctx context.Context, ch chan *pb.InterchainTxWrapper) error
// GetInterchainTxWrapper tries to get txWrappers whose height is in the interval of [begin, end]
// All these wrappers will be sent the channel.
GetInterchainTxWrapper(ctx context.Context, begin, end uint64, ch chan *pb.InterchainTxWrapper) error
// SendTransaction sends the wrapped interchain tx to bitxhub
SendTransaction(tx *pb.Transaction) (*pb.Receipt, error)
// SendIBTP sends wrapped ibtp to bitxhub internal VM to execute
SendIBTP(ibtp *pb.IBTP) (*pb.Receipt, error)
// GetIBTPByID queries interchain ibtp package record
// given an unique id of ibtp from bitxhub
GetIBTPByID(id string) (*pb.IBTP, error)
// GetChainMeta gets chain meta of relay chain
GetChainMeta() (*pb.ChainMeta, error)
GetInterchainMeta() (*rpcx.Interchain, error)
GetAssetExchangeSigns(id string) ([]byte, error)
}
type BxhAgent ¶
type BxhAgent struct {
// contains filtered or unexported fields
}
BxhAgent represents the necessary data for interacting with bitxhub
func New ¶
New create an instance of BxhAgent given the client of bitxhub and the appchain id and some configuration of bitxhub
func (*BxhAgent) GetAssetExchangeSigns ¶ added in v1.4.0
func (*BxhAgent) GetBlockHeader ¶
func (*BxhAgent) GetChainMeta ¶
GetChainMeta implements Agent
func (*BxhAgent) GetIBTPByID ¶
GetIBTPByID implements Agent
func (*BxhAgent) GetInterchainMeta ¶
func (agent *BxhAgent) GetInterchainMeta() (*rpcx.Interchain, error)
func (*BxhAgent) GetInterchainTxWrapper ¶
func (agent *BxhAgent) GetInterchainTxWrapper(ctx context.Context, begin, end uint64, ch chan *pb.InterchainTxWrapper) error
GetInterchainTxWrapper implements Agent
func (*BxhAgent) GetReceipt ¶
GetReceipt implements Agent
func (*BxhAgent) SendTransaction ¶
SendTransaction implements Agent
func (*BxhAgent) SyncBlockHeader ¶
func (*BxhAgent) SyncInterchainTxWrapper ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_agent is a generated GoMock package.
|
Package mock_agent is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.