$ nano .bash_profile
export PATH=$PATH:~/fabric-samples/bin
$ source .bash_profile
$ peer version
$ ./network.sh deployCC \
-c myfirstchannel \
-ccn basic \
-ccp ../asset-transfer-basic/chaincode-go \
-ccl go
peer chaincode query -C myfirstchannel -n basic -c ‘{“Args”:[“GetAllAssets”]}’ | jq
Within assetTransfer let’s add our own asset
{
ID: 'asset7',
Color: 'violet',
Size: 10,
Owner: 'Alice',
AppraisedValue: 900,
},
{
ID: 'asset8',
Color: 'brown',
Size: 5,
Owner: 'Bob',
AppraisedValue: 1000,
},
Make sure you are in this directory
$ cd ~/tools/hyperledger/fabric-samples/test-network
Create a new channel
$ ./network.sh createChannel -c newchannel
./network.sh deployCC \
-c newchannel \
-ccn basic \
-ccp ../asset-transfer-basic/chaincode-javascript \
-ccl javascript
$ peer chaincode query \
-C newchannel -n basic -c ‘{“Args”:[“GetAllAssets”]}’ | jq
$ nano org1_env.sh
export FABRIC_CFG_PATH=$PWD/../config/
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID=”Org1MSP”
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051
export PATH=${PWD}/../bin:$PATH
Terminal – now let’s initialize the ledger with assets
peer chaincode invoke -o localhost:7050 \
–ordererTLSHostnameOverride orderer.example.com \
–tls –cafile “${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem” \
-C newchannel \
-n basic \
–peerAddresses localhost:7051 \
–tlsRootCertFiles “${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt” \
–peerAddresses localhost:9051 \
–tlsRootCertFiles “${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt” \
-c ‘{“function”:”InitLedger”,”Args”:[]}’
Day 4 – 18th Oct 2023
Pharma-Ledger-Network
https://1drv.ms/u/s!AmsP1aixWaBngfET-ts6mKnIeu4g4g?e=x5KZaC
Test the Smart Contract
Now we can start testing our smart contract for these functions:
(1) Call the makeEquipment chaincode method:
sudo ./net-pln.sh invoke equipment GlobalEquipmentCorp 2000.001 e360-Ventilator GlobalEquipmentCorp
(2) Issue the following script command to query equipment:
sudo ./net-pln.sh invoke query 2000.001
(3) Continue to invoke the remaining equipment functions for the wholesaler and
pharmacy:
sudo ./net-pln.sh invoke wholesaler 2000.001 GlobalWholesalerCorp
sudo ./net-pln.sh invoke pharmacy 2000.001 PharmacyCorp
(4) Once equipment ownership is moved to the pharmacy, the supply chain reaches
its final state. We can issue queryHistoryByKey from the peer chaincode query
command. Let’s check equipment historical data:
sudo ./net-pln.sh invoke queryHistory 2000.001
All of the transaction history records are displayed as output. We have tested our smart contract, and it works as expected.
const wallet = await Wallets.newFileSystemWallet(‘../identity/ user/’+userName+’/wallet’);
const gateway = new Gateway();
let connectionProfile =
yaml.safeLoad(fs.readFileSync(‘../../../organizations/peerOrganizations/
org1.example.com/connection-org1.json’, ‘utf8’));
// Set connection options; identity and wallet
let connectionOptions = {
identity: userName,
wallet: wallet,
discovery: { enabled: true, asLocalhost: true }
};
await gateway.connect(connectionProfile, connectionOptions);
Day 5 : 19th Oct 2023
https://www.hyperledger.org/case-studies/fujitsu-bwt-case-study
https://www.hyperledger.org/case-studies/taxchain-case-study
https://www.hyperledger.org/case-studies/hitachi-case-study
https://www.hyperledger.org/case-studies/krypc-minehub-case-study
https://www.hyperledger.org/case-studies/splunk-sp-case-study
https://www.hyperledger.org/case-studies/techmahindra-case-study
https://www.hyperledger.org/case-studies/avanza-case-study
https://www.hyperledger.org/case-studies/dltlabs-case-study
https://www.hyperledger.org/case-studies/openidl-case-study
https://www.hyperledger.org/case-studies/mindtree-case-study
https://www.hyperledger.org/case-studies/chainyard-case-study
https://www.hyperledger.org/case-studies/walmart-case-study
https://www.hyperledger.org/case-studies/tantalum-case-study
https://www.hyperledger.org/case-studies/honeywell-case-study
Activities
Insurance Claim Management
Doc : https://demo.spydra.app/documentation-claim
Demo : https://demo.spydra.app/claim-login
Spare Parts Management
Doc : https://demo.spydra.app/sp-documentation
Demo : https://demo.spydra.app/sp-login
—–
Hackathon announcement
VAC D5 Resources