not able to start business network - hyperledger-fabric

I am not able to start my business network.
Command executed:
composer network start --networkName bank --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#fabric-network --file networkadmin.card
Error message:
Error: Error trying to start business network.
Error: Failed to connect to any peer event hubs. It is required that at least 1 event hub has been connected to receive the commit event
Command failed
Environment:
Ubuntu 16.04,
Fabric 1.2.1,
Composer 0.20.4
What have I done to troubleshoot?
checked the logs and could not find anything
changed the version hlfv1 to hlfv12 in connection.json

Related

Problem in starting hyperledger fabric network (for supplychain) in hyperledger composer

I am trying to set up a network using hyper ledger composer, for which I followed the Developer tutorial for creating a Hyperledger Composer solution but when I use the command -->
composer network start --networkName supplychain-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card
it gives the following error-->
Starting business network supplychain-network at version 0.0.1
Processing these Network Admins:
userName: admin
⠙ Starting business network definition. This may take a minute...(node:173299) DeprecationWarning: grpc.load: Use the #grpc/proto-loader module with grpc.loadPackageDefinition instead
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: Error: 2 UNKNOWN: Failed to deserialize creator identity, err MSP Org1MSP is unknown
Command failed
please help. thanks in advance

Unable to create channel in Fabric Network

I am trying to create a fabric application using node.
And so from the /fabric-samples/test-network directory, when I run the command - ./network.sh up.
It starts the network and then the orderer is running on port 7053.
Now, when I run the command - ./network.sh createChannel -c channel1 -ca
It outputs,
Error: Post "https://localhost:7053/participation/v1/channels": read tcp 127.0.0.1:60864->127.0.0.1:7053: read: connection reset by peer
Channel creation failed
Why is it occuring and how can it be resolved?

Hyperledger-composer unable to change BlockTimeout

