Documentation
¶
Index ¶
- type Agent
- type BxhAgent
- func (agent *BxhAgent) Appchain() (*rpcx.Appchain, error)
- func (agent *BxhAgent) GetChainMeta() (*pb.ChainMeta, error)
- func (agent *BxhAgent) GetIBTPByID(id string) (*pb.IBTP, error)
- func (agent *BxhAgent) GetMerkleWrapper(begin, end uint64) (chan *pb.MerkleWrapper, 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) SyncMerkleWrapper(ctx context.Context) (chan *pb.MerkleWrapper, 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)
// SyncMerkleWrapper tries to get an channel of merkleWrappers from bitxhub.
// A merkleWrapper includes block header and interchain txs.
// Note: only the wrapper beyond the height of sync-wrapper request moment will be sent to this channel
SyncMerkleWrapper(ctx context.Context) (chan *pb.MerkleWrapper, error)
// GetMerkleWrapper tries to get wrappers whose height is in the interval of [begin, end]
// All these wrappers will be sent the channel.
GetMerkleWrapper(begin, end uint64) (chan *pb.MerkleWrapper, 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)
}
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) GetChainMeta ¶
GetChainMeta implements Agent
func (*BxhAgent) GetIBTPByID ¶
GetIBTPByID implements Agent
func (*BxhAgent) GetMerkleWrapper ¶
func (agent *BxhAgent) GetMerkleWrapper(begin, end uint64) (chan *pb.MerkleWrapper, error)
GetMerkleWrapper implements Agent
func (*BxhAgent) GetReceipt ¶
GetReceipt implements Agent
func (*BxhAgent) SendTransaction ¶
SendTransaction implements Agent
func (*BxhAgent) SyncMerkleWrapper ¶
SyncMerkleWrapper implements Agent
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.