kalleknast / Microgrid

Hyperledger network for microgrids
GNU General Public License v3.0
4 stars 1 forks source link

Instantiating the chaincode fails #3

Closed kalleknast closed 5 years ago

kalleknast commented 5 years ago

Creating channel, joining peer and installing the chaincode works. But, instantiating the chaincode fails.

The command:

docker exec -e "CORE_PEER_LOCALMSPID=House01MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp" cli peer chaincode instantiate -o orderer.microgrid.org:7050 -C hachannel -n carecords -l golang -v 1.0 -c '{"Args":[""]}' -P "OR ('House01MSP.member','House02MSP.member')"

and the strange error:

2018-09-29 02:24:30.947 UTC [grpc] HandleSubConnStateChange -> DEBU 075 pickfirstBalancer: HandleSubConnStateChange: 0xc420412ef0, TRANSIENT_FAILURE
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I did try to stop, remove, and then configure and start the network again, but it didn't help. Any idea?

erickzzh commented 5 years ago

An update on the issue

  1. I believe that the problem is caused by not updating the Anchor peers after every peer has joined the channel.

  2. After I updated the anchor peers I received an error saying that our database has multi conflicts. Up on futher investigation, I have noticed that we only created one db for 12 peers where we should've set up one db for each peer.(12 db intotal) https://github.com/suryalnvs/fabric-docker-compose-svt/blob/master/docker-compose-couch.yaml We can fix this issue by going back to the default db or rewrite the config files. let me know which method you prefer the most.

erickzzh commented 5 years ago
//this is adding peers to the channel

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house01.microgrid.org:7051 CORE_PEER_LOCALMSPID="House01MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/peers/peer0.house01.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house01.microgrid.org:7051 CORE_PEER_LOCALMSPID="House01MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/peers/peer1.house01.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/users/Admin@house02.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house02.microgrid.org:7051 CORE_PEER_LOCALMSPID="House02MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/peers/peer0.house02.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/users/Admin@house02.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house02.microgrid.org:7051 CORE_PEER_LOCALMSPID="House02MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/peers/peer1.house02.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/users/Admin@house03.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house03.microgrid.org:7051 CORE_PEER_LOCALMSPID="House03MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/peers/peer0.house03.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/users/Admin@house03.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house03.microgrid.org:7051 CORE_PEER_LOCALMSPID="House03MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/peers/peer1.house03.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/users/Admin@house04.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house04.microgrid.org:7051 CORE_PEER_LOCALMSPID="House04MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/peers/peer0.house04.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/users/Admin@house04.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house04.microgrid.org:7051 CORE_PEER_LOCALMSPID="House04MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/peers/peer1.house04.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/users/Admin@house05.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house05.microgrid.org:7051 CORE_PEER_LOCALMSPID="House05MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/peers/peer0.house05.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/users/Admin@house05.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house05.microgrid.org:7051 CORE_PEER_LOCALMSPID="House05MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/peers/peer1.house05.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/users/Admin@house06.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house06.microgrid.org:7051 CORE_PEER_LOCALMSPID="House06MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/peers/peer0.house06.microgrid.org/tls/ca.crt peer channel join -b hachannel.block
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/users/Admin@house06.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house06.microgrid.org:7051 CORE_PEER_LOCALMSPID="House06MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/peers/peer1.house06.microgrid.org/tls/ca.crt peer channel join -b hachannel.block

//this updates the anchor peers
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house01.microgrid.org:7051 CORE_PEER_LOCALMSPID="House01MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/peers/peer0.house01.microgrid.org/tls/ca.crt peer channel update -o orderer.microgrid.org:7050 -c hachannel -f ./channel-artifacts/House01Anchor.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/microgrid.org/orderers/orderer.microgrid.org/msp/tlscacerts/tlsca.microgrid.org-cert.pem
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/users/Admin@house02.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house02.microgrid.org:7051 CORE_PEER_LOCALMSPID="House02MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/peers/peer0.house02.microgrid.org/tls/ca.crt peer channel update -o orderer.microgrid.org:7050 -c hachannel -f ./channel-artifacts/House02Anchor.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/microgrid.org/orderers/orderer.microgrid.org/msp/tlscacerts/tlsca.microgrid.org-cert.pem
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/users/Admin@house03.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house03.microgrid.org:7051 CORE_PEER_LOCALMSPID="House03MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/peers/peer0.house03.microgrid.org/tls/ca.crt peer channel update -o orderer.microgrid.org:7050 -c hachannel -f ./channel-artifacts/House03Anchor.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/microgrid.org/orderers/orderer.microgrid.org/msp/tlscacerts/tlsca.microgrid.org-cert.pem
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/users/Admin@house04.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house04.microgrid.org:7051 CORE_PEER_LOCALMSPID="House04MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/peers/peer0.house04.microgrid.org/tls/ca.crt peer channel update -o orderer.microgrid.org:7050 -c hachannel -f ./channel-artifacts/House04Anchor.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/microgrid.org/orderers/orderer.microgrid.org/msp/tlscacerts/tlsca.microgrid.org-cert.pem
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/users/Admin@house05.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house05.microgrid.org:7051 CORE_PEER_LOCALMSPID="House05MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/peers/peer0.house05.microgrid.org/tls/ca.crt peer channel update -o orderer.microgrid.org:7050 -c hachannel -f ./channel-artifacts/House05Anchor.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/microgrid.org/orderers/orderer.microgrid.org/msp/tlscacerts/tlsca.microgrid.org-cert.pem
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/users/Admin@house06.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house06.microgrid.org:7051 CORE_PEER_LOCALMSPID="House06MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/peers/peer0.house06.microgrid.org/tls/ca.crt peer channel update -o orderer.microgrid.org:7050 -c hachannel -f ./channel-artifacts/House06Anchor.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/microgrid.org/orderers/orderer.microgrid.org/msp/tlscacerts/tlsca.microgrid.org-cert.pem

