client

package
v0.1.0 Latest Latest
Warning

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

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

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
}

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:"-"`
}

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:"-"`
}

type ChainTxEvents

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

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
msp
protos
Package protos is a generated protocol buffer package.
Package protos is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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