1
votes

I'm following the hyperleger fabric chaincode setup instructions: http://hyperledger-fabric.readthedocs.io/en/latest/Setup/Chaincode-setup

I'm using docker toolbox and a peer is running in one terminal (docker-compose up).

In another docker terminal I try to start and register the chaincode: CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051 ./chaincode_example02

I get this error:

enter image description here

Thanks in advance!

Update: I'm using the docker-compose.yml from the docs:

membersrvc:
  image: hyperledger/fabric-membersrvc
  command: membersrvc
vp0:
  image: hyperledger/fabric-peer
  environment:
    - CORE_PEER_ADDRESSAUTODETECT=true
    - CORE_VM_ENDPOINT=http://172.17.0.1:2375
    - CORE_LOGGING_LEVEL=DEBUG
    - CORE_PEER_ID=vp0
    - CORE_PEER_PKI_ECA_PADDR=membersrvc:7054
    - CORE_PEER_PKI_TCA_PADDR=membersrvc:7054
    - CORE_PEER_PKI_TLSCA_PADDR=membersrvc:7054
    - CORE_SECURITY_ENABLED=true
    - CORE_SECURITY_ENROLLID=test_vp0
    - CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
  links:
    - membersrvc
  command: sh -c "sleep 5; peer node start --peer-chaincodedev"

docker ps gives:

$ docker ps
CONTAINER ID        IMAGE                           COMMAND                  CRE
ATED             STATUS              PORTS               NAMES
35050760e1df        hyperledger/fabric-peer         "sh -c 'sleep 5; peer"   21
minutes ago      Up 2 minutes                            option3_vp0_1
209132c7f059        hyperledger/fabric-membersrvc   "membersrvc"             21
minutes ago      Up 2 minutes                            option3_membersrvc_1

and docker-machine ls gives:

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DO
CKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.109:2376           v1
.12.3

So I tried also to start and register the chaincode with:

CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=192.168.99.109:7051 ./chaincode_example02
1
Try to change peer.address and listenAddress to 0.0.0.0:7051 in peer/core.yaml - 6londe
it was already like that, i'm using gerrit.hyperledger.org/r/fabric - David

1 Answers

1
votes

It seems like your peer is not reachable at 0.0.0.0.7051 . To check if you have a peer listening on 7051 , use the command: netstat -lnptu| grep 7051

Try setting CORE_PEER_ADDRESS to either the public or the private IP of the host instead of 0.0.0.0

Also verify that you have forwarded the port 7051 from the docker container to the host.