I got the "Write your First Application" stuff working great.
So I copied the files and renamed stuff to support a different chaincode app.
When I run startFabric.sh node (since my source is javascript), I eventually get:
# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1
docker-compose -f docker-compose.yml down
Removing network net_basic
WARNING: Network net_basic not found.
docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Creating couchdb
Creating orderer.example.com
Creating ca.example.com
Creating peer0.org1.example.com
# wait for Hyperledger Fabric to start
# incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=<larger number>
export FABRIC_START_TIMEOUT=10
#echo ${FABRIC_START_TIMEOUT}
sleep ${FABRIC_START_TIMEOUT}
# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
2018-08-18 06:23:14.962 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-08-18 06:23:14.983 UTC [cli/common] readBlock -> INFO 002 Got status: &{NOT_FOUND}
2018-08-18 06:23:14.984 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-08-18 06:23:15.187 UTC [cli/common] readBlock -> INFO 004 Received block: 0
# Join peer0.org1.example.com to the channel.
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.example.com/msp" peer0.org1.example.com peer channel join -b mychannel.block
2018-08-18 06:23:15.407 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-08-18 06:23:15.481 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
Creating cli
2018-08-18 06:23:16.314 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-08-18 06:23:16.314 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-08-18 06:23:16.316 UTC [container] WriteFolderToTarPackage -> INFO 003 rootDirectory = /opt/gopath/src/github.com/permissioned-jpgs/node
2018-08-18 06:23:16.353 UTC [chaincodeCmd] install -> INFO 004 Installed remotely response:<status:200 payload:"OK" >
2018-08-18 06:23:16.590 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-08-18 06:23:16.590 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: endorsement failure during invoke. chaincode result: <nil>
Notice endorsement fails. Any ideas? I've checked everything I can think of and I'm completely stumped. Thanks!
My Docker ignorance is showing.
I just needed to view the logs for the peer node I was interacting with by doing: sudo docker logs -f dev-peer0.org1.example.com-fabcar-1.0
These logs showed me it was a problem with the Javascript I had written when customizing the chaincode, not a Fabric network config issue like I previously thought.
Related
I am on CentOS 7, installed all prerequisites, cloned the fabric-samples git repository.
I am referring to the tutorial "Building Your First Network", found here. At this point I have successfully run the command
./byfn.sh generate
Now I want to execute the Java chaincode, so I run
./byfn.sh up -l java
Right after the START sign, I see the following output:
Build your first network (BYFN) end-to-end test
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
Channel name : mychannel
Creating channel...
+ res=0
+ set +x
2020-02-21 09:14:36.439 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:36.463 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{NOT_FOUND}
2020-02-21 09:14:36.466 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-02-21 09:14:36.667 UTC [cli.common] readBlock -> INFO 004 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.670 UTC [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized
2020-02-21 09:14:36.871 UTC [cli.common] readBlock -> INFO 006 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.876 UTC [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized
2020-02-21 09:14:37.077 UTC [cli.common] readBlock -> INFO 008 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.081 UTC [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized
2020-02-21 09:14:37.281 UTC [cli.common] readBlock -> INFO 00a Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.284 UTC [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized
2020-02-21 09:14:37.486 UTC [cli.common] readBlock -> INFO 00c Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.489 UTC [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized
2020-02-21 09:14:37.692 UTC [cli.common] readBlock -> INFO 00e Received block: 0
===================== Channel 'mychannel' created =====================
But the test still continues with no issues until the chaincode installation part.
===================== Chaincode is packaged on peer0.org1 =====================
Installing chaincode on peer0.org1...
+ peer lifecycle chaincode install mycc.tar.gz
+ res=1
+ set +x
Error: failed to endorse chaincode install: rpc error: code = Unavailable desc = transport is closing
!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
The test stalls for quite some time at the Installing chaincode on peer0.org1... line, before ending in this error message.
The following is the full output:
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...
LOCAL_VERSION=2.0.0
DOCKER_IMAGE_VERSION=2.0.0
/root/hyperledger/fabric/bin/cryptogen
##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +x
Generate CCP files for Org1 and Org2
/root/hyperledger/fabric/bin/configtxgen
##########################################################
######### Generating Orderer Genesis block ##############
##########################################################
2020-02-21 17:14:15.274 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.309 +08 [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: etcdraft
2020-02-21 17:14:15.310 +08 [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216
2020-02-21 17:14:15.310 +08 [common.tools.configtxgen.localconfig] Load -> INFO 004 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.312 +08 [common.tools.configtxgen] doOutputBlock -> INFO 005 Generating genesis block
2020-02-21 17:14:15.312 +08 [common.tools.configtxgen] doOutputBlock -> INFO 006 Writing genesis block
#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2020-02-21 17:14:15.347 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.390 +08 [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.391 +08 [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx
2020-02-21 17:14:15.393 +08 [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 004 Writing new channel tx
+ res=0
+ set +x
#################################################################
####### Generating anchor peer update for Org1MSP ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2020-02-21 17:14:15.434 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.477 +08 [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.477 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
2020-02-21 17:14:15.479 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
+ res=0
+ set +x
#################################################################
####### Generating anchor peer update for Org2MSP ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
2020-02-21 17:14:15.525 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.576 +08 [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.576 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
2020-02-21 17:14:15.578 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
+ res=0
+ set +x
Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
Creating volume "net_orderer2.example.com" with default driver
Creating volume "net_orderer3.example.com" with default driver
Creating volume "net_orderer4.example.com" with default driver
Creating orderer.example.com ... done
Creating cli ... done
Creating orderer4.example.com ...
Creating peer1.org2.example.com ...
Creating orderer3.example.com ...
Creating orderer5.example.com ...
Creating peer0.org2.example.com ...
Creating peer0.org1.example.com ...
Creating orderer.example.com ...
Creating orderer2.example.com ...
Creating cli ...
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a25f3414f14e hyperledger/fabric-tools:latest "/bin/bash" 1 second ago Up Less than a second cli
85e4e7490b95 hyperledger/fabric-orderer:latest "orderer" 4 seconds ago Up Less than a second 7050/tcp, 0.0.0.0:8050->8050/tcp orderer2.example.com
6f393ad561dc hyperledger/fabric-peer:latest "peer node start" 4 seconds ago Up Less than a second 0.0.0.0:7051->7051/tcp peer0.org1.example.com
6cfd44256f6d hyperledger/fabric-orderer:latest "orderer" 4 seconds ago Up Less than a second 0.0.0.0:7050->7050/tcp orderer.example.com
691f224ac19a hyperledger/fabric-orderer:latest "orderer" 5 seconds ago Up 1 second 7050/tcp, 0.0.0.0:11050->11050/tcp orderer5.example.com
930177cb2965 hyperledger/fabric-peer:latest "peer node start" 5 seconds ago Up 1 second 7051/tcp, 0.0.0.0:9051->9051/tcp peer0.org2.example.com
cc4fc902a8f0 hyperledger/fabric-peer:latest "peer node start" 5 seconds ago Up 1 second 7051/tcp, 0.0.0.0:10051->10051/tcp peer1.org2.example.com
b192db94069c hyperledger/fabric-orderer:latest "orderer" 5 seconds ago Up 1 second 7050/tcp, 0.0.0.0:10050->10050/tcp orderer4.example.com
6db78ac784c8 hyperledger/fabric-orderer:latest "orderer" 5 seconds ago Up 2 seconds 7050/tcp, 0.0.0.0:9050->9050/tcp orderer3.example.com
1bea7b96c621 hyperledger/fabric-peer:latest "peer node start" 5 seconds ago Up 1 second 7051/tcp, 0.0.0.0:8051->8051/tcp peer1.org1.example.com
d23e83c3cde5 hyperledger/fabric-javaenv:2.0 "/bin/sh -c ./build.…" 17 minutes ago Exited (0) 15 minutes ago goofy_goldstine
Sleeping 15s to allow Raft cluster to complete booting
Vendoring Go dependencies ...
~/hyperledger/fabric/fabric-samples/chaincode/abstore/go ~/hyperledger/fabric/fabric-samples/first-network
./byfn.sh: line 180: go: command not found
~/hyperledger/fabric/fabric-samples/first-network
Finished vendoring Go dependencies
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
Channel name : mychannel
Creating channel...
+ res=0
+ set +x
2020-02-21 09:14:36.439 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:36.463 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{NOT_FOUND}
2020-02-21 09:14:36.466 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-02-21 09:14:36.667 UTC [cli.common] readBlock -> INFO 004 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.670 UTC [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized
2020-02-21 09:14:36.871 UTC [cli.common] readBlock -> INFO 006 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.876 UTC [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized
2020-02-21 09:14:37.077 UTC [cli.common] readBlock -> INFO 008 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.081 UTC [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized
2020-02-21 09:14:37.281 UTC [cli.common] readBlock -> INFO 00a Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.284 UTC [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized
2020-02-21 09:14:37.486 UTC [cli.common] readBlock -> INFO 00c Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.489 UTC [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized
2020-02-21 09:14:37.692 UTC [cli.common] readBlock -> INFO 00e Received block: 0
===================== Channel 'mychannel' created =====================
Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:37.763 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:37.783 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org1 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:40.850 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:40.869 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org1 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:43.934 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:43.954 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org2 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:47.020 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:47.040 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org2 joined channel 'mychannel' =====================
Updating anchor peers for org1...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org1MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2020-02-21 09:14:50.102 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:50.119 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org1MSP' on channel 'mychannel' =====================
Updating anchor peers for org2...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org2MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2020-02-21 09:14:53.190 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:53.207 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' =====================
+ peer lifecycle chaincode package mycc.tar.gz --path /opt/gopath/src/github.com/hyperledger/fabric-samples/chaincode/abstore/java/ --lang java --label mycc_1
+ res=0
+ set +x
===================== Chaincode is packaged on peer0.org1 =====================
Installing chaincode on peer0.org1...
+ peer lifecycle chaincode install mycc.tar.gz
+ res=1
+ set +x
Error: failed to endorse chaincode install: rpc error: code = Unavailable desc = transport is closing
!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
EDIT 24/02/2020: I brought down the script, killed all active containers and pruned them, then re-ran the script.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6182b99f3483 hyperledger/fabric-javaenv:2.0 "/bin/sh -c ./build.…" 4 minutes ago Up 4 minutes suspicious_galileo
158e8bbd501b hyperledger/fabric-tools:latest "/bin/bash" 5 minutes ago Up 5 minutes cli
1d4f0e232e58 hyperledger/fabric-peer:latest "peer node start" 5 minutes ago Up 5 minutes 0.0.0.0:7051->7051/tcp peer0.org1.example.com
90ba9fb67fae hyperledger/fabric-orderer:latest "orderer" 5 minutes ago Up 5 minutes 7050/tcp, 0.0.0.0:11050->11050/tcp orderer5.example.com
e4f730446f05 hyperledger/fabric-orderer:latest "orderer" 5 minutes ago Up 5 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
a9c126e1e280 hyperledger/fabric-orderer:latest "orderer" 5 minutes ago Up 5 minutes 7050/tcp, 0.0.0.0:8050->8050/tcp orderer2.example.com
c53240f4d9fe hyperledger/fabric-peer:latest "peer node start" 5 minutes ago Up 5 minutes 7051/tcp, 0.0.0.0:9051->9051/tcp peer0.org2.example.com
7c96596eda01 hyperledger/fabric-peer:latest "peer node start" 5 minutes ago Up 5 minutes 7051/tcp, 0.0.0.0:10051->10051/tcp peer1.org2.example.com
4fabd60e9af4 hyperledger/fabric-peer:latest "peer node start" 5 minutes ago Up 5 minutes 7051/tcp, 0.0.0.0:8051->8051/tcp peer1.org1.example.com
c5ffe6032bdd hyperledger/fabric-orderer:latest "orderer" 5 minutes ago Up 5 minutes 7050/tcp, 0.0.0.0:10050->10050/tcp orderer4.example.com
04ec9beedce6 hyperledger/fabric-orderer:latest "orderer" 5 minutes ago Up 5 minutes 7050/tcp, 0.0.0.0:9050->9050/tcp orderer3.example.com
The Java container is running properly, but the error still persists.
I am running the Fabric sample 'fabcar' following this tutorial.
After running the startFabric.sh javascript command, I am getting this error:
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg timeout expired while starting chaincode fabcar:1.0 for transaction
ubuntu#testvm1:~/fabric-samples/fabcar$ ./startFabric.sh javascript
# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1
docker-compose -f docker-compose.yml down
Removing network net_basic
docker-compose -f docker-compose.yml up -d ca.example.com
orderer.example.com peer0.org1.example.com couchdb
Creating ca.example.com ... done
Creating peer0.org1.example.com ... done
Creating orderer.example.com ...
Creating ca.example.com ...
Creating peer0.org1.example.com ...
# wait for Hyperledger Fabric to start
# incase of errors when running later commands, issue export
FABRIC_START_TIMEOUT=<larger number>
export FABRIC_START_TIMEOUT=10
#echo ${FABRIC_START_TIMEOUT}
sleep ${FABRIC_START_TIMEOUT}
# Create the channel
docker exec -e
"CORE_PEER_LOCALMSPID=Org1MSP"e"CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp
/users/Admin#org1.example.com/ms
p" peer0.org1.example.com peer channel create -o orderer.example.com:7050
-c mychannel -f /etc/hyperledger/configtx/channel.tx
2019-03-29 10:29:37.993 UTC [channelCmd] InitCmdFactory -> INFO 001
Endorser and orderer connections initialized
2019-03-29 10:29:38.034 UTC [cli.common] readBlock -> INFO 002 Received
block: 0
# Join peer0.org1.example.com to the channel.
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e
"CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.example.com/m
sp" peer0.org1.example.com peer channel join -b mychannel.block
2019-03-29 10:29:38.267 UTC [channelCmd] InitCmdFactory -> INFO 001
Endorser and orderer connections initialized
2019-03-29 10:29:38.459 UTC [channelCmd] executeJoin -> INFO 002
Successfully submitted proposal to join channel
Creating cli ... done
2019-03-29 10:29:39.729 UTC [chaincodeCmd] checkChaincodeCmdParams ->
INFO 001 Using default escc
2019-03-29 10:29:39.729 UTC [chaincodeCmd] checkChaincodeCmdParams ->
INFO 002 Using default vscc
2019-03-29 10:29:39.767 UTC [chaincodeCmd] install -> INFO 003 Installed
remotely response:<status:200 payload:"OK" >
2019-03-29 10:29:39.982 UTC [chaincodeCmd] checkChaincodeCmdParams ->
INFO 001 Using default escc
2019-03-29 10:29:39.982 UTC [chaincodeCmd] check`enter code
here`ChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not
successful, error code 500, msg timeout expired while starting chaincode
fabcar:1.0 for transaction
I currently have a running Kafka-based hyperledger running on docker.
The full container list is as such:
2x orderer
2x peer
1x certificate-authority
3x zookeeper
4x kafka nodes
1x cli tools
I have sucessfully created a channel using cli by the following command
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/users/Admin#company/msp" peer0.company peer channel create -o orderer0.company:7050 -c messagebus -f /etc/hyperledger/configtx/channel.tx
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/users/Admin#company/msp" peer0.company peer channel join -b messagebus.block
I can see the peer is joined using the following command:
docker exec cli peer channel list
2019-01-07 16:54:41.784 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
Channels peers has joined:
messagebus
I then want to init and instantiate my chaincode as such
#install the chaincode
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/company/users/Admin#company/msp" cli peer chaincode install -n testnet -v 1.0 -p "$CC_SRC_PATH" -l "$LANGUAGE"
2019-01-07 16:46:23.154 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-01-07 16:46:23.154 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2019-01-07 16:46:23.615 UTC [chaincodeCmd] install -> INFO 005 Installed remotely response:<status:200 payload:"OK" >
#instantiate the chaincode
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/company/users/Admin#company/msp" cli peer chaincode instantiate -o orderer0.company:7050 -C messagebus -n testnet -l "$LANGUAGE" -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
2019-01-07 16:46:24.210 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-01-07 16:46:24.210 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
Error: error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [messagebus] creator org [Org1MSP]
As the final line shows, the access is denied to the channel.
I am also unable to join a Java SDK client to the channel and receive similar access denied errors.
I see the following logs in the peer0 container:
2019-01-07 16:46:23.611 UTC [endorser] callChaincode -> INFO 0f1 [][bfb2e2d4] Entry chaincode: name:"lscc"
2019-01-07 16:46:23.614 UTC [lscc] executeInstall -> INFO 0f2 Installed Chaincode [gmex] Version [1.0] to peer
2019-01-07 16:46:23.614 UTC [endorser] callChaincode -> INFO 0f3 [][bfb2e2d4] Exit chaincode: name:"lscc" (2ms)
2019-01-07 16:46:23.614 UTC [comm.grpc.server] 1 -> INFO 0f4 unary call completed {"grpc.start_time": "2019-01-07T16:46:23.61Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "XXX.XXX.X.XXX:123", "grpc.code": "OK", "grpc.call_duration": "3.771114ms"}
2019-01-07 16:46:24.214 UTC [protoutils] ValidateProposalMessage -> WARN 0f5 channel [messagebus]: MSP error: the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.company")
this leads me to believe the peer is not correctly setup... however it is able to create the channel successfully.
Any pointers would be appreciated
I am trying to apply the packaging method for the chaincode which enables me to enforce signatures from multiple organizations and make sure that chaincode cannot be effectively instantiated if signatures from relevant participants in the channel are not collected.
a) From Org1 context:
# peer chaincode package -n mycc -p github.com/chaincode/chaincode_example02/go/ -v 1 -s -S -i "AND('Org1.admin','Org2.admin')" ccpack.out
2018-12-03 22:49:46.032 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-12-03 22:49:46.032 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
root#bdc554f0a918:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode signpackage ccpack.out signedccpack.out
Wrote signed package to signedccpack.out successfully
root#bdc554f0a918:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode install signedccpack.out
2018-12-03 22:50:21.125 UTC [chaincodeCmd] install -> INFO 001 Installed remotely response:<status:200 payload:"OK" >
b) From Org2 context:
root#bdc554f0a918:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode signpackage ccpack.out signedccpack.out
Wrote signed package to signedccpack.out successfully
root#bdc554f0a918:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode install signedccpack.out
2018-12-03 22:50:32.414 UTC [chaincodeCmd] install -> INFO 001 Installed remotely response:<status:200 payload:"OK" >
c) From either Org context:
root#bdc554f0a918:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C channel1 -n mycc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "AND ('Org1MSP.peer','Org2MSP.peer')"
2018-12-03 22:50:42.946 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-12-03 22:50:42.950 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg cannot get package for chaincode (mycc:1.0)
d) The chaincode is present on Org1 Peer 1:
root#af99b3698322:/var/hyperledger/production/chaincodes# ls
mycc.1
e) The chaincode is present on Org2 Peer 1:
root#2fd1355259a8:/var/hyperledger/production/chaincodes# ls
mycc.1
Any recommendations as to the process or the cli syntax structure would be greatly appreciated.
The official hyperledger fabric v1.0.0 gives a simple demo by using docker.
What i am doing is to avoid docker and directly run them on the machine. Thanks to the answer from my previous question, I have successfully launched 1 solo orderer, two peers (each from one org), created and joined the channels from peers, installed the chaincode on two peers.
The client side's command to install chaincode is
peer chaincode install -n myC1 -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
Both peers return the following message and I think it should be correct.
2017-09-11 16:34:26.361 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2017-09-11 16:34:26.361 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2017-09-11 16:34:26.556 SGT [main] main -> INFO 003 Exiting.....
However, when i try to instantiate the chaincode as follows
peer chaincode instantiate -o orderer.example.com:7040 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n myC1 -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')
Client console returns the error message
2017-09-11 17:00:18.181 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2017-09-11 17:00:18.181 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Failed to init chaincode(handler not found for chaincode myC1:1.0)
The console of Peer0.org2 gives NO error message. But Peer0.org1's console gives the following:
2017-09-11 17:00:18.183 SGT [chaincode] Launch -> ERRO 032 sending init failed(handler not found for chaincode myC1:1.0)
2017-09-11 17:00:18.184 SGT [endorser] simulateProposal -> ERRO 033 failed to invoke chaincode name:"lscc" on transaction a665c5305c5e3f158d272e4a39b04611e5335406e2a7c7057f11d32d8e07670e, error: Failed to init chaincode(handler not found for chaincode myC1:1.0)
Can any one help me to solve this problem and give me a simple explanation??