client

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTxSubmitAndListenHandler

func NewTxSubmitAndListenHandler(txStatus *fab.TxStatusEvent) *txSubmitAndListenHandler

Types

type ChaincodeSpec

type ChaincodeSpec struct {
	Type    int    `json:"type"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

type IdentityClient

type IdentityClient interface {
	GetSigningIdentity(name string) (msp.SigningIdentity, error)
	GetClientOrg() string
}

type RPCClient

type RPCClient interface {
	Invoke(channelId, signer, chaincodeName, method string, args []string, isInit bool) (*TxReceipt, error)
	Query(channelId, signer, chaincodeName, method string, args []string) ([]byte, error)
	QueryChainInfo(channelId, signer string) (*fab.BlockchainInfoResponse, error)
	QueryBlock(channelId string, blockNumber uint64, signer string) (*utils.RawBlock, *utils.Block, error)
	QueryTransaction(channelId, signer, txId string) (map[string]interface{}, error)
	SubscribeEvent(subInfo *eventsapi.SubscriptionInfo, since uint64) (*RegistrationWrapper, <-chan *fab.BlockEvent, <-chan *fab.CCEvent, error)
	Unregister(*RegistrationWrapper)
	Close() error
}

func RPCConnect

func RPCConnect(c conf.RPCConf, txTimeout int) (RPCClient, identity.IdentityClient, error)

Instantiate an RPC client to interact with a Fabric network. based on the client configuration on gateway usage, it creates different types of client under the cover: - "useGatewayClient: true": returned RPCClient uses the client-side Gateway - "useGatewayClient: false": returned RPCClient uses a static network map described by the Connection Profile - "useGatewayServer: true": for Fabric 2.4 node only, the returned RPCClient utilizes the server-side gateway service

type RegistrationWrapper

type RegistrationWrapper struct {
	// contains filtered or unexported fields
}

type TxReceipt

type TxReceipt struct {
	BlockNumber     uint64              `json:"blockNumber"`
	SignerMSP       string              `json:"signerMSP"`
	Signer          string              `json:"signer"`
	ChaincodeSpec   ChaincodeSpec       `json:"chaincode"`
	TransactionID   string              `json:"transactionID"`
	Status          pb.TxValidationCode `json:"status"`
	SourcePeer      string              `json:"peer"`
	ResponsePayload []byte              `json:"responsePayload"`
}

func (*TxReceipt) IsSuccess

func (r *TxReceipt) IsSuccess() bool

Jump to

Keyboard shortcuts

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