Mortgage: The mortgage provides a powerful and easy to use API to interact with a Hyperledger Fabric blockchain for Ellie Mae network.
Mortgage for Node.js
Overview The mortgage npm provides an easy to use API to interact with an Ellie Mae Hyperledger Fabric blockchain from a Node.js application. It provides a set of APIs to register and enroll new network clients, to interact with existing chaincode through chaincode function invocations and queries.
Installation npm install mbcc
Assumption: All the arguments to the function calls are in string data type.
Usage
• Configuration:
-
First create a client-side chain object. All future functions calls will be made using the chain object.
var mortgage = require(‘mbcc); chain = mortgage. setChain(‘test_chain’);
-
Set Key-value store path for storing client credentials on local machine.
chain. setKeyValStore (‘/tmp/keyValStoreSDKtest”);
-
Connect to the Member service (CA) for registration of clients.
chain.setMemberServicesUrl("grpc://10.51.227.63:7054")
-
Connect to Peer for interaction with the network. Peer is running with TLS configuration so you will have to pass the certificate and hostnameOverride.
var cert = fs.readFileSync("certificate.pem"); chain. setPeerURL (‘"grpcs://10.51.227.63:7051"”,{pem:cert, hostnameOverride:"OBC"}});
-
Set Chaincode ID. Chaincode will be already deployed by Ellie Mae.
chain.setChaincodeName (“fsd554fsd4f684f6sd4”)
• Note: for complete operations guide read SDK Documentation else contact owner.