hyperledger-labs / minifabric

Do fabric network the right and easy way.
Apache License 2.0
302 stars 164 forks source link

Chaincode commit failed from a new organisation #88

Closed crizaqcri closed 4 years ago

crizaqcri commented 4 years ago

I have started a hyperledger fabric network with a the following specs:

fabric:
  peers: 
  - "peer1.org0.example.com"
  - "peer2.org0.example.com"
  - "peer1.org1.example.com"
  - "peer2.org1.example.com"
  orderers:
  - "orderer1.example.com"
  - "orderer2.example.com"
  - "orderer3.example.com"
  settings:
    ca:
      FABRIC_LOGGING_SPEC: DEBUG
    peer:
      FABRIC_LOGGING_SPEC: DEBUG
    orderer:
      FABRIC_LOGGING_SPEC: DEBUG

And comman: >> ./minifab up -e 7000 >> I have installed / approved / commit / initialize / discover samplecc on mychannel

In another directory I have created a new organisation with spec:

fabric:
  peers: 
  - "peer1.org3.cri.com"
  - "peer2.org3.cri.com"

and started with the command:

./minifab netup -e 7200 -o org4.cri.com

I have exported the endpoints certificates from the first network and imported in the second. Also, I have signed and updated the channel config on the first network with information for org3. ./minifab channelsign,channelupdate

On both networks the org3 is visible on channel config. mychannel_config.json file can be found at https://docs.google.com/document/d/1r18DF0ZGS-6R0kA8TrC6hzvVKeuAPazgrk4ip5PPtdM/edit?usp=sharing

I have run with success the following commands on the second network:

./minifab install -c mychannel -n samplecc
./minifab join -c mychannel
./minifab approve

But failed at commit

./minifab commit

Error:


# Run the chaincode commit script on cli container ************
  non-zero return code
  2020-10-05 10:49:15.288 UTC [chaincodeCmd] ClientWait -> INFO 001 txid [467bb16c47c152a6a38924b325acf798e966263c9553a5359024a4c9f5a46f6a] committed with status (ENDORSEMENT_POLICY_FAILURE) at 25.41.86.164:7200
  Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)

# STATS *******************************************************
minifab: ok=28  failed=1

Does anyone know what have I missed? Thank you.

crizaqcri commented 4 years ago

I am using dockers installed directly on the host:

lsb_release -d Ubuntu 20.04.1 LTS

>>docker version Client: Docker Engine - Community Version: 19.03.13 API version: 1.40 Go version: go1.13.15 Git commit: 4484c46d9d Built: Wed Sep 16 17:02:52 2020 OS/Arch: linux/amd64 Experimental: false

Server: Docker Engine - Community Engine: Version: 19.03.13 API version: 1.40 (minimum version 1.12) Go version: go1.13.15 Git commit: 4484c46d9d Built: Wed Sep 16 17:01:20 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.3.7 GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683

litong01 commented 4 years ago

@crizaqcri in your 2nd working directory (site), you have org3.cri.com, but your command says org4.cri.com, I assume that was just a typo. Please check to make sure though.

crizaqcri commented 4 years ago

It's just a typo, otherwise, the command minifabric netup had failed.

litong01 commented 4 years ago

@crizaqcri I think that the only thing you were missing was a command on first site minifab approve. Since you add a new org and new org also can do chaincode, your existing orgs need to approve it again. Once your first site approve the chaincode again, you should be fine. It will be super nice if you can create a doc describe this process, so that others can also benefit from your experiences. If you feel you like to contribute, you can write a doc in docs directory.

litong01 commented 4 years ago

@crizaqcri Please follow this doc to try what you intend to do. https://github.com/litong01/minifabric/blob/master/docs/HowToExpandYourNetwork.md. Also please close this issue once you got it working. If you encounter some new problems, do open one and describe the process like you did here. Thanks.

crizaqcri commented 4 years ago

Thank you very much, it works now!