2

I am trying to modify the fabcar network to run my own chaincode. The first thing that I did was replace the fabcar chain code with my own. However, I do not wish to do this every time. Is there a way of modifying paths to point to the required chaincode. I started searching in the ./startFabric.sh file and this is where my doubt is.

CC_SRC_PATH=github.com/fabcar/go
if [ "$LANGUAGE" = "node" -o "$LANGUAGE" = "NODE" ]; then
CC_SRC_PATH=/opt/gopath/src/github.com/fabcar/node
fi

Does this code have the path to the chain code. How can I modify this if my chain code is on my local computer. Or is this path referring to the downloaded folder on my local computer.Seems trivial but I am quite confused Could someone help me with this. Thanks

1 Answers1

0

CC_SRC_PATH env variable is the path inside your docker container.

You docker yml file should have volumes mapping for it (docker <-> local) like -

./../chaincode/:/opt/gopath/src/github.com/

You can change it as required.

Santhosh S
  • 782
  • 5
  • 17
  • Thanks a lot for the reply. So could i have something like CC_SRC_PATH = /Users/blockchain/fabcar/node. How would the volume mapping change in this case. – Surya Suresh Jun 16 '18 at 16:36
  • No. You should use some path inside docker container. Like /opt/gopath/src/github.com/ eg. /Users/blockchain/chaincode:/opt/gopath/src/github.com/ will map your local directory /Users/blockchain/chaincode to be available in docker container in /opt/gopath/src/github.com directory. – Santhosh S Jun 18 '18 at 06:29
  • just a minor correction to above: the mapping in docker yml is not docker <-> local as mentioned in the answer but local <-> docker – morpheus Nov 06 '18 at 21:53