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,
};
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 gRPC CallOptions for block and private data events.

blockEventsOptions?: (() => CallOptions)

Supplier of default gRPC CallOptions for block events.

chaincodeEventsOptions?: (() => CallOptions)

Supplier of default gRPC CallOptions for chaincode events.

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 gRPC CallOptions for retrieving transaction commit status.

endorseOptions?: (() => CallOptions)

Supplier of default gRPC CallOptions for endorsements.

evaluateOptions?: (() => CallOptions)

Supplier of default gRPC CallOptions for evaluating transactions.

filteredBlockEventsOptions?: (() => CallOptions)

Supplier of default gRPC CallOptions for filtered block events.

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 gRPC CallOptions for submit of transactions to the orderer.

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.