Skip to content

Instantly share code, notes, and snippets.

@sivsivsree
Last active November 18, 2021 20:17
Show Gist options
  • Save sivsivsree/b26681c42611f66971ba32863ff0091d to your computer and use it in GitHub Desktop.
Save sivsivsree/b26681c42611f66971ba32863ff0091d to your computer and use it in GitHub Desktop.
sudo apt update
sudo apt install nfs-kernel-server
sudo mkdir -p /mnt/nfs_share
sudo chown -R nobody:nogroup /mnt/nfs_share/
sudo chmod 777 /mnt/nfs_share
echo "/mnt/nfs_share *(rw,sync,no_subtree_check,insecure)" | sudo tee -a /etc/exports
sudo exportfs -a
sudo systemctl restart nfs-kernel-server
## Mounting NFS Drive to Local System
mkdir nfs_clientshare
sudo mount -o nolocks -t nfs 159.89.173.162:/mnt/nfs_share ./nfs_clientshare
## apply pv and pvc
kubectl apply -f 1.nfs/pv.yaml, pvc.yaml
## move prerequsite/* to nfs server
cp -R prerequsite/* /Users/siv/Personal/work/smart-world/nfs_clientshare/
sudo chmod +x /mnt/nfs_share/scripts/ -R #login to nfs server and provide executive
mkdir organizations
cp -r fabric-ca organizations
sudo chmod -R 777 /mnt/nfs_share/organizations
#run kubectl apply till the configurations till peer
# exec to the peer cli and run the following in all peer cli
./scripts/createAppChannel.sh
peer channel join -b ./channel-artifacts/mychannel.block
# verify the joined channel by
peer channel list
# Updater Anchor Peer
./scripts/updateAnchorPeer.sh Org1MSP #in peer1-cli1
./scripts/updateAnchorPeer.sh Org2MSP #in peer2-cli2
./scripts/updateAnchorPeer.sh Org3MSP #in peer3-cli3
# upate the connection.json "address": "basic-org2:7052" to respective peers
cfz code.tar.gz connection.json
tar cfz basic-org1.tar.tgz code.tar.gz metadata.json
# run for all the peers needed
#Iniside the cli of peer1 cd to /opt/gopath/src/github.com/chaincode/<chaincode name>/packaging
peer lifecycle chaincode install credential-org1.tar.tgz
# COPY credential:6e1842c7d34250fbf70ea231e93602c6264161652dac0117675fcb6347b22f5d
#Iniside the cli of peer2 cd to /opt/gopath/src/github.com/chaincode/credential/packaging
peer lifecycle chaincode install credential-org2.tar.tgz
# COPY credential:86c5ba0d13da63f4781435ca09a9ddcc87dccd2120f6fe4dad172051a0f28387
#Iniside the cli of peer3 cd to /opt/gopath/src/github.com/chaincode/credential/packaging
peer lifecycle chaincode install credential-org3.tar.tgz
# COPY credential:b1fc64c9082018bd55683b49d706a83725baab163256302b0b7a4f9177d5b40c
deply the cc deplyments
#approve chaincode peer0-org1
peer lifecycle chaincode approveformyorg --channelID mychannel --name credential --version 1.0 --init-required --package-id credential:6e1842c7d34250fbf70ea231e93602c6264161652dac0117675fcb6347b22f5d --sequence 1 -o orderer:7050 --tls --cafile $ORDERER_CA
#approve chaincode peer0-org2
peer lifecycle chaincode approveformyorg --channelID mychannel --name credential --version 1.0 --init-required --package-id credential:86c5ba0d13da63f4781435ca09a9ddcc87dccd2120f6fe4dad172051a0f28387 --sequence 1 -o orderer:7050 --tls --cafile $ORDERER_CA
#approve chaincode peer0-org3
peer lifecycle chaincode approveformyorg --channelID mychannel --name credential --version 1.0 --init-required --package-id credential:b1fc64c9082018bd55683b49d706a83725baab163256302b0b7a4f9177d5b40c --sequence 1 -o orderer:7050 --tls --cafile $ORDERER_CA
#checkcommitreadiness
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name credential --version 1.0 --init-required --sequence 1 -o -orderer:7050 --tls --cafile $ORDERER_CA
#check
peer lifecycle chaincode querycommitted -C mychannel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment