client

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 4 Imported by: 3

README

Caution

The implement directory of fabrics here have been deprecated. Check following modules:

hyperledger.abchain.org/adapter/yafabric/client for ya-fabric hyperledger.abchain.org/adapter/hyfabric/client for official fabric

Documentation

Index

Constants

View Source
const (
	TxStatus_Success = 0
	TxStatus_Fail    = 1
)

Variables

View Source
var ChainProxy_Impls = map[string]func() ChainClient{}
View Source
var Client_Impls = map[string]func() RpcClient{}

Functions

func NewFabricRPCConfig

func NewFabricRPCConfig(ccN string) *fabricRPCCfg

Types

type Chain

type Chain struct {
	Height int64
}

Chain for blockchain

type ChainBlock

type ChainBlock struct {
	Height       int64  `json:",string"`
	Hash         string `json:",omitempty"`
	PreviousHash string
	TimeStamp    time.Time           `json:",omitempty"`
	Transactions []*ChainTransaction `json:"-"`
	TxEvents     []*ChainTxEvents    `json:"-"`
}

ChainBlock represent a block concept for fabric-stype blocks Notice an transactions which is not accepted (i.e. no contribution to world-status) MUST NOT be put in Transactions field but one ChainTxEvents corresponding to this failed tx, with Status field is non-zero, can be put in TxEvents field

type ChainClient

type ChainClient interface {
	ViaWeb(*viper.Viper) ChainInfo
}

type ChainInfo

type ChainInfo interface {
	GetChain() (*Chain, error)
	GetBlock(int64) (*ChainBlock, error)
	GetTransaction(string) (*ChainTransaction, error)
	GetTxEvent(string) ([]*ChainTxEvents, error)
}

type ChainTransaction

type ChainTransaction struct {
	Height                  int64 `json:",string"`
	TxID, Chaincode, Method string
	CreatedFlag             bool
	TxArgs                  [][]byte `json:"-"`
}

ChainTransaction for tx

type ChainTxEvents

type ChainTxEvents struct {
	TxID, Chaincode, Name string
	Status                int
	Payload               []byte `json:"-"`
}

ChainTxEvents for events

type RpcClient

type RpcClient interface {
	Chain() (ChainInfo, error)
	Caller(*RpcSpec) (rpc.Caller, error)
	Load(*viper.Viper) error
	Quit()
}

type RpcSpec

type RpcSpec struct {
	//notice chaincode name is different to the ccname in txgenerator, the later
	//is used in the hyperledger-project compatible tx
	ChaincodeName string
	Attributes    []string
	Options       *viper.Viper
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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