Documentation
¶
Index ¶
- Constants
- type ChainResult
- type FabAdaptor
- func (a *FabAdaptor) Count() (totalNumber int, consensusNumber int)
- func (a *FabAdaptor) GetChainName() string
- func (a *FabAdaptor) GetIP() string
- func (a *FabAdaptor) GetPort() int
- func (a *FabAdaptor) GetSequence() int64
- func (a *FabAdaptor) ObtainTx(chainID string, sequence int64) (*txs.TxQcp, error)
- func (a *FabAdaptor) QuerySequence(chainID string, inout string) (int64, error)
- func (a *FabAdaptor) Start() error
- func (a *FabAdaptor) Stop() error
- func (a *FabAdaptor) SubmitTx(chainID string, tx *txs.TxQcp) error
- func (a *FabAdaptor) Subscribe(listener ports.EventsListener)
- func (a *FabAdaptor) Sync() error
Constants ¶
View Source
const ( // ChainName name of hyperledger fabric ChainName = "fabric" // ChaincodeID id of chaincode ChaincodeID = "wallet" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainResult ¶
type ChainResult struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` ErrString string `json:"error,omitempty"` }
ChainResult result of hypelrdger fabric chaincode
type FabAdaptor ¶
type FabAdaptor struct {
// contains filtered or unexported fields
}
FabAdaptor provides adapter for hyperledger fabric
func (*FabAdaptor) Count ¶
func (a *FabAdaptor) Count() (totalNumber int, consensusNumber int)
Count Calculate the total and consensus number for chain
func (*FabAdaptor) GetChainName ¶
func (a *FabAdaptor) GetChainName() string
GetChainName returns chain name
func (*FabAdaptor) GetSequence ¶
func (a *FabAdaptor) GetSequence() int64
GetSequence returns sequence of tx in cache
func (*FabAdaptor) ObtainTx ¶
ObtainTx obtain Tx from hyperledger fabric chain
if Tx is register a new account:
call ethereum api to create a new account's key, and SubmitTx account's key back to fabric
if Tx is digital asset withdraw:
call ethereum api to transfer
func (*FabAdaptor) QuerySequence ¶
func (a *FabAdaptor) QuerySequence(chainID string, inout string) (int64, error)
QuerySequence query sequence of Tx in chaincode
func (*FabAdaptor) SubmitTx ¶
func (a *FabAdaptor) SubmitTx(chainID string, tx *txs.TxQcp) error
SubmitTx submit Tx to hyperledger fabric chain
func (*FabAdaptor) Subscribe ¶
func (a *FabAdaptor) Subscribe(listener ports.EventsListener)
Subscribe events from fabric chain
Click to show internal directories.
Click to hide internal directories.