Node sdk examples to interact with bityoga fabric set up
- Bityoga fabric sdk should be up and running
- Node version
- Supports node version >=8
- Tested with v8.9.0
-
- cd bityoga_hyperledger_fabric_node_sdk
-
- nvm use node v8.9.0 (using nvm)
- npm install
-
- update the url ip addresses of orderer, peer2, orgca, tlsca (4 places).
- update it with your prime manager's ip address
-
-
scp -r root@178.62.207.235:/root/hlft-store/orderer/tls-msp/tlscacerts/tls-tlsca-7054.pem ./hlft-store/orderer/tls-msp/tlscacerts/tls-tlsca-7054.pem
-
scp -r root@178.62.207.235:/root/hlft-store/peer2/tls-msp/tlscacerts/tls-tlsca-7054.pem ./hlft-store/peer2/tls-msp/tlscacerts/tls-tlsca-7054.pem
-
-
- check wallet directory
- a directory named 'admin' will be available
- certificates for admin will be available under this directory.
- a directory named 'admin' will be available
-
- If needed, edit the following lines in registerUser.js
- const user_name = "lion";
- const user_password = "lion";
- const user_role = "client";
- check wallet directory
- a directory with the name of the 'registerd user name' will be available
- certificates for the registerd user will be available under this directory.
- a directory with the name of the 'registerd user name' will be available
- If needed, edit the following lines in registerUser.js
-
- If needed, edit the following lines in query.js
- const user_name = "lion";
- const CHANNEL_NAME = "appchannel";
- const CHAIN_CODE_NAME = "carcc";
- const CHAIN_CODE_FUNCTION_NAME = "listCars";
- const result = await contract.evaluateTransaction(CHAIN_CODE_FUNCTION_NAME);
- const result = await contract.evaluateTransaction(CHAIN_CODE_FUNCTION_NAME,"b");
- If needed, edit the following lines in query.js
-
- If needed, edit the following lines in invoke.js
- const user_name = "lion";
- const CHANNEL_NAME = "appchannel";
- const CHAIN_CODE_NAME = "carcc";
- const CHAIN_CODE_FUNCTION_NAME = "createCar";
- await contract.submitTransaction(CHAIN_CODE_FUNCTION_NAME, "TR8800","Opel","Corsa","Light Blue","7","2050","1");
- await contract.submitTransaction(CHAIN_CODE_FUNCTION_NAME, "b","a","1");
- If needed, edit the following lines in invoke.js