Documentation
¶
Index ¶
- Constants
- Variables
- func GetInterchainByServiceID(client rpcx.Client, fullServiceID string) *pb.Interchain
- func GetServiceInterchainMeta(client rpcx.Client, bxhID, appchainID string) (map[string]*pb.Interchain, error)
- type AppchainHandler
- type Config
- type IBTPHandler
- type Option
- type RecoverUnionHandler
- type RollbackHandler
- type SubscriptionKey
- type Syncer
- type WrapperSyncer
- func (syncer *WrapperSyncer) GetAppchains() ([]*appchainmgr.Appchain, error)
- func (syncer *WrapperSyncer) GetAssetExchangeSigns(id string) ([]byte, error)
- func (syncer *WrapperSyncer) GetBitXHubIDs() ([]string, error)
- func (syncer *WrapperSyncer) GetChainID() (uint64, error)
- func (syncer *WrapperSyncer) GetIBTPSigns(ibtp *pb.IBTP) ([]byte, error)
- func (syncer *WrapperSyncer) GetInterchainById(from string) *pb.Interchain
- func (syncer *WrapperSyncer) GetServiceIDs() ([]string, error)
- func (syncer *WrapperSyncer) GetTxStatus(id string) (pb.TransactionStatus, error)
- func (syncer *WrapperSyncer) ListenIBTP() <-chan *model.WrappedIBTP
- func (syncer *WrapperSyncer) QueryIBTP(ibtpID string, isReq bool) (*pb.IBTP, bool, error)
- func (syncer *WrapperSyncer) QueryInterchainMeta(serviceID string) *pb.Interchain
- func (syncer *WrapperSyncer) RegisterRollbackHandler(handler RollbackHandler) error
- func (syncer *WrapperSyncer) SendIBTP(ibtp *pb.IBTP) error
- func (syncer *WrapperSyncer) SendIBTPWithRetry(ibtp *pb.IBTP)
- func (syncer *WrapperSyncer) Start() error
- func (syncer *WrapperSyncer) Stop() error
Constants ¶
View Source
const ( CurAppchainNotAvailable = "current appchain not available" TargetAppchainNotAvailable = "target appchain not available" SrcBitXHubNotAvailable = "source bitxhub not available" TargetBitXHubNotAvailable = "target bitxhub not available" CurServiceNotAvailable = "current service not available" TargetServiceNotAvailable = "target service not available" InvalidTargetService = "invalid target service" )
Variables ¶
View Source
var ( ErrIBTPNotFound = fmt.Errorf("receipt from bitxhub failed") ErrMetaOutOfDate = fmt.Errorf("interchain meta is out of date") )
Functions ¶
func GetInterchainByServiceID ¶ added in v1.12.0
func GetInterchainByServiceID(client rpcx.Client, fullServiceID string) *pb.Interchain
func GetServiceInterchainMeta ¶ added in v1.12.0
Types ¶
type AppchainHandler ¶ added in v1.4.0
type AppchainHandler func() error
type Config ¶ added in v1.5.0
type Config struct {
// contains filtered or unexported fields
}
func GenerateConfig ¶ added in v1.5.0
type IBTPHandler ¶
type Option ¶ added in v1.5.0
type Option func(*Config)
func WithClient ¶ added in v1.5.0
func WithLogger ¶ added in v1.5.0
func WithLogger(logger logrus.FieldLogger) Option
func WithStorage ¶ added in v1.5.0
type RecoverUnionHandler ¶ added in v1.4.0
type RecoverUnionHandler func(ibtp *pb.IBTP) (*rpcx.Interchain, error)
type RollbackHandler ¶ added in v1.6.1
type SubscriptionKey ¶ added in v1.8.0
type Syncer ¶
type Syncer interface {
// Start starts the service of syncer
Start() error
// Stop stops the service of syncer
Stop() error
// QueryInterchainMeta queries meta including interchain and receipt related meta from bitxhub
QueryInterchainMeta(serviceID string) *pb.Interchain
// QueryIBTP query ibtp from bitxhub by its id.
// if error occurs, it means this ibtp is not existed on bitxhub
QueryIBTP(ibtpID string, isReq bool) (*pb.IBTP, bool, error)
// ListenIBTP listen on the ibtps destined for this pier from bitxhub
ListenIBTP() <-chan *model.WrappedIBTP
// SendIBTP sends interchain or receipt type of ibtp to bitxhub
// if error occurs, user need to reconstruct this ibtp cause it means ibtp is invalid on bitxhub
SendIBTP(ibtp *pb.IBTP) error
SendIBTPWithRetry(ibtp *pb.IBTP)
GetAssetExchangeSigns(id string) ([]byte, error)
//getIBTPSigns gets ibtp signs from bitxhub cluster
GetIBTPSigns(ibtp *pb.IBTP) ([]byte, error)
//GetAppchains gets appchains from bitxhub node
GetBitXHubIDs() ([]string, error)
//GetInterchainById gets interchain meta by service id
GetServiceIDs() ([]string, error)
GetChainID() (uint64, error)
RegisterRollbackHandler(handler RollbackHandler) error
GetTxStatus(id string) (pb.TransactionStatus, error)
}
type WrapperSyncer ¶
type WrapperSyncer struct {
// contains filtered or unexported fields
}
WrapperSyncer represents the necessary data for sync tx wrappers from bitxhub
func New ¶
func New(pierID, appchainID string, mode string, opts ...Option) (*WrapperSyncer, error)
New creates instance of WrapperSyncer given agent interacting with bitxhub, validators addresses of bitxhub and local storage
func (*WrapperSyncer) GetAppchains ¶ added in v1.5.0
func (syncer *WrapperSyncer) GetAppchains() ([]*appchainmgr.Appchain, error)
func (*WrapperSyncer) GetAssetExchangeSigns ¶ added in v1.5.0
func (syncer *WrapperSyncer) GetAssetExchangeSigns(id string) ([]byte, error)
func (*WrapperSyncer) GetBitXHubIDs ¶ added in v1.13.0
func (syncer *WrapperSyncer) GetBitXHubIDs() ([]string, error)
func (*WrapperSyncer) GetChainID ¶ added in v1.13.0
func (syncer *WrapperSyncer) GetChainID() (uint64, error)
func (*WrapperSyncer) GetIBTPSigns ¶ added in v1.5.0
func (syncer *WrapperSyncer) GetIBTPSigns(ibtp *pb.IBTP) ([]byte, error)
func (*WrapperSyncer) GetInterchainById ¶ added in v1.5.0
func (syncer *WrapperSyncer) GetInterchainById(from string) *pb.Interchain
func (*WrapperSyncer) GetServiceIDs ¶ added in v1.13.0
func (syncer *WrapperSyncer) GetServiceIDs() ([]string, error)
func (*WrapperSyncer) GetTxStatus ¶ added in v1.12.0
func (syncer *WrapperSyncer) GetTxStatus(id string) (pb.TransactionStatus, error)
func (*WrapperSyncer) ListenIBTP ¶ added in v1.5.0
func (syncer *WrapperSyncer) ListenIBTP() <-chan *model.WrappedIBTP
func (*WrapperSyncer) QueryInterchainMeta ¶ added in v1.5.0
func (syncer *WrapperSyncer) QueryInterchainMeta(serviceID string) *pb.Interchain
func (*WrapperSyncer) RegisterRollbackHandler ¶ added in v1.6.1
func (syncer *WrapperSyncer) RegisterRollbackHandler(handler RollbackHandler) error
func (*WrapperSyncer) SendIBTP ¶ added in v1.5.0
func (syncer *WrapperSyncer) SendIBTP(ibtp *pb.IBTP) error
func (*WrapperSyncer) SendIBTPWithRetry ¶ added in v1.13.0
func (syncer *WrapperSyncer) SendIBTPWithRetry(ibtp *pb.IBTP)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_syncer is a generated GoMock package.
|
Package mock_syncer is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.