Documentation
¶
Index ¶
- Variables
- type AppchainHandler
- type Config
- type Handler
- type IBTPHandler
- type Option
- type RecoverUnionHandler
- type RollbackHandler
- type SubscriptionKey
- type Syncer
- type WrapperSyncer
- func (syncer *WrapperSyncer) GetAppchains() ([]*appchainmgr.Appchain, error)
- func (syncer *WrapperSyncer) GetInterchainById(from string) *pb.Interchain
- func (syncer *WrapperSyncer) ListenIBTP() <-chan *pb.IBTPX
- 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) 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 link33 failed") ErrMetaOutOfDate = fmt.Errorf("interchain meta is out of date") )
Functions ¶
This section is empty.
Types ¶
type AppchainHandler ¶
type AppchainHandler func() error
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func GenerateConfig ¶
type Handler ¶
type Handler interface { // 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 }
type IBTPHandler ¶
type Option ¶
type Option func(*Config)
func WithClient ¶
func WithLogger ¶
func WithLogger(logger logrus.FieldLogger) Option
func WithStorage ¶
type RecoverUnionHandler ¶
type RecoverUnionHandler func(ibtp *pb.IBTP) (*rpcx.Interchain, error)
type RollbackHandler ¶
type SubscriptionKey ¶
type Syncer ¶
type Syncer interface { // 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 sidecar from bitxhub ListenIBTP() <-chan *pb.IBTPX // 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 RegisterRollbackHandler(handler RollbackHandler) error }
type WrapperSyncer ¶
type WrapperSyncer struct {
// contains filtered or unexported fields
}
WrapperSyncer represents the necessary data for sync tx wrappers from link33
func New ¶
func New(sidecarID, appchainDID string, mode string, opts ...Option) (*WrapperSyncer, error)
New creates instance of WrapperSyncer given agent interacting with link33, validators addresses of link33 and local storage
func (*WrapperSyncer) GetAppchains ¶
func (syncer *WrapperSyncer) GetAppchains() ([]*appchainmgr.Appchain, error)
func (*WrapperSyncer) GetInterchainById ¶
func (syncer *WrapperSyncer) GetInterchainById(from string) *pb.Interchain
func (*WrapperSyncer) ListenIBTP ¶
func (syncer *WrapperSyncer) ListenIBTP() <-chan *pb.IBTPX
func (*WrapperSyncer) QueryInterchainMeta ¶
func (syncer *WrapperSyncer) QueryInterchainMeta() *pb.Interchain
func (*WrapperSyncer) RegisterAppchainHandler ¶
func (syncer *WrapperSyncer) RegisterAppchainHandler(handler AppchainHandler) error
func (*WrapperSyncer) RegisterRollbackHandler ¶
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.