Using the CLI provided gRPC configurations when starting the chaincode by delaooliveira · Pull Request #401 · hyperledger/fabric-chaincode-node · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libraries/fabric-shim/lib/chaincode.js
6 changes: 5 additions & 1 deletion libraries/fabric-shim/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ class ChaincodeServer {
this._credentials = grpc.ServerCredentials.createInsecure();
}

const grpcOptions = Object.fromEntries(
Object.entries(serverOpts).filter(([key]) => key.startsWith('grpc.'))
);

// Create GRPC Server and register RPC handler
this._server = new grpc.Server();
this._server = new grpc.Server(grpcOptions);
this._server.addService(peer.ChaincodeService, this);

this._serverOpts = serverOpts;
Expand Down
10 changes: 7 additions & 3 deletions libraries/fabric-shim/types/index.d.ts