In the client applications (using Node/Go) we provide connection profile to identify the endpoints of endorsers.
There we specify endpoint of peer in terms of grpc://localhost:port but actually gRPC runs on HTTP2 right?
Then does the Fabric SDK convert the endpoint to a HTTP url or is it handled by fabric peer code?
I mean how is grpc endpoint converted to an HTTP one?
Or does the peer expose a grpc endpoint itself? If yes, how?
As suggested by @david_k in comments above, the URL in connection profile is used for extracting the host and port number after identifying whether it is grpc or grpcs (over SSL) call.
To verify:
fabcar
sample and install the node modules. Endpoint.js
file in the fabric-common
node module inside the lib
directory. Edit the line corresponding to line 44 here. first-network
directory (the network used by fabcar sample) to edit the connection profile. Replace the grpcs in the peer and orderer URL corresponding to the edit you made to the Endpoint.js
file in node modules. javascript
directory and fetch the wallet identities. invoke.js
to read the new connection profile. Therefore, we can identify that only the host and port are fetched from the URL to be used for making a grpc/grpcs call to the fabric network.