client

package
v0.9.19 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
	AddSignerUpdateListener(SignerUpdateListener)
}

type RPCClient

type RPCClient interface {
	Invoke(channelID, signer, chaincodeName, method string, args []string, transientMap map[string]string, isInit bool) (*TxReceipt, error)
	Query(channelID, signer, chaincodeName, method string, args []string, strongread bool) ([]byte, error)
	QueryChainInfo(channelID, signer string) (*fab.BlockchainInfoResponse, error)
	QueryBlock(channelID string, signer string, blocknumber uint64, blockhash []byte) (*utils.RawBlock, *utils.Block, error)
	QueryBlockByTxID(channelID string, signer string, txID 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.Client, 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 SignerUpdateListener added in v0.9.15

type SignerUpdateListener interface {
	SignerUpdated(signer string)
}

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

type TxSubmitAndListenHandler added in v0.9.18

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

adapted from the CommitHandler in https://github.com/hyperledger/fabric-sdk-go in order to custom process the transaction status event

func NewTxSubmitAndListenHandler

func NewTxSubmitAndListenHandler(txStatus *fab.TxStatusEvent) *TxSubmitAndListenHandler

func (*TxSubmitAndListenHandler) Handle added in v0.9.18

func (h *TxSubmitAndListenHandler) Handle(requestContext *invoke.RequestContext, clientContext *invoke.ClientContext)

Jump to

Keyboard shortcuts

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