I am following a tutorial on the Hyperledger fabric site and after installing all the perquisites (latest versions) on a Linux 18.04 installation I run into an error.
I am trying to run the given ./byfn script to "Build Your First Network". After a fresh install I run the commands as follows:
./byfn generate
./byfn up
At which point everything performs as expected untill the following error occurs 5 times in a row (after which the run exits with an Error):
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
peer0.org1 failed to join the channel, Retry after 3 seconds
I have tried various things like:
- Increasing the timeout to allow for longer connection times
- I have down-ed the network and upped it again
- Full re-installations of required packages and the fabric-samples
- Removed all docker volumes/images/containers
I came across some sources mentioning that it might have to do with the peers not being able to connect to each other. Which I tried to fix with a manual docker connect of each peer to the byfn docker network, no success there. I can see the orderer running but the peers that attempted to join the network exited with an error:
docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
99570e191542 hyperledger/fabric-tools:latest "/bin/bash" 24 seconds ago Up 23 seconds cli
340d1225a913 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 24 seconds ago peer0.org1.example.com
fabe017751a0 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 25 seconds ago peer1.org2.example.com
f81a639f29f6 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 26 seconds ago peer1.org1.example.com
0f91080db681 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 27 seconds ago peer0.org2.example.com
c491adc91320 hyperledger/fabric-orderer:latest "orderer" 30 seconds ago Up 28 seconds 0.0.0.0:7050->7050/tcp orderer.example.com
This shows that the nodes exited with an error code, they all look the same, look below for a docker logs of the peer node.
So my final question is: How do I get the "First Network" Hyperledger sample peers to successfully join the channel?
Thanks in advance!
Update 1
I chose a bad code dump! Please use these links for logs/outputs.
Update 2
So I have been trying various things, it seems to not be a go related error but simply a "connection" error where go crashes upon trying to connect a peer to the channel. So the main question at hand is: Why are my docker instances not properly connecting to the channel?
Update 3
I have used Amazon Web Services to launch a Linux instance and re-created all my installation steps on this "fresh" instance. Everything worked on the first go (pun intended). Therefore I must conclude that it had to do with either my network settings or personal setup as these are the only parameters that changed.
As this works for me for now I will work with that. I am still open to suggestions and will keep an eye on this post!
Package versions
Hyperledger Fabric 1.4.0
Docker version 18.09.2, build 6247962
docker-compose version 1.13.0, build 1719ceb
go version go1.11 linux/amd64
npm: '6.4.1',
node -v: v8.15.0