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,
};
interface ConnectOptions {
    blockAndPrivateDataEventsOptions?: (() => CallOptions);
    blockEventsOptions?: (() => CallOptions);
    chaincodeEventsOptions?: (() => CallOptions);
    client: GrpcClient;
    commitStatusOptions?: (() => CallOptions);
    endorseOptions?: (() => CallOptions);
    evaluateOptions?: (() => CallOptions);
    filteredBlockEventsOptions?: (() => CallOptions);
    hash?: Hash;
    identity: Identity;
    signer?: Signer;
    submitOptions?: (() => CallOptions);
    tlsClientCertificateHash?: Uint8Array;
}

Properties

blockAndPrivateDataEventsOptions?: (() => CallOptions)

Supplier of default call options for block and private data events.

Type declaration

    • (): CallOptions
    • Returns CallOptions

blockEventsOptions?: (() => CallOptions)

Supplier of default call options for block events.

Type declaration

    • (): CallOptions
    • Returns CallOptions

chaincodeEventsOptions?: (() => CallOptions)

Supplier of default call options for chaincode events.

Type declaration

    • (): CallOptions
    • Returns CallOptions

client: GrpcClient

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.

commitStatusOptions?: (() => CallOptions)

Supplier of default call options for retrieving transaction commit status.

Type declaration

    • (): CallOptions
    • Returns CallOptions

endorseOptions?: (() => CallOptions)

Supplier of default call options for endorsements.

Type declaration

    • (): CallOptions
    • Returns CallOptions

evaluateOptions?: (() => CallOptions)

Supplier of default call options for evaluating transactions.

Type declaration

    • (): CallOptions
    • Returns CallOptions

filteredBlockEventsOptions?: (() => CallOptions)

Supplier of default call options for filtered block events.

Type declaration

    • (): CallOptions
    • Returns CallOptions

hash?: Hash

Hash implementation used by the gateway to generate digital signatures. If this option is not specified, SHA-256 is used by default.

identity: Identity

Client identity used by the gateway.

signer?: Signer

Signing implementation used to sign messages sent by the gateway.

submitOptions?: (() => CallOptions)

Supplier of default call options for submit of transactions to the orderer.

Type declaration

    • (): CallOptions
    • Returns CallOptions

tlsClientCertificateHash?: Uint8Array

SHA-256 hash of the TLS client certificate. This option is required only if mutual TLS authentication is used for the gRPC connection to the Gateway peer.