how to add path of chain code in hyperledger fabric in startfabric sh

0 votes
#!/bin/bash

#

# Copyright IBM Corp All Rights Reserved

#

# SPDX-License-Identifier: Apache-2.0

#

# Exit on first error

set -e

# don't rewrite paths for Windows Git Bash users

export MSYS_NO_PATHCONV=1

starttime=$(date +%s)

LANGUAGE=${1:-"golang"}

CC_SRC_PATH=github.com/chaincode/fabcar/node

if [ "$LANGUAGE" = "node" -o "$LANGUAGE" = "NODE" ]; then

CC_SRC_PATH=github.com/chaincode/fabcar/node

fi

# clean the keystore

rm -rf ./hfc-key-store

# launch network; create channel and join peer to channel

cd ../basic-network

./start.sh

# Now launch the CLI container in order to install, instantiate chaincode

# and prime the ledger with our 10 cars

docker-compose -f ./docker-compose.yml up -d cli

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 fabcar -v 1.0 -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 instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l "$LANGUAGE" -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')"

sleep 10

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 invoke -o orderer.example.com:7050 -C mychannel -n fabcar -c '{"function":"initLedger","Args":[""]}'

printf "\nTotal setup execution time : $(($(date +%s) - starttime)) secs ...\n\n\n"

printf "Start by installing required packages run 'npm install'\n"

printf "Then run 'node enrollAdmin.js', then 'node registerUser'\n\n"

printf "The 'node invoke.js' will fail until it has been updated with valid arguments\n"

printf "The 'node query.js' may be run at anytime once the user has been registered\n\n"
Mar 17, 2019 in Blockchain by anonymous
512 views
Hey, it seems like everything is working as usual. Is there a problem your facing related to this?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Blockchain

0 votes
0 answers

How to set chaincode path in Hyperledger Fabric in fabric.sh file

i set the path to chaincode in ...READ MORE

Mar 23, 2019 in Blockchain by Malik

retagged Mar 25, 2019 by Omkar 600 views
+15 votes
5 answers
0 votes
1 answer

How to control visibility of assets in Hyperledger Fabric?

you can use proof of Authority consensus ...READ MORE

answered Jul 10, 2018 in Blockchain by digger
• 26,700 points
279 views
0 votes
1 answer

How to set chaincode path in Hyperledger Fabric?

For chaincode to properly run on your ...READ MORE

answered Jul 27, 2018 in Blockchain by digger
• 26,700 points
995 views
0 votes
1 answer

How to connect channels of different systems in Hyperledger Fabric?

When you create a channel, you will ...READ MORE

answered Nov 20, 2018 in Blockchain by Omkar
• 69,130 points
164 views
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,700 points
302 views
+1 vote
1 answer