I am working on prototyping a game using hyperledger-composer. I need to decrease the block time out however the instructions provided in the fabric-dev-servers do not work.
I followed the howtobuild.txt found in ~/fabric-dev-servers/fabric-scripts/hlfv12/composer however installing the network using composer network start --networkName .... the network fails to start with the error:
Error: Error trying to start business network. Error: Failed to connect to any peer event hubs. It is required that at least 1 event hub has been connected to receive the commit event
the versions i am uising are composer#20 and fabric docker images with the tag 1.2.1 (as downloaded by) ./startFabric.sh
The steps I have taken are exactly as follows:
cd ~/fabric-dev-servers/fabric-scripts/hlfv12/composer
nano configtx.yaml
inside this file I
Move the profile block to the bottom of the ymal (to stop the weird error)
change BatchTimeout to 200ms
changed MaxMessageCount to 1
after saving the file I do
rm -r crypto-config
cryptogen generate --config=./crypto-config.yaml
get the new key and update docker-composer.yml and docker-compose-dev.yml
$(ls -1 crypto-config/peerOrganizations/org1.example.com/ca/*_sk`
get key from keystore
ls -1 crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/keystore/*_sk
update peerAdminCard sell script with the new key
nano ../createPeerAdminCard.sh
Generate
configtxgen -profile ComposerChannel -outputCreateChannelTx ./composer-channel.tx -channelID composerchannel`
configtxgen -profile ComposerOrdererGenesis -outputBlock ./composer-genesis.block
create peer admin card
cd ../ && ./createPeerAdminCard.sh
At this point it starts downloading the fabric docker images, which all run successfully
I then create my BNA file and try to start the network
cd /my/buisness/network
composer archive create -t dir -n .
composer network install --card PeerAdmin#hlfv1 --archiveFile my-game#0.0.1.bna
composer network start --networkName my-game --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card
which gives the error
Error: Error trying to start business network. Error: Failed to connect to any peer event hubs. It is required that at least 1 event hub has been connected to receive the commit event
The Debugging steps i have taken are as follows
After viewing the peer logs i can see delivering blocks to the orderer fails because composerchannel does not exist, so i manually try to create and join the channel manually
docker exec peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c composerchannel -f /etc/hyperledger/configtx/composer-channel.tx
which is a success
2019-03-23 00:07:38.131 UTC [cli/common] readBlock -> INFO 05e Received block: 0
I then try to join the peer to the channel
docker exec peer0.org1.example.com peer channel join -o orderer.example.com:7050 -b composerchannel.block --tls --cafile /etc/hyperledger/msp/users/Admin#org1.example.com/tls/ca.crt --keyfile /etc/hyperledger/msp/users/Admin#org1.example.com/tls/client.key --certfile /etc/hyperledger/msp/users/Admin#org1.example.com/tls/client.crt
which gives the error
proposal failed (err: bad proposal response 500: access denied for [JoinChain][composerchannel]: [Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]])
There are a lot of different 'Admin' Pems inside the /etc/hyperledger/msp and /etc/hyperledger/tls so I'm pretty much trying all combinations
I'm at a loss, I've been on google for hours trying to find anyone with the same issue but have come up short. Any help will be appreciated.
UPDATE
Turns out explicitly defining the certificates where not needed. running this command allowed me to join the channel.
docker exec peer0.org1.example.com peer channel join -o orderer.example.com:7050 -b composerchannel.block --clientauth --tls
at this point all the docker containers were running and the channel was working. i manage to be able to start the network and everything ran fine (i could request the chaincode, ledger was updating fine etc). However it still seems to take 2 seconds to process a transaction. Again i did some debugging to make sure the config on the order was correct.
fetch config block from channel on orderer
docker exec peer0.org1.example.com peer channel fetch config config_block.pb -o http_s_://orderer.example.com:7050 -c composerchannel --tls --cafile /etc/hyperledger/peer/msp/tlscacerts/tlsca.org1.example.com-cert.pem
copy out of container to local machine
docker cp 5eeaf8c650f8:/root/config_block.pb config_block.pb
convert from proto-buf to json (using configtxlator binary found in fabric-samples)
configtxlator docker exec peer0.org1.example.com proto_decode --input config_block.pb --type common.Block | jq .data.data[0].payload.data.config > config.json
After getting the config of the channel i could see that the BatchTimeout was 200ms and BatchAmount was 1, yet i still have the 2 seconds timeout per transaction.
While working with Hyperledger composer now you have to keep in mind that it is obselete. I have followed these same steps many times in the past and built custom networks. I think your issue could be of version mismatch. Try downgrading composer to 0.19.
Additionally, did you try doing a docker ps to make sure that all the required containers are running?
Also, before doing the configtxgen command there's a simple command
export FABRIC_CFG_PATH=$PWD
Did you do this?

Error trying to ping. Error: 2 UNKNOWN: access denied:

I have successfully installed and started the business network using composer.I have installed and started using these commands:
composer network install --card PeerAdmin#hlfv1 --archiveFile procurement-phase#0.0.18.bna
composer network start --networkName procurement-phase --networkVersion 0.0.18 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card
I have also imported the card created after the start of business network using :
composer card import --file networkadmin.card
Now I am trying to ping the network using the card:
composer network ping --card admin#procurement-phase
but I get
Error: Error trying to ping. Error: 2 UNKNOWN: access denied: channel [composerchannel] creator org [Org1MSP]
Command failed
Expected result:
The connection to the network was successfully tested: procurement-phase
version: 0.15.0-20171108090428
participant: org.hyperledger.composer.system.NetworkAdmin#admin
Command succeeded
Is the peer running properly? If you do something like: telnet localhost 7051 (If your peer would be in that ip and port) Do you get a connected message?
If it's another ip you should modify the connection.json file for the card.
You need to provide more information, explain the steps to took when bringing up the network, if it's the sample network...
It is because of the certificate errors.As I got the error in docker logs of certificate authority of org1 about the incorrect path to default ca.So i correctly specified path of the default ca folder in the volumes of ca in docker-compose.yaml .

Error: Error trying to start business network. Error: No valid responses from any peers

I already searched around for solutions but nothing seems to work in my case.
dany#ubuntu:~/Blockchain/tutorial-network$ composer network start --networkName tutorial-network --networkVersion 0.0.2 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card
Starting business network tutorial-network at version 0.0.2
Processing these Network Admins:
userName: admin
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: REQUEST_TIMEOUT
Command failed
I already restartet the Factory and restartet Ubuntu but I still get this error.
I had faced the same problem. Make sure you have right versions of prerequisites installed in your system. In my case, I had wrong docker version installed.

Resources