//this is installing chaincode
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house01.microgrid.org:7051 CORE_PEER_LOCALMSPID="House01MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/peers/peer0.house01.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house01.microgrid.org:7051 CORE_PEER_LOCALMSPID="House01MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/peers/peer1.house01.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/users/Admin@house02.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house02.microgrid.org:7051 CORE_PEER_LOCALMSPID="House02MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/peers/peer0.house02.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/users/Admin@house02.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house02.microgrid.org:7051 CORE_PEER_LOCALMSPID="House02MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house02.microgrid.org/peers/peer1.house02.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/users/Admin@house03.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house03.microgrid.org:7051 CORE_PEER_LOCALMSPID="House03MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/peers/peer0.house03.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/users/Admin@house03.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house03.microgrid.org:7051 CORE_PEER_LOCALMSPID="House03MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house03.microgrid.org/peers/peer1.house03.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/users/Admin@house04.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house04.microgrid.org:7051 CORE_PEER_LOCALMSPID="House04MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/peers/peer0.house04.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/users/Admin@house04.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house04.microgrid.org:7051 CORE_PEER_LOCALMSPID="House04MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house04.microgrid.org/peers/peer1.house04.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/users/Admin@house05.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house05.microgrid.org:7051 CORE_PEER_LOCALMSPID="House05MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/peers/peer0.house05.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/users/Admin@house05.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house05.microgrid.org:7051 CORE_PEER_LOCALMSPID="House05MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house05.microgrid.org/peers/peer1.house05.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/users/Admin@house06.microgrid.org/msp CORE_PEER_ADDRESS=peer0.house06.microgrid.org:7051 CORE_PEER_LOCALMSPID="House06MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/peers/peer0.house06.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/users/Admin@house06.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house06.microgrid.org:7051 CORE_PEER_LOCALMSPID="House06MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house06.microgrid.org/peers/peer1.house06.microgrid.org/tls/ca.crt peer chaincode install -n carecords -v 1.0 -p chaincode/go/src -l golang
erickzzh commented 5 years ago

I have rewritten some of the config files

  1. created another branch for all my changes
  2. added 12 couchdb in the config files for each peer
  3. updated the ./start and ./finish script to set up and delete the dbs correctly
  4. added .env file to include the {COMPOSE_PROJECT_NAME}

Problem No longer have the 500 level error, but received

Error: error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [hachannel] creator org [House01MSP]
erickzzh commented 5 years ago

the problem should now be fixed. All the fixed code is at the "erick_branch"

