# README

Hyperledger Fabric Gateway Client API for Go

The Fabric Gateway client API allows applications to interact with a Hyperledger Fabric blockchain network. It implements the Fabric programming model, providing a simple API to submit transactions to a ledger or query the contents of a ledger with minimal code.

How to use

Samples showing how to create client applications that connect to and interact with a Hyperledger Fabric network, are available in the fabric-samples repository:

API documentation

The Gateway client API documentation for Go is available here:

Installation

Add a package dependency to your project with the command:

go get github.com/hyperledger/fabric-gateway

Compatibility

This API requires Fabric v2.4 (or later) with a Gateway enabled Peer. Additional compatibility information is available in the documentation:

# Functions

Connect to a Fabric Gateway using a client identity, gRPC connection and signing implementation.
NewFileCheckpointer creates a properly initialized FileCheckpointer.
WithArguments appends to the transaction function arguments associated with a transaction proposal.
WithBytesArguments appends to the transaction function arguments associated with a transaction proposal.
WithCheckpoint reads events starting at the checkpoint position.
WithClientConnection uses the supplied gRPC client connection to a Fabric Gateway.
WithCommitStatusTimeout specifies the default timeout for retrieving transaction commit status.
WithEndorseTimeout specifies the default timeout for endorsements.
WithEndorsingOrganizations specifies the organizations that should endorse the transaction proposal.
WithEvaluateTimeout specifies the default timeout for evaluating transactions.
WithHash uses the supplied hashing implementation to generate digital signatures.
WithSign uses the supplied signing implementation to sign messages sent by the Gateway.
WithStartBlock reads events starting at the specified block number.
WithSubmitTimeout specifies the default timeout for submit of transactions to the orderer.
WithTLSClientCertificateHash specifies the SHA-256 hash of the TLS client certificate.
WithTransient specifies the transient data associated with a transaction proposal.

# Structs

BlockAndPrivateDataEventsRequest delivers block and private data events.
BlockEventsRequest delivers block events.
ChaincodeEvent emitted by a transaction function.
ChaincodeEventsRequest delivers events emitted by transaction functions in a specific chaincode.
Commit provides access to a committed transaction.
CommitError represents a transaction that fails to commit successfully.
CommitStatusError represents a failure obtaining the commit status of a transaction.
Contract represents a smart contract, and allows applications to: - Evaluate transactions that query state from the ledger using the EvaluateTransaction() method.
EndorseError represents a failure endorsing a transaction proposal.
FileCheckpointer is a Checkpoint implementation backed by persistent file storage.
FilteredBlockEventsRequest delivers filtered block events.
Gateway representing the connection of a specific client identity to a Fabric Gateway.
InMemoryCheckpointer is a non-persistent Checkpoint implementation.
Network represents a network of nodes that are members of a specific Fabric channel.
Proposal represents a transaction proposal that can be sent to peers for endorsement or evaluated as a query.
Status of a committed transaction.
SubmitError represents a failure submitting an endorsed transaction to the orderer.
Transaction represents an endorsed transaction that can be submitted to the orderer for commit to the ledger.
TransactionError represents an error invoking a transaction.

# Interfaces

Checkpoint provides the current position for event processing.

# Type aliases

BlockEventsOption implements an option for a block events request.
ChaincodeEventsOption implements an option for a chaincode events request.
ConnectOption implements an option that can be used when connecting to a Fabric Gateway.
ProposalOption implements an option for a transaction proposal.