diff --git a/main/api/java/allclasses-index.html b/main/api/java/allclasses-index.html index 2ba4cfe5c..8b3163185 100644 --- a/main/api/java/allclasses-index.html +++ b/main/api/java/allclasses-index.html @@ -1,11 +1,11 @@
- -CommitError is thrown to indicate that a transaction committed with an unsuccessful status code.
+Optional
causeTransaction validation status code. The value corresponds to one of the values enumerated by StatusCode.
-Optional
stackThe ID of the transaction.
-Static
Optional
prepareOptional override for formatting stack traces
-Static
stackStatic
captureGenerated using TypeDoc
Optional
causeTransaction validation status code. The value corresponds to one of the values enumerated by StatusCode.
+Optional
stackThe ID of the transaction.
+Static
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
CommitStatusError is thrown when a failure occurs obtaining the commit status of a transaction.
-CommitStatusError is thrown when a failure occurs obtaining the commit status of a transaction.
+Raw underlying gRPC error.
-gRPC status code.
-Raw underlying gRPC error.
+gRPC status code.
+https://grpc.github.io/grpc/core/md_doc_statuscodes.html for descriptions of status codes.
-gRPC error details.
-Optional
stackThe ID of the transaction.
-Static
Optional
prepareOptional override for formatting stack traces
-Static
stackStatic
captureGenerated using TypeDoc
gRPC error details.
+Optional
stackThe ID of the transaction.
+Static
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
EndorseError is thrown when a failure occurs endorsing a transaction proposal.
-EndorseError is thrown when a failure occurs endorsing a transaction proposal.
+Raw underlying gRPC error.
-gRPC status code.
-Raw underlying gRPC error.
+gRPC status code.
+https://grpc.github.io/grpc/core/md_doc_statuscodes.html for descriptions of status codes.
-gRPC error details.
-Optional
stackThe ID of the transaction.
-Static
Optional
prepareOptional override for formatting stack traces
-Static
stackStatic
captureGenerated using TypeDoc
gRPC error details.
+Optional
stackThe ID of the transaction.
+Static
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
A GatewayError is thrown if an error is encountered while processing a transaction through the gateway. +
A GatewayError is thrown if an error is encountered while processing a transaction through the gateway. Since the gateway delegates much of the processing to other nodes (endorsing peers and orderers), then the error could have originated from one or more of those nodes. In that case, the details field will contain an array of ErrorDetail objects.
-Raw underlying gRPC error.
-gRPC status code.
-Raw underlying gRPC error.
+gRPC status code.
+https://grpc.github.io/grpc/core/md_doc_statuscodes.html for descriptions of status codes.
-gRPC error details.
-Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
-Static
stackStatic
captureGenerated using TypeDoc
gRPC error details.
+Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
SubmitError is thrown when a failure occurs submitting an endorsed transaction to the orderer.
-SubmitError is thrown when a failure occurs submitting an endorsed transaction to the orderer.
+Raw underlying gRPC error.
-gRPC status code.
-Raw underlying gRPC error.
+gRPC status code.
+https://grpc.github.io/grpc/core/md_doc_statuscodes.html for descriptions of status codes.
-gRPC error details.
-Optional
stackThe ID of the transaction.
-Static
Optional
prepareOptional override for formatting stack traces
-Static
stackStatic
captureGenerated using TypeDoc
gRPC error details.
+Optional
stackThe ID of the transaction.
+Static
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
Create a checkpointer that uses the specified file to store persistent state.
-Path to a file holding persistent checkpoint state.
-Generated using TypeDoc
Create a checkpointer that uses the specified file to store persistent state.
+Path to a file holding persistent checkpoint state.
+Generated using TypeDoc
Create a checkpointer that stores its state in memory only.
-Generated using TypeDoc
Create a checkpointer that stores its state in memory only.
+Generated using TypeDoc
Connect to a Fabric Gateway using a client identity, gRPC connection and signing implementation.
-Connection options.
-A connected gateway.
- -Generated using TypeDoc
Connect to a Fabric Gateway using a client identity, gRPC connection and signing implementation.
+Connection options.
+A connected gateway.
+Generated using TypeDoc
Returns the input message unchanged. This can be used if the signing implementation requires the full message bytes, +
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Create an HSM Signer factory. A single signer factory instance should be used to create all required HSM signers.
-Generated using TypeDoc
Create an HSM Signer factory. A single signer factory instance should be used to create all required HSM signers.
+Generated using TypeDoc
Create a new signing implementation that uses the supplied private key to sign messages.
+Create a new signing implementation that uses the supplied private key to sign messages.
Currently supported private key types are:
The Ed25519 signer operates on the full message content, and should be combined with a none
(or no-op) hash
implementation to ensure the complete message is passed to the signer.
A private key.
-A signing implementation.
- -Generated using TypeDoc
A private key.
+A signing implementation.
+Generated using TypeDoc
The fabric-gateway package enables Node.js developers to build client applications using the Hyperledger Fabric programming model as described in the Running a Fabric Application tutorial of the Fabric documentation.
+The fabric-gateway package enables Node.js developers to build client applications using the Hyperledger Fabric programming model as described in the Running a Fabric Application tutorial of the Fabric documentation.
TypeScript definitions are included in this package.
Client applications interact with the blockchain network using a Fabric Gateway. A session for a given client identity is established by calling connect()
with a gRPC connection to a Fabric Gateway endpoint, client identity, and client signing implementation. The returned Gateway
enables interaction with any of the blockchain Networks
(channels) accessible through the Fabric Gateway. This in turn provides access to Smart Contracts
within chaincode deployed to that blockchain network, and to which transactions can be submitted or queries can be evaluated.
gRPC connections to a Fabric Gateway may be shared by all Gateway
instances interacting with that Fabric Gateway.
The following complete example shows how to connect to a Fabric network, submit a transaction and query the ledger state using an instantiated smart contract.
import * as grpc from '@grpc/grpc-js';
import * as crypto from 'crypto';
import { connect, Identity, signers } from '@hyperledger/fabric-gateway';
import { promises as fs } from 'fs';
import { TextDecoder } from 'util';
const utf8Decoder = new TextDecoder();
async function main(): Promise<void> {
const credentials = await fs.readFile('path/to/certificate.pem');
const identity: Identity = { mspId: 'myorg', credentials };
const privateKeyPem = await fs.readFile('path/to/privateKey.pem');
const privateKey = crypto.createPrivateKey(privateKeyPem);
const signer = signers.newPrivateKeySigner(privateKey);
const client = new grpc.Client('gateway.example.org:1337', grpc.credentials.createInsecure());
const gateway = connect({ identity, signer, client });
try {
const network = gateway.getNetwork('channelName');
const contract = network.getContract('chaincodeName');
const putResult = await contract.submitTransaction('put', 'time', new Date().toISOString());
console.log('Put result:', utf8Decoder.decode(putResult));
const getResult = await contract.evaluateTransaction('get', 'time');
console.log('Get result:', utf8Decoder.decode(getResult));
} finally {
gateway.close();
client.close()
}
}
main().catch(console.error);
-Generated using TypeDoc
Generated using TypeDoc
Delivers block and private data events.
-Delivers block and private data events.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Get block and private data events.
-Optional
options: CallOptionsgRPC call
-Block and private data protocol buffer messages. The iterator should be closed after use to complete +
Get block and private data events.
+Optional
options: CallOptionsgRPC call
+Block and private data protocol buffer messages. The iterator should be closed after use to complete the eventing session.
- -GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const events = await network.getBlockAndPrivateEventsData();
try {
for async (const event of events) {
// Process block and private data event
}
} finally {
events.close();
}
-Generated using TypeDoc
Generated using TypeDoc
Delivers block events.
-Delivers block events.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Get block events.
-Optional
options: CallOptionsgRPC call
-Block protocol buffer messages. The iterator should be closed after use to complete the eventing +
Get block events.
+Optional
options: CallOptionsgRPC call
+Block protocol buffer messages. The iterator should be closed after use to complete the eventing session.
- -GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const blocks = await request.getEvents();
try {
for async (const block of blocks) {
// Process block
}
} finally {
blocks.close();
}
-Generated using TypeDoc
Generated using TypeDoc
Chaincode event emitted by a transaction function.
-Chaincode event emitted by a transaction function.
+Block number that included this chaincode event.
-Chaincode that emitted this event.
-Name of the emitted event.
-Application defined payload data associated with this event.
-Transaction that emitted this chaincode event.
-Generated using TypeDoc
Block number that included this chaincode event.
+Chaincode that emitted this event.
+Name of the emitted event.
+Application defined payload data associated with this event.
+Transaction that emitted this chaincode event.
+Generated using TypeDoc
Delivers events emitted by transaction functions in a specific chaincode.
-Delivers events emitted by transaction functions in a specific chaincode.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Get chaincode events emitted by transaction functions of a specific chaincode.
-Optional
options: CallOptionsgRPC call options.
-The iterator should be closed after use to complete the eventing session.
- -Get chaincode events emitted by transaction functions of a specific chaincode.
+Optional
options: CallOptionsgRPC call options.
+The iterator should be closed after use to complete the eventing session.
+GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const events = await request.getEvents();
try {
for async (const event of events) {
// Process event
}
} finally {
events.close();
}
-Generated using TypeDoc
Generated using TypeDoc
Used to get the checkpointed state.
-Generated using TypeDoc
Generated using TypeDoc
Used to get the checkpointed state.
-Used to get the checkpointed state.
+To checkpoint chaincode event.
-Generated using TypeDoc
To checkpoint chaincode event.
+Generated using TypeDoc
An async iterable that can be closed when the consumer does not want to read any more elements, freeing up resources +
An async iterable that can be closed when the consumer does not want to read any more elements, freeing up resources that may be held by the iterable.
This type implements the Disposable interface, allowing instances to be disposed of with ECMAScript explicit
resource management and the using
keyword instead of calling close directly.
Generated using TypeDoc
Generated using TypeDoc
Allows access to information about a transaction that is committed to the ledger.
-Allows access to information about a transaction that is committed to the ledger.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Get status of the committed transaction. If the transaction has not yet committed, this method blocks until the +
Get status of the committed transaction. If the transaction has not yet committed, this method blocks until the commit occurs.
-Optional
options: CallOptionsgRPC call options.
-Optional
options: CallOptionsgRPC call options.
+CommitStatusError Thrown if the gRPC service invocation fails.
-Generated using TypeDoc
Generated using TypeDoc
Options used when connecting to a Fabric Gateway.
-function defaultTimeout(): grpc.CallOptions {
return {
deadline: Date.now() + 5000, // 5 second timeout
};
};
const options: ConnectOptions {
identity: {
mspId: 'myorg',
credentials,
},
signer: signers.newPrivateKeySigner(privateKey),
client: new grpc.Client('gateway.example.org:1337', grpc.credentials.createInsecure()),
evaluateOptions: defaultTimeout,
endorseOptions: defaultTimeout,
submitOptions: defaultTimeout,
commitStatusOptions: defaultTimeout,
};
+ConnectOptions | @hyperledger/fabric-gateway Interface ConnectOptions
Options used when connecting to a Fabric Gateway.
+Example
function defaultTimeout(): grpc.CallOptions {
return {
deadline: Date.now() + 5000, // 5 second timeout
};
};
const options: ConnectOptions {
identity: {
mspId: 'myorg',
credentials,
},
signer: signers.newPrivateKeySigner(privateKey),
client: new grpc.Client('gateway.example.org:1337', grpc.credentials.createInsecure()),
evaluateOptions: defaultTimeout,
endorseOptions: defaultTimeout,
submitOptions: defaultTimeout,
commitStatusOptions: defaultTimeout,
};
-
-
-Hierarchy
-
-- ConnectOptions
-
-
-
- Index
-
-
-Properties
- Hierarchy
- ConnectOptions
Index
Properties
block And Private Data Events Options?
block Events Options?
chaincode Events Options?
client
@@ -47,228 +13,18 @@ Properties
identity
signer?
submit Options?
-
-
-Properties
-
-Optional
block And Private Data Events Options
-block And Private Data Events Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for block and private data events.
-
-Returns CallOptions
-
-
-Optional
block Events Options
-block Events Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for block events.
-
-Returns CallOptions
-
-
-Optional
chaincode Events Options
-chaincode Events Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for chaincode events.
-
-Returns CallOptions
-
-
-client
-
-A gRPC client connection to a Fabric Gateway. This should be shared by all gateway instances connecting to the
+
Properties
Optional
block And Private Data Events Options
block And Private Data Events Options?: (() => CallOptions)Type declaration
- (): CallOptions
Supplier of default call options for block and private data events.
+Returns CallOptions
Optional
block Events Options
block Events Options?: (() => CallOptions)Type declaration
- (): CallOptions
Supplier of default call options for block events.
+Returns CallOptions
Optional
chaincode Events Options
chaincode Events Options?: (() => CallOptions)Type declaration
- (): CallOptions
Supplier of default call options for chaincode events.
+Returns CallOptions
client
A gRPC client connection to a Fabric Gateway. This should be shared by all gateway instances connecting to the
same Fabric Gateway. The client connection will not be closed when the gateway is closed.
-
-
-
-Optional
commit Status Options
-commit Status Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for retrieving transaction commit status.
-
-Returns CallOptions
-
-
-Optional
endorse Options
-endorse Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for endorsements.
-
-Returns CallOptions
-
-
-Optional
evaluate Options
-evaluate Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for evaluating transactions.
-
-Returns CallOptions
-
-
-Optional
filtered Block Events Options
-filtered Block Events Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for filtered block events.
-
-Returns CallOptions
-
-
-Optional
hash
-
-Hash implementation used by the gateway to generate digital signatures.
-
-
-
-identity
-
-Client identity used by the gateway.
-
-
-
-Optional
signer
-
-Signing implementation used to sign messages sent by the gateway.
-
-
-
-Optional
submit Options
-submit Options?: (() => CallOptions)
-
-Type declaration
-
--
-
-- (): CallOptions
--
-
Supplier of default call options for submit of transactions to the orderer.
-
-Returns CallOptions
-
-
-
-Generated using TypeDoc
-
\ No newline at end of file
+
Optional
commitSupplier of default call options for retrieving transaction commit status.
+Optional
endorseSupplier of default call options for endorsements.
+Optional
evaluateSupplier of default call options for evaluating transactions.
+Optional
filteredSupplier of default call options for filtered block events.
+Optional
hashHash implementation used by the gateway to generate digital signatures.
+Client identity used by the gateway.
+Optional
signerSigning implementation used to sign messages sent by the gateway.
+Optional
submitSupplier of default call options for submit of transactions to the orderer.
+Generated using TypeDoc
Represents a smart contract, and allows applications to:
+Represents a smart contract, and allows applications to:
Evaluate transaction
+Evaluate transaction
const result = await contract.evaluate('transactionName', {
arguments: ['one', 'two'],
// Specify additional proposal options here
});
-
Submit transaction
const result = await contract.submit('transactionName', {
arguments: ['one', 'two'],
// Specify additional proposal options here
});
-
Async submit
const commit = await contract.submitAsync('transactionName', {
arguments: ['one', 'two']
});
const result = commit.getResult();
// Update UI or reply to REST request before waiting for commit status
const status = await commit.getStatus();
if (!status.successful) {
throw new Error(`transaction ${status.transactionId} failed with status code ${status.code}`);
}
-
Fine-grained submit transaction
const proposal = contract.newProposal('transactionName');
const transaction = await proposal.endorse();
const commit = await transaction.submit();
const result = transaction.getResult();
const status = await commit.getStatus();
-
Off-line signing
const unsignedProposal = contract.newProposal('transactionName');
const proposalBytes = unsignedProposal.getBytes();
const proposalDigest = unsignedProposal.getDigest();
const proposalSignature = // Generate signature from digest
const signedProposal = gateway.newSignedProposal(proposalBytes, proposalSignature);
const unsignedTransaction = await signedProposal.endorse();
const transactionBytes = unsignedTransaction.getBytes();
const transactionDigest = unsignedTransaction.getDigest();
const transactionSignature = // Generate signature from digest
const signedTransaction = gateway.newSignedTransaction(transactionBytes, transactionSignature);
const unsignedCommit = await signedTransaction.submit();
const commitBytes = unsignedCommit.getBytes();
const commitDigest = unsignedCommit.getDigest();
const commitSignature = // Generate signature from digest
const signedCommit = gateway.newSignedCommit(commitBytes, commitSignature);
const result = signedTransaction.getResult();
const status = await signedCommit.getStatus();
-Evaluate a transaction function and return its results. A transaction proposal will be evaluated on endorsing peers but the transaction will not be sent to the ordering service and so will not be committed to the ledger. This can be used for querying the world state.
-Name of the transaction to invoke.
-Optional
options: ProposalOptionsTransaction invocation options.
-The result returned by the transaction function.
- -Name of the transaction to invoke.
+Optional
options: ProposalOptionsTransaction invocation options.
+The result returned by the transaction function.
+GatewayError Thrown if the gRPC service invocation fails.
-Evaluate a transaction function and return its results. A transaction proposal will be evaluated on endorsing peers but the transaction will not be sent to the ordering service and so will not be committed to the ledger. This can be used for querying the world state.
This method is equivalent to:
contract.evaluate(name, { arguments: [ arg1, arg2 ] });
-Name of the transaction to invoke.
-Rest
...args: (string | Uint8Array)[]Transaction arguments.
-The result returned by the transaction function.
- -Name of the transaction to invoke.
+Rest
...args: (string | Uint8Array)[]Transaction arguments.
+The result returned by the transaction function.
+GatewayError Thrown if the gRPC service invocation fails.
-Create a transaction proposal that can be evaluated or endorsed. Supports off-line signing flow.
-Name of the transaction to invoke.
-Optional
options: ProposalOptionsTransaction invocation options.
-Create a transaction proposal that can be evaluated or endorsed. Supports off-line signing flow.
+Name of the transaction to invoke.
+Optional
options: ProposalOptionsTransaction invocation options.
+Submit a transaction to the ledger and return its result only after it is committed to the ledger. The transaction function will be evaluated on endorsing peers and then submitted to the ordering service to be committed to the ledger.
-Name of the transaction to invoke.
-Optional
options: ProposalOptionsTransaction invocation options.
-The result returned by the transaction function.
- -Name of the transaction to invoke.
+Optional
options: ProposalOptionsTransaction invocation options.
+The result returned by the transaction function.
+EndorseError Thrown if the endorse invocation fails.
-SubmitError Thrown if the submit invocation fails.
-CommitStatusError Thrown if the commit status invocation fails.
-CommitError Thrown if the transaction commits unsuccessfully.
-Submit a transaction to the ledger and return immediately after successfully sending to the orderer. The +
Submit a transaction to the ledger and return immediately after successfully sending to the orderer. The transaction function will be evaluated on endorsing peers and then submitted to the ordering service to be committed to the ledger. The submitted transaction that is returned can be used to obtain to the transaction result, and to wait for it to be committed to the ledger.
-Name of the transaction to invoke.
-Optional
options: ProposalOptionsTransaction invocation options.
-A submitted transaction, providing access to the transaction result and commit status.
- -Name of the transaction to invoke.
+Optional
options: ProposalOptionsTransaction invocation options.
+A submitted transaction, providing access to the transaction result and commit status.
+GatewayError Thrown if the gRPC service invocation fails.
-Submit a transaction to the ledger and return its result only after it is committed to the ledger. The transaction function will be evaluated on endorsing peers and then submitted to the ordering service to be committed to the ledger.
This method is equivalent to:
contract.submit(name, { arguments: [ arg1, arg2 ] });
-Name of the transaction to be invoked.
-Rest
...args: (string | Uint8Array)[]Transaction arguments.
-The result returned by the transaction function.
- -Name of the transaction to be invoked.
+Rest
...args: (string | Uint8Array)[]Transaction arguments.
+The result returned by the transaction function.
+EndorseError Thrown if the endorse invocation fails.
-SubmitError Thrown if the submit invocation fails.
-CommitStatusError Thrown if the commit status invocation fails.
-CommitError Thrown if the transaction commits unsuccessfully.
-Generated using TypeDoc
Generated using TypeDoc
ErrorDetail contains the details of an error generated by an endorsing peer or ordering node. +
ErrorDetail contains the details of an error generated by an endorsing peer or ordering node. It contains the address of the node as well as the error message it generated.
-Fabric node endpoint address.
-Error message returned by the node.
-Member services provider to which the node is associated.
-Generated using TypeDoc
Fabric node endpoint address.
+Error message returned by the node.
+Member services provider to which the node is associated.
+Generated using TypeDoc
Options used when requesting events.
+Options used when requesting events.
If both a start block and checkpoint are specified, and the checkpoint has a valid position set, the checkpoint position is used and the specified start block is ignored. If the checkpoint is unset then the start block is used.
If no start position is specified, eventing begins from the next committed block.
-Generated using TypeDoc
Optional
checkpointUsed to get checkpointed state.
+Optional
startBlock number at which to start reading events.
+Generated using TypeDoc
Delivers filtered block events.
-Delivers filtered block events.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Get filtered block events.
-Optional
options: CallOptionsgRPC call
-Filtered block protocol buffer messages. The iterator should be closed after use to complete the +
Get filtered block events.
+Optional
options: CallOptionsgRPC call
+Filtered block protocol buffer messages. The iterator should be closed after use to complete the eventing session.
- -GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const blocks = await request.getEvents();
try {
for async (const block of blocks) {
// Process block
}
} finally {
blocks.close();
}
-Generated using TypeDoc
Generated using TypeDoc
Gateway represents the connection of a specific client identity to a Fabric Gateway. A Gateway is obtained using the +
Gateway represents the connection of a specific client identity to a Fabric Gateway. A Gateway is obtained using the connect function.
This type implements the Disposable interface, allowing instances to be disposed of with ECMAScript explicit
resource management and the using
keyword instead of calling close directly.
Recreate a block and private data events request from serialized data.
-Serialized block and private data events request.
-A block and private data events request.
- -Recreate a block events request from serialized data.
-Serialized block events request.
-A block events request.
- -Recreate a chaincode events request from serialized data.
-Serialized chaincode events request.
-A chaincode events request.
- -Recreate a filtered block events request from serialized data.
-Serialized filtered block events request.
-A filtered block events request.
- -Create a block and private data events request with the specified digital signature. Supports off-line signing +
Recreate a block and private data events request from serialized data.
+Serialized block and private data events request.
+A block and private data events request.
+Recreate a block events request from serialized data.
+Serialized block events request.
+A block events request.
+Recreate a chaincode events request from serialized data.
+Serialized chaincode events request.
+A chaincode events request.
+Recreate a filtered block events request from serialized data.
+Serialized filtered block events request.
+A filtered block events request.
+Create a block and private data events request with the specified digital signature. Supports off-line signing flow.
-Serialized block and private data events request.
-Digital signature.
-A signed block and private data events request.
- -Create a block events request with the specified digital signature. Supports off-line signing flow.
-Serialized block events request.
-Digital signature.
-A signed block events request.
- -Create a chaincode events request with the specified digital signature. Supports off-line signing flow.
-Serialized chaincode events request.
-Digital signature.
-A signed chaincode events request.
- -Create a commit with the specified digital signature, which can be used to access information about a +
Serialized block and private data events request.
+Digital signature.
+A signed block and private data events request.
+Create a block events request with the specified digital signature. Supports off-line signing flow.
+Serialized block events request.
+Digital signature.
+A signed block events request.
+Create a chaincode events request with the specified digital signature. Supports off-line signing flow.
+Serialized chaincode events request.
+Digital signature.
+A signed chaincode events request.
+Create a commit with the specified digital signature, which can be used to access information about a transaction that is committed to the ledger. Supports off-line signing flow.
-Serialized commit status request.
-Digital signature.
-A signed commit status request.
- -Create a filtered block events request with the specified digital signature. Supports off-line signing flow.
-Serialized filtered block events request.
-Digital signature.
-A signed filtered block events request.
- -Create a transaction with the specified digital signature. Supports off-line signing flow.
-Serialized proposal.
-Digital signature.
-A signed transaction.
- -Recreate a transaction from serialized data.
-Serialized proposal.
-A transaction.
- -Generated using TypeDoc
Serialized commit status request.
+Digital signature.
+A signed commit status request.
+Create a filtered block events request with the specified digital signature. Supports off-line signing flow.
+Serialized filtered block events request.
+Digital signature.
+A signed filtered block events request.
+Create a transaction with the specified digital signature. Supports off-line signing flow.
+Serialized proposal.
+Digital signature.
+A signed transaction.
+Recreate a transaction from serialized data.
+Serialized proposal.
+A transaction.
+Generated using TypeDoc
Interface describing the public API of the gRPC Client class, used to provide better version-to-version type +
Interface describing the public API of the gRPC Client class, used to provide better version-to-version type compatibility between gRPC releases. Application code should use a concrete gRPC Client instance.
-Optional
options: CallOptionsOptional
options: CallOptionsOptional
options: CallOptionsOptional
options: CallOptionsGenerated using TypeDoc
Optional
options: CallOptionsOptional
options: CallOptionsOptional
options: CallOptionsOptional
options: CallOptionsGenerated using TypeDoc
Close the HSM session when the signer is no longer needed.
+HSM signer implementation.
+Generated using TypeDoc
Factory to create HSM Signers.
-Factory to create HSM Signers.
+Create a new HSM signing implementation based on provided HSM options.
+Create a new HSM signing implementation based on provided HSM options.
This returns an object with two properties:
The HSM signer options.
-an HSM Signer implementation.
- -Generated using TypeDoc
The HSM signer options.
+an HSM Signer implementation.
+Generated using TypeDoc
Identifier. The CKA_ID assigned to the HSM object.
-The label associated with the token for the slot.
-The pin for the slot identified by the label.
-Optional
userOptional user type for the HSM. If not specified it defaults to CKU_USER.
-Generated using TypeDoc
Identifier. The CKA_ID assigned to the HSM object.
+The label associated with the token for the slot.
+The pin for the slot identified by the label.
+Optional
userOptional user type for the HSM. If not specified it defaults to CKU_USER.
+Generated using TypeDoc
Represents a client identity used to interact with a Fabric network. The identity consists of an identifier for the +
Represents a client identity used to interact with a Fabric network. The identity consists of an identifier for the organization to which the identity belongs, and implementation-specific credentials describing the identity.
-Implementation-specific credentials. For an identity described by a X.509 certificate, the credentials are the PEM-encoded certificate.
-Member services provider to which this identity is associated.
-Generated using TypeDoc
Member services provider to which this identity is associated.
+Generated using TypeDoc
Network represents a network of nodes that are members of a specific Fabric channel. The Network can be used to +
Network represents a network of nodes that are members of a specific Fabric channel. The Network can be used to access deployed smart contracts, and to listen for events emitted when blocks are committed to the ledger. Network instances are obtained from a Gateway using the Gateway.getNetwork method.
To safely handle connection errors during eventing, it is recommended to use a checkpointer to track eventing progress. This allows eventing to be resumed with no loss or duplication of events.
-Chaincode events
+Chaincode events
const checkpointer = checkpointers.inMemory();
while (true) {
const events = await network.getChaincodeEvents(chaincodeName, {
checkpoint: checkpointer,
startBlock: BigInt(101), // Ignored if the checkpointer has checkpoint state
});
try {
for async (const event of events) {
// Process then checkpoint event
await checkpointer.checkpointChaincodeEvent(event)
}
} catch (err: unknown) {
// Connection error
} finally {
events.close();
}
}
-
Block events
const checkpointer = checkpointers.inMemory();
while (true) {
const events = await network.getBlockEvents({
checkpoint: checkpointer,
startBlock: BigInt(101), // Ignored if the checkpointer has checkpoint state
});
try {
for async (const event of events) {
// Process then checkpoint block
await checkpointer.checkpointBlock(event.getHeader().getNumber())
}
} catch (err: unknown) {
// Connection error
} finally {
events.close();
}
}
-Get block and private data events.
-Optional
options: EventsOptionsEvent listening options.
-Blocks and private data protocol buffer messages. The iterator should be closed after use to complete +
Get block and private data events.
+Optional
options: EventsOptionsEvent listening options.
+Blocks and private data protocol buffer messages. The iterator should be closed after use to complete the eventing session.
- -GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const events = await network.getBlockAndPrivateEventsData({ startBlock: BigInt(101) });
try {
for async (const event of events) {
// Process block and private data event
}
} finally {
events.close();
}
-Get block events.
-Optional
options: EventsOptionsEvent listening options.
-Block protocol buffer messages. The iterator should be closed after use to complete the eventing session.
- -Get block events.
+Optional
options: EventsOptionsEvent listening options.
+Block protocol buffer messages. The iterator should be closed after use to complete the eventing session.
+GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const blocks = await network.getBlockEvents({ startBlock: BigInt(101) });
try {
for async (const block of blocks) {
// Process block
}
} finally {
blocks.close();
}
-Get chaincode events emitted by transaction functions of a specific chaincode.
-A chaincode name.
-Optional
options: EventsOptionsEvent listening options.
-The iterator should be closed after use to complete the eventing session.
- -Get chaincode events emitted by transaction functions of a specific chaincode.
+A chaincode name.
+Optional
options: EventsOptionsEvent listening options.
+The iterator should be closed after use to complete the eventing session.
+GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const events = await network.getChaincodeEvents(chaincodeName, { startBlock: BigInt(101) });
try {
for async (const event of events) {
// Process event
}
} finally {
events.close();
}
-Get a smart contract within the named chaincode. If no contract name is supplied, this is the default smart +
Get a smart contract within the named chaincode. If no contract name is supplied, this is the default smart contract for the named chaincode.
-Chaincode name.
-Optional
contractName: stringSmart contract name.
-Get filtered block events.
-Optional
options: EventsOptionsEvent listening options.
-Filtered block protocol buffer messages. The iterator should be closed after use to complete the +
Chaincode name.
+Optional
contractName: stringSmart contract name.
+Get filtered block events.
+Optional
options: EventsOptionsEvent listening options.
+Filtered block protocol buffer messages. The iterator should be closed after use to complete the eventing session.
- -GatewayError Thrown by the iterator if the gRPC service invocation fails.
-const blocks = await network.getFilteredBlockEvents({ startBlock: BigInt(101) });
try {
for async (const block of blocks) {
// Process block
}
} finally {
blocks.close();
}
-Create a request to receive block and private data events. Supports off-line signing flow.
-Optional
options: EventsOptionsEvent listening options.
-Create a request to receive block events. Supports off-line signing flow.
-Optional
options: EventsOptionsEvent listening options.
-Create a request to receive chaincode events emitted by transaction functions of a specific chaincode. Supports +
Create a request to receive block and private data events. Supports off-line signing flow.
+Optional
options: EventsOptionsEvent listening options.
+Create a request to receive block events. Supports off-line signing flow.
+Optional
options: EventsOptionsEvent listening options.
+Create a request to receive chaincode events emitted by transaction functions of a specific chaincode. Supports off-line signing flow.
-Chaincode name.
-Optional
options: EventsOptionsEvent listening options.
-Create a request to receive filtered block events. Supports off-line signing flow.
-Optional
options: EventsOptionsEvent listening options.
-Generated using TypeDoc
Chaincode name.
+Optional
options: EventsOptionsEvent listening options.
+Create a request to receive filtered block events. Supports off-line signing flow.
+Optional
options: EventsOptionsEvent listening options.
+Generated using TypeDoc
Proposal represents a transaction proposal that can be sent to peers for endorsement or evaluated as a query.
-Proposal represents a transaction proposal that can be sent to peers for endorsement or evaluated as a query.
+Obtain endorsement for the transaction proposal from sufficient peers to allow it to be committed to the ledger.
-Optional
options: CallOptionsgRPC call options.
-An endorsed transaction that can be submitted to the ledger.
- -Obtain endorsement for the transaction proposal from sufficient peers to allow it to be committed to the ledger.
+Optional
options: CallOptionsgRPC call options.
+An endorsed transaction that can be submitted to the ledger.
+EndorseError Thrown if the gRPC service invocation fails.
-Evaluate the transaction proposal and obtain its result, without updating the ledger. This runs the transaction on a peer to obtain a transaction result, but does not submit the endorsed transaction to the orderer to be committed to the ledger.
-Optional
options: CallOptionsgRPC call options.
-The result returned by the transaction function.
- -Optional
options: CallOptionsgRPC call options.
+The result returned by the transaction function.
+GatewayError Thrown if the gRPC service invocation fails.
-Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Generated using TypeDoc
Generated using TypeDoc
Options used when evaluating or endorsing a transaction proposal.
-Options used when evaluating or endorsing a transaction proposal.
+Optional
argumentsArguments passed to the transaction function.
-Optional
endorsingSpecifies the set of organizations that will attempt to endorse the proposal. +
Optional
argumentsArguments passed to the transaction function.
+Optional
endorsingSpecifies the set of organizations that will attempt to endorse the proposal. No other organizations' peers will be sent this proposal. This is usually used in conjunction with transientData for private data scenarios.
-Optional
transientPrivate data passed to the transaction function but not recorded on the ledger.
-Generated using TypeDoc
Optional
transientPrivate data passed to the transaction function but not recorded on the ledger.
+Generated using TypeDoc
A call that can be explicitly signed. Supports off-line signing flow.
-A call that can be explicitly signed. Supports off-line signing flow.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Generated using TypeDoc
Generated using TypeDoc
Status of a transaction that is committed to the ledger.
-Status of a transaction that is committed to the ledger.
+Block number in which the transaction committed.
-Transaction validation status code. The value corresponds to one of the values enumerated by StatusCode.
-true
if the transaction committed successfully; otherwise false
.
The ID of the transaction.
-Generated using TypeDoc
Block number in which the transaction committed.
+Transaction validation status code. The value corresponds to one of the values enumerated by StatusCode.
+true
if the transaction committed successfully; otherwise false
.
The ID of the transaction.
+Generated using TypeDoc
Allows access to the transaction result and its commit status on the ledger.
-Allows access to the transaction result and its commit status on the ledger.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Get status of the committed transaction. If the transaction has not yet committed, this method blocks until the +
Get status of the committed transaction. If the transaction has not yet committed, this method blocks until the commit occurs.
-Optional
options: CallOptionsgRPC call options.
-Optional
options: CallOptionsgRPC call options.
+CommitStatusError Thrown if the gRPC service invocation fails.
-Generated using TypeDoc
Generated using TypeDoc
Represents an endorsed transaction that can be submitted to the orderer for commit to the ledger.
-Represents an endorsed transaction that can be submitted to the orderer for commit to the ledger.
+Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.
-Submit the transaction to the orderer to be committed to the ledger.
-Optional
options: CallOptionsgRPC call options.
-Submit the transaction to the orderer to be committed to the ledger.
+Optional
options: CallOptionsgRPC call options.
+SubmitError Thrown if the gRPC service invocation fails.
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Options used when requesting block events.
-Generated using TypeDoc
Options used when requesting block events.
+Generated using TypeDoc
Options used when requesting chaincode events.
-Generated using TypeDoc
Options used when requesting chaincode events.
+Generated using TypeDoc
A hashing implementation used to generate a digest from a supplied message.
-Generated using TypeDoc
A hashing implementation used to generate a digest from a supplied message.
+Generated using TypeDoc
A signing implementation used to generate digital signatures from a supplied message digest. Standard +
A signing implementation used to generate digital signatures from a supplied message digest. Standard implementations can be obtained using signers factory methods.
-Generated using TypeDoc
Generated using TypeDoc
Const
Enumeration of transaction status codes.
-Generated using TypeDoc
Const
Enumeration of transaction status codes.
+Generated using TypeDoc
CommitError is thrown to indicate that a transaction committed with an unsuccessful status code.
-