I'm trying to build a network with hyperledger fabric, but each time it shows me an error.
Also I'm using docker images 1.0.3.
npm version: 5.6.0
nodejs version: v4.2.6
Client:
Version: 18.05.0-ce
API version: 1.37
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:16:25 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.05.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:14:32 2018
OS/Arch: linux/amd64
Experimental: false
docker-compose version 1.16.0-rc1, build 9bea70a
docker-py version: 2.5.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
Generating certs and genesis block for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
/home/bashayer/fabric-samples/first-network/../bin/cryptogen
##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +x
/home/bashayer/fabric-samples/first-network/../bin/configtxgen
##########################################################
######### Generating Orderer Genesis block ##############
##########################################################
+ configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
2018-07-06 16:29:48.898 +03 [common/tools/configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen is deprecated. Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.
2018-07-06 16:29:48.898 +03 [common/tools/configtxgen] main -> INFO 002 Loading configuration
2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewChannelGroup -> WARN 003 Default policy emission is deprecated, please include policy specificiations for the channel group in configtx.yaml
2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewOrdererGroup -> WARN 004 Default policy emission is deprecated, please include policy specificiations for the orderer group in configtx.yaml
2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 005 Default policy emission is deprecated, please include policy specificiations for the orderer org group OrdererOrg in configtx.yaml
2018-07-06 16:29:48.907 +03 [msp] getMspConfig -> INFO 006 Loading NodeOUs
2018-07-06 16:29:48.907 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 007 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org1MSP in configtx.yaml
2018-07-06 16:29:48.907 +03 [msp] getMspConfig -> INFO 008 Loading NodeOUs
2018-07-06 16:29:48.907 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 009 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org2MSP in configtx.yaml
2018-07-06 16:29:48.907 +03 [common/tools/configtxgen] doOutputBlock -> INFO 00a Generating genesis block
2018-07-06 16:29:48.908 +03 [common/tools/configtxgen] doOutputBlock -> INFO 00b Writing genesis block
2018-07-06 16:29:48.908 +03 [common/tools/configtxgen] main -> CRIT 00c Error on outputBlock: Error writing genesis block: open ./channel-artifacts/genesis.block: is a directory
+ res=1
+ set +x
Failed to generate orderer genesis block...
in my case (windows 10) generated the genesis block in missing folder:
$./byfn.sh down
$../bin/cryptogen generate --config=./crypto-config.yaml
Org1.example.com
Org2.example.com
$../bin/configtxgen --profile TwoOrgsOrdererGenesis –outputBlock./channel-
artifacts/genesis.block
$./byfn.sh generate
$./byfn.sh up
The issue occured because the system could not find any genesys.block in your channel-artifacts.
Make sure you have generated the genesys.block file at the specified location.
I hope it helps.
In our case it was the missing folder: ./channel-artifacts/
the .block file is auto created anyways
i was having a similar error
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
Channel name : mychannel
Creating channel...
+ 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
+ res=1
+ set +x
Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup orderer.example.com on 127.0.0.11:53: no such host"
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
solved it by just running ./byfn.sh up in fabric-samples/first-network/
Use this branch repo release-1.4:
https://github.com/hyperledger/fabric-samples/tree/release-1.4
$ git clone --branch release-1.4 https://github.com/hyperledger/fabric-samples.git
Anyhow first-network tutorial is deprecated
and try this video from 10:00 onwards: https://www.youtube.com/watch?v=kRwPCPdj86s
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.
Env related :
Mac OS High Sierra(version 10.13.6)
Docker version 18.06.1-ce
fabric version 1.2.0 (installed by this command :
curl https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh |bash -s 1.2.0)
You will see that there is an err after calling
./byfn.sh up
Log follows:
2018-09-04 02:37:21.047 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-09-04 02:37:21.047 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction fc42719a6fc35ab6fbd661c80735003b55bf9d3a0d451875fbdc949dc40d05e6: error starting container: error starting container: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout
!!!!!!!!!!!!!!! Chaincode instantiation on peer0.org2 on channel 'mychannel' failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
before that, when I called ./byfn.sh generate, also got some warnings which is not compatable as the tutorial https://hyperledger-fabric.readthedocs.io/en/release-1.2/build_network.html:
/Users/isme/Desktop/hpfbric/fabric-samples/first-network/../bin/configtxgen
##########################################################
######### Generating Orderer Genesis block ##############
##########################################################
+ configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
2018-09-04 10:23:17.293 CST [common/tools/configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen is deprecated. Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.
2018-09-04 10:23:17.293 CST [common/tools/configtxgen] main -> INFO 002 Loading configuration
2018-09-04 10:23:17.298 CST [common/tools/configtxgen/encoder] NewChannelGroup -> WARN 003 Default policy emission is deprecated, please include policy specificiations for the channel group in configtx.yaml
2018-09-04 10:23:17.298 CST [common/tools/configtxgen/encoder] NewOrdererGroup -> WARN 004 Default policy emission is deprecated, please include policy specificiations for the orderer group in configtx.yaml
2018-09-04 10:23:17.298 CST [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 005 Default policy emission is deprecated, please include policy specificiations for the orderer org group OrdererOrg in configtx.yaml
2018-09-04 10:23:17.298 CST [msp] getMspConfig -> INFO 006 Loading NodeOUs
2018-09-04 10:23:17.298 CST [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 007 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org1MSP in configtx.yaml
2018-09-04 10:23:17.299 CST [msp] getMspConfig -> INFO 008 Loading NodeOUs
2018-09-04 10:23:17.299 CST [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 009 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org2MSP in configtx.yaml
2018-09-04 10:23:17.299 CST [common/tools/configtxgen] doOutputBlock -> INFO 00a Generating genesis block
2018-09-04 10:23:17.300 CST [common/tools/configtxgen] doOutputBlock -> INFO 00b Writing genesis block
+ res=0
+ set +x
#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2018-09-04 10:23:17.325 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-09-04 10:23:17.330 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-09-04 10:23:17.330 CST [common/tools/configtxgen/encoder] NewApplicationGroup -> WARN 003 Default policy emission is deprecated, please include policy specificiations for the application group in configtx.yaml
2018-09-04 10:23:17.330 CST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2018-09-04 10:23:17.330 CST [common/tools/configtxgen/encoder] NewApplicationOrgGroup -> WARN 005 Default policy emission is deprecated, please include policy specificiations for the application org group Org1MSP in configtx.yaml
2018-09-04 10:23:17.330 CST [msp] getMspConfig -> INFO 006 Loading NodeOUs
2018-09-04 10:23:17.331 CST [common/tools/configtxgen/encoder] NewApplicationOrgGroup -> WARN 007 Default policy emission is deprecated, please include policy specificiations for the application org group Org2MSP in configtx.yaml
2018-09-04 10:23:17.331 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 008 Writing new channel tx
+ res=0
+ set +x
I have been following tutorial on hyper ledger website: https://hyperledger-fabric.readthedocs.io/en/release/build_network.html#behind-scenes.
I was able to run
./byfn.sh -m generate
./byfn.sh -m up
This setup run all the way through of showning the end.
like:
===================== All GOOD, BYFN execution completed =====================
_____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/
./byfn.sh -m down
Then I begun to follow the tutorial further to execute each line manually.
I have successfully executed:
cryptogen generate --config=./crypto-config.yaml
export FABRIC_CFG_PATH=$PWD
configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
export CHANNEL_NAME=mychannel
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP
CHANNEL_NAME=$CHANNEL_NAME DELAY=600 TIMEOUT=600 docker-compose -f docker-compose-cli.yaml up -d
docker exec -it cli bash
By now, I should have all the certs, channel tx and anchor peers generated and started all necessary docker containers.
then I executed
export CHANNEL_NAME=mychannel
peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
in the cli container and got:
root#cfd35d38960d:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel create -o orderer.example.com:7050 -c my
hannel2 -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabr c
c/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pemr/fabric
2018-02-05 15:27:27.735 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-05 15:27:27.735 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-05 15:27:27.742 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-05 15:27:27.745 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2018-02-05 15:27:27.745 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2018-02-05 15:27:27.746 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2018-02-05 15:27:27.746 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2018-02-05 15:27:27.746 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0A8C060A074F7267314D53501280062D...53616D706C65436F6E736F727469756D
2018-02-05 15:27:27.746 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 6D62170E3A05EA175581C405D4BF43F642341165CBF12C6928FFE0473086E46A
2018-02-05 15:27:27.746 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2018-02-05 15:27:27.747 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2018-02-05 15:27:27.747 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2018-02-05 15:27:27.747 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2018-02-05 15:27:27.748 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AC4060A1608021A0608DFEFE1D30522...D6E581EFA0DA0888D40FDA924E65BEB6
2018-02-05 15:27:27.749 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: BDDBD94262B4239B63ECFE98239E432FD354643B56DF6EBA23CBC08CDF1C5474
Error: Got unexpected status: BAD_REQUEST
Usage:
Got no idea what when wrong here. There are no further or meaningful error message shown except BAD_REQUEST.
I was running it on a vagrant environment with box of ubuntu 16.04 x64.
The fact that ./byfn.sh -m up went through means my env can run the first sample no problem. But cannot create channel manually. Any idea what when wrong?
I have deleted all docker containers and rerun, then got this message:
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application at version 0, but got version 1
It seem to be mismatched version for peer update, how to solve this?
./byfn.sh -m restart -c (channelName)
replace channel name by your own channel name if u have ran (./byfn.sh -m up) previously and if its your first time doing it then use ./byfn.sh -m up(in first-network in folder)
It might be because the certificates aren't replaced in right place. I suggest you to pull the following repo. And try running your byfn from there.
git clone -b issue-6978 https://github.com/sstone1/fabric-samples.git
What is the value of $CORE_PEER_TLS_ENABLED in your peer channel create command?
I had the same problem, and I fixed it by doing:
$ docker rmi -f $(docker images -q)
to remove the docker images.
Then, from the official website I downloaded the fabric samples, and the binaries again, the commands I used were:
git clone -b master https://github.com/hyperledger/fabric-samples.git
curl -sSL [insert link from the website] | bash -s 1.1.0-rc1
Then, it should work with you.
When I used fabric, usually not removing docker container makes a lot of problems.
So I recommend removing docker-container, use that
docker ps -aq | xargs docker rm -f
But you are careful about using another docker container.
I have downloaded and setup the hyperledger fabric network in my CentOs system. I am able to start the first network with default two organization (Org1 and Org2). Also each organization is having two peers(peer0, peer1). Now I am trying add one more Organization with one peer.
I have made changes in below files
first-network/crypto-config.yaml
first-network/configtx.yaml
first-network/docker-compose-cli.yaml
first-network/base/docker-compose-base.yaml
first-network/script/script.sh
now while trying to up the network. Below exception is coming
Having all peers join the channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2017-09-06 06:40:53.134 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-09-06 06:40:53.134 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-09-06 06:40:53.136 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2017-09-06 06:40:53.136 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A89070A5B08011A0B08F5B0BECD0510...742FDE921B171A080A000A000A000A00
2017-09-06 06:40:53.136 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 152A1C5D481840FB755E98925E0D346271894F15AB69E694C03BEC962E523A50
Error: proposal failed (err: rpc error: code = Unknown desc = Failed to deserialize creator identity, err Expected MSP ID org1MSP, received Org1MSP)
Usage:
peer channel join [flags]
Flags:
-b, --blockpath string Path to file containing genesis block
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--test.coverprofile string Done (default "coverage.cov")
--tls Use TLS when communicating with the orderer endpoint
-v, --version Display current version of fabric peer server
PEER0 failed to join the channel, Retry after 2 seconds
I am running hyper-ledger fabric on an ubuntu VM on a Mac OSX running Parallels, downloaded docker, got everything setup, but when running the first network example (command ./byfn.sh -m up) I am getting this error
===================== Chaincode is installed on remote peer PEER2 =====================
Instantiating chaincode on org2/peer2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin#org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2017-09-07 20:15:16.984 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-09-07 20:15:16.984 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-09-07 20:15:16.987 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2017-09-07 20:15:16.987 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2017-09-07 20:15:16.988 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A91070A6708031A0C08D4D1C6CD0510...324D53500A04657363630A0476736363
2017-09-07 20:15:16.988 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 17D7F0C37473394040F19251CCA253B1ECA95F7AD65AF27EFA92DE1F10D94A9B
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Error starting container: Get https://registry-1.docker.io/v2/hyperledger/fabric-baseos/manifests/x86_64-0.3.2: dial tcp: lookup registry-1.docker.io on 127.0.1.1:53: read udp 127.0.0.1:54547->127.0.1.1:53: i/o timeout
Usage:
peer chaincode instantiate [flags]
Flags:
-C, --channelID string The channel on which this command should be executed (default "testchainid")
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-E, --escc string The name of the endorsement system chaincode to be used for this chaincode
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-P, --policy string The endorsement policy associated to this chaincode
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
-V, --vscc string The name of the verification system chaincode to be used for this chaincode
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--test.coverprofile string Done (default "coverage.cov")
--tls Use TLS when communicating with the orderer endpoint
!!!!!!!!!!!!!!! Chaincode instantiation on PEER2 on channel 'mychannel' failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Error starting container: Get https://registry-1.docker.io/v2/hyperledger/fabric-baseos/manifests/x86_64-0.3.2: dial tcp: lookup registry-1.docker.io on 127.0.1.1:53: read udp 127.0.0.1:54547->127.0.1.1:53: i/o timeout
Like it says in the error you have a connectivity problem from your VM, seems connection to external IPs is lagging.