Documentation
¶
Index ¶
- Variables
- 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) GetIBTPSigns(ibtp *pb.IBTP) ([]byte, error)
- func (syncer *WrapperSyncer) GetInterchainById(from string) *pb.Interchain
- func (syncer *WrapperSyncer) ListenIBTP() <-chan *model.WrappedIBTP
- func (syncer *WrapperSyncer) QueryIBTP(ibtpID string) (*pb.IBTP, bool, error)
- func (syncer *WrapperSyncer) QueryInterchainMeta() *pb.Interchain
- func (syncer *WrapperSyncer) RegisterAppchainHandler(handler AppchainHandler) error
- func (syncer *WrapperSyncer) RegisterRecoverHandler(handleRecover RecoverUnionHandler) error
- func (syncer *WrapperSyncer) RegisterRollbackHandler(handler RollbackHandler) error
- func (syncer *WrapperSyncer) SendIBTP(ibtp *pb.IBTP) error
- func (syncer *WrapperSyncer) Start() error
- func (syncer *WrapperSyncer) Stop() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIBTPNotFound = fmt.Errorf("receipt from bitxhub failed") ErrMetaOutOfDate = fmt.Errorf("interchain meta is out of date") )
Functions ¶
This section is empty.
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() *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) (*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 GetAssetExchangeSigns(id string) ([]byte, error) //getIBTPSigns gets ibtp signs from bitxhub cluster GetIBTPSigns(ibtp *pb.IBTP) ([]byte, error) //GetAppchains gets appchains from bitxhub node GetAppchains() ([]*appchainmgr.Appchain, error) //GetInterchainById gets interchain meta by appchain id GetInterchainById(from string) *pb.Interchain // RegisterRecoverHandler registers handler that recover ibtps from bitxhub RegisterRecoverHandler(RecoverUnionHandler) error // RegisterAppchainHandler registers handler that fetch appchains information RegisterAppchainHandler(handler AppchainHandler) error RegisterRollbackHandler(handler RollbackHandler) 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, appchainDID 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) 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) 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() *pb.Interchain
func (*WrapperSyncer) RegisterAppchainHandler ¶ added in v1.4.0
func (syncer *WrapperSyncer) RegisterAppchainHandler(handler AppchainHandler) error
func (*WrapperSyncer) RegisterRecoverHandler ¶ added in v1.4.0
func (syncer *WrapperSyncer) RegisterRecoverHandler(handleRecover RecoverUnionHandler) error
func (*WrapperSyncer) RegisterRollbackHandler ¶ added in v1.6.1
func (syncer *WrapperSyncer) RegisterRollbackHandler(handler RollbackHandler) error
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.