Last active
March 11, 2019 12:01
-
-
Save coolsvap/b123f6f8074eb96baf795ff8c5476f6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LANGUAGE=golang | |
CC_SRC_PATH=github.com/project-name/go | |
CC_VERSION=1.0 | |
TEMP_CC_VERSION+=$(date +".%I.%M.%S") # Appending with temporary timestamp. | |
# Replace the chaincode with our new updated code. | |
rm -rf $GOPATH/src/github.com/project-name/go & mkdir -p $GOPATH/src/github.com/project-name/go | |
cp -Rf chaincode/\\\* $GOPATH/src/github.com/project-name/go/ | |
# Building the go chaincode | |
cd $GOPATH/src/github.com/project-name/go/ | |
go build . | |
# Run the update action | |
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode install -n acmebc -v $TEMP_CC_VERSION -p "$CC_SRC_PATH" -l "$LANGUAGE" | |
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode upgrade -o orderer.example.com:7050 -C mychannel -n acmebc -l "$LANGUAGE" -v $TEMP_CC_VERSION -c '{"Args":\\\["init"\\\]}' -P "OR ('Org1MSP.member')" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment