syncer

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

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 IBTPHandler

type IBTPHandler func(ibtp *pb.IBTP)

type RecoverUnionHandler added in v1.4.0

type RecoverUnionHandler func(ibtp *pb.IBTP) (*rpcx.Interchain, error)

type RollbackHandler added in v1.6.1

type RollbackHandler func(ibtp *pb.IBTP, ibtpId string)

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL