Node sdk test 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
-
git clone https://github.com/bityoga/fabric_node_sdk_tester.git
-
- cd fabric_node_sdk_tester
- Set node version:
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@LOCALHOST_OR_YOUR_MASTER_MACHINE_IP_ADDRESS:/root/hlft-store/tlsca/orderer/tls-msp/tlscacerts/tls-tlsca-7054.pem ./hlft-store/tlsca/orderer/tls-msp/tlscacerts/tls-tlsca-7054.pem
scp -r root@LOCALHOST_OR_YOUR_MASTER_MACHINE_IP_ADDRESS:/root/hlft-store/tlsca/peer2/tls-msp/tlscacerts/tls-tlsca-7054.pem ./hlft-store/tlsca/peer2/tls-msp/tlscacerts/tls-tlsca-7054.pem
bash get_tls_certificates.sh
-
- check wallet directory
- a directory named 'admin' will be available.
- certificates for admin will be available under this directory.
-
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.
-
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");
-
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");