erickzzh commented 5 years ago
2018-10-11 02:20:54.307 UTC [msp] setupSigningIdentity -> DEBU 035 Signing identity expires at 2028-10-08 01:48:46 +0000 UTC
2018-10-11 02:20:54.307 UTC [msp] Validate -> DEBU 036 MSP House01MSP validating identity
2018-10-11 02:20:54.311 UTC [grpc] DialContext -> DEBU 037 parsed scheme: ""
2018-10-11 02:20:54.311 UTC [grpc] DialContext -> DEBU 038 scheme "" not registered, fallback to default scheme
2018-10-11 02:20:54.311 UTC [grpc] watcher -> DEBU 039 ccResolverWrapper: sending new addresses to cc: [{peer0.house01.microgrid.org:7051 0  <nil>}]
2018-10-11 02:20:54.311 UTC [grpc] switchBalancer -> DEBU 03a ClientConn switching balancer to "pick_first"
2018-10-11 02:20:54.311 UTC [grpc] HandleSubConnStateChange -> DEBU 03b pickfirstBalancer: HandleSubConnStateChange: 0xc420567280, CONNECTING
2018-10-11 02:20:54.319 UTC [grpc] HandleSubConnStateChange -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc420567280, READY
2018-10-11 02:20:54.329 UTC [grpc] DialContext -> DEBU 03d parsed scheme: ""
2018-10-11 02:20:54.329 UTC [grpc] DialContext -> DEBU 03e scheme "" not registered, fallback to default scheme
2018-10-11 02:20:54.329 UTC [grpc] watcher -> DEBU 03f ccResolverWrapper: sending new addresses to cc: [{peer0.house01.microgrid.org:7051 0  <nil>}]
2018-10-11 02:20:54.330 UTC [grpc] switchBalancer -> DEBU 040 ClientConn switching balancer to "pick_first"
2018-10-11 02:20:54.330 UTC [grpc] HandleSubConnStateChange -> DEBU 041 pickfirstBalancer: HandleSubConnStateChange: 0xc4202fbdc0, CONNECTING
2018-10-11 02:20:54.337 UTC [grpc] HandleSubConnStateChange -> DEBU 042 pickfirstBalancer: HandleSubConnStateChange: 0xc4202fbdc0, READY
2018-10-11 02:20:54.343 UTC [msp] GetDefaultSigningIdentity -> DEBU 043 Obtaining default signing identity
2018-10-11 02:20:54.345 UTC [msp/identity] Sign -> DEBU 044 Sign: plaintext: 0AD6070A6708031A0C0886E7FADD0510...0F0A0D676574636861696E636F646573
2018-10-11 02:20:54.345 UTC [msp/identity] Sign -> DEBU 045 Sign: digest: 49A0A88492F2BDAD9498A6FCD009C5461605EDD568D4E6721BDC62C4B1F0219B
Get instantiated chaincodes on channel hachannel:
Name: carecords, Version: 1.0, Path: chaincode/go/src, Escc: escc, Vscc: vscc

peer chaincode list --instantiated -C hachannel this command checks if you have instantiated the chaincode correctly

kalleknast commented 5 years ago

Sorry for the delay. Which command do you use to instantiate the chaincode? I use the same as I did before, i.e.:

docker exec -e "CORE_PEER_LOCALMSPID=House01MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp" cli peer chaincode instantiate -o orderer.microgrid.org:7050 -C hachannel -n carecords -l golang -v 1.0 -c '{"Args":[""]}' -P "OR ('House01MSP.member','House02MSP.member')"

But, I get the same error as you did earlier. I.e.:

Error: error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [hachannel] creator org [House01MSP]

Did you use another command?

erickzzh commented 5 years ago

No, I used the same command, but I deleted the network completely and regenerated the crypto-config files.

erickzzh commented 5 years ago

I just tried it again I received the same error idk why. I switched to peer1.house01 using

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/users/Admin@house01.microgrid.org/msp CORE_PEER_ADDRESS=peer1.house01.microgrid.org:7051 CORE_PEER_LOCALMSPID="House01MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/house01.microgrid.org/peers/peer1.house01.microgrid.org/tls/ca.crt

and ran the command again and it worked. I will try to figure out why this is happening.

kalleknast commented 5 years ago

I removed the crypto-config files, but it didn't help. Also, configure.sh removes the crypto-config files before generating new. I tried several times with and without manual removal of crypto-config. Keep getting the same error.

erickzzh commented 5 years ago

This is very weird I am not sure why it is so unstable. I will check on the logs at each container and find out what's happening. Will update you with a fix.

erickzzh commented 5 years ago

I have made some changes here and there and it seems to be working. I ran it 10 times on 2 different machines and they all worked. Let me know if it is working on yours.

You can tack all of the error msgs using kitematic. It shows a complete log for each container live time.

kalleknast commented 5 years ago

I still get errors, but they are new. But, it seems like it could be a matter of me messing up the commands. Could you list the commands you use from docker-compose -f docker-compose-cli.yaml up -d and onwards? Or, put them in start.sh and setup_chaincode.sh.

erickzzh commented 5 years ago

I have committed the latest script to erick_brach. The order to start the network should be:

1 ./configure.sh 2 ./start.sh 3 ./setup_chaincode.sh

I also added sleep xs in between some of the commands because I noticed the handshake processes could be unstable sometimes.

kalleknast commented 5 years ago

This works!

rooot@0eb2c968e5e9:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode list --instantiated -C hachannel

...

Get instantiated chaincodes on channel hachannel:
Name: carecords, Version: 1.0, Path: chaincode/go/src, Escc: escc, Vscc: vscc

Thanks

erickzzh commented 5 years ago

I commented out the chaincode container in the cli file because I have never done it this way before. Could you link the source to that section if you saw it on a tutorial somewhere?

kalleknast commented 5 years ago

I think it was here: https://dev.to/damcosset/your-first-hyperledger-fabric-network-2n67

kalleknast commented 5 years ago

No, it wasn't there. It was probably something I cooked up myself. I just saw See if the chaincode container in docker-compose-cli.yaml is neccessary in the TODO.md. It definitively wasn't.