fabric

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func (a *FabAdaptor) GetIP() string

GetIP returns chain node ip

func (*FabAdaptor) GetPort

func (a *FabAdaptor) GetPort() int

GetPort returns chain node port

func (*FabAdaptor) GetSequence

func (a *FabAdaptor) GetSequence() int64

GetSequence returns sequence of tx in cache

func (*FabAdaptor) ObtainTx

func (a *FabAdaptor) ObtainTx(chainID string, sequence int64) (*txs.TxQcp, error)

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

func (a *FabAdaptor) Start() error

Start fabric adapter service

func (*FabAdaptor) Stop

func (a *FabAdaptor) Stop() error

Stop fabric adapter service

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

func (*FabAdaptor) Sync

func (a *FabAdaptor) Sync() error

Sync status for fabric adapter service

Directories

Path Synopsis
sdk
tx

Jump to

Keyboard shortcuts

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