Setting up a Blockchain Business Network With Hyperledger Fabric & Composer Running in Multiple Physical Machine


(Varun Raj) #198

I’d strongly suggest you to use 17.06 for Fabric 1.1


(Varun Raj) #199

Was the issue with orderer not being reachable? I can see that you gave the domain name instead of ip address of the machine.


(Anitha Reddy) #200

node version please ?


(Tauseef Ahmed Wahdat) #201

I am getting the below error when deploying the network on the first machine

-07-19 15:57:13.120 UTC [shim] beforeTransaction -> DEBU 392 [01a6bdc0]Received TRANSACTION, invoking transaction on chaincode(Src:ready, Dst:ready)
2018-07-19 15:57:13.240 UTC [shim] func1 -> DEBU 393 [01a6bdc0]Transaction completed. Sending COMPLETED
2018-07-19 15:57:13.243 UTC [shim] func1 -> DEBU 394 [01a6bdc0]Move state message COMPLETED
2018-07-19 15:57:13.244 UTC [shim] handleMessage -> DEBU 395 [01a6bdc0]Handling ChaincodeMessage of type: COMPLETED(state:ready)
2018-07-19 15:57:13.244 UTC [shim] func1 -> DEBU 396 [01a6bdc0]send state message COMPLETED
2018-07-19 15:57:13.244 UTC [chaincode] processStream -> DEBU 397 [01a6bdc0]Received message COMPLETED from shim
2018-07-19 15:57:13.244 UTC [chaincode] HandleMessage -> DEBU 398 [01a6bdc0]Fabric side Handling ChaincodeMessage of type: COMPLETED in state ready
2018-07-19 15:57:13.244 UTC [chaincode] HandleMessage -> DEBU 399 [01a6bdc0a509bff2f44a91d7c310761c5cd47236d605ab9fc7d5301d4d211282]HandleMessage- COMPLETED. Notify
2018-07-19 15:57:13.244 UTC [chaincode] notify -> DEBU 39a notifying Txid:01a6bdc0a509bff2f44a91d7c310761c5cd47236d605ab9fc7d5301d4d211282
2018-07-19 15:57:13.245 UTC [chaincode] Execute -> DEBU 39b Exit
2018-07-19 15:57:13.245 UTC [endorser] callChaincode -> DEBU 39c Exit
2018-07-19 15:57:13.245 UTC [endorser] simulateProposal -> DEBU 39d Exit
2018-07-19 15:57:13.245 UTC [endorser] ProcessProposal -> ERRO 39e simulateProposal() resulted in chaincode response status 500 for txid: 01a6bdc0a509bff2f44a91d7c310761c5cd47236d605ab9fc7d5301d4d211282
2018-07-19 15:57:13.291 UTC [endorser] ProcessProposal -> DEBU 39f Exit
2018-07-19 15:57:13.330 UTC [eventhub_producer] validateEventMessage -> DEBU 3a0 ValidateEventMessage starts for signed event 0xc4202ae2a0
2018-07-19 15:57:13.332 UTC [eventhub_producer] deRegisterHandler -> DEBU 3a1 deregistering event type: BLOCK
2018-07-19 15:57:13.400 UTC [eventhub_producer] Chat -> ERRO 3a2 error during Chat, stopping handler: rpc error: code = Canceled desc = context canceled.

Can anybody help me with a solution


(Pratik Agarwal) #202

Actually there was issue with syntax of my createPeerAdminCard.sh , since i am using newer version of composer-cli, there were multiple places to put new peer info, and i was missing that


(Siddharth) #203

Hello,

When I am running ./teardownFabric.sh && ./startFabric.sh && ./createPeerAdminCard.sh on the 1st machine ,it list the following error:-

Unknown argument: n
Successfully created business network card file to
        Output file: /tmp/PeerAdmin@hlfv1.card
Command succeeded
Failed to import the business network card
Connection profile has no `x-type` property defined. It is not valid for this version of composer
Error: Errors found in the connection profile in the card
Command failed

Can anyone please able to solve this problem

Thanks for the help,


(Pratik Agarwal) #204

you are using older code in connection.json, but it seems your composer-cli is newer (>=0.19)


(Nico Ventrella) #205

HI, thanks a lot for this post. It’ illuminating. Now I’m trying to follow the steps but I firstly stumbled in the cert creation part. When I run the following command I obtain:

cryptogen generate --config=./crypto-config.yaml 
_cryptogen: command not found_

configtxgen -profile ComposerOrdererGenesis -outputBlock ./composer-genesis.block
_configtxgen: command not found_

Even if I step forward I have another issue in the creation of the Peer Admin card:
./createPeerAdminCard.sh

I obtain:

_Failed to import the business network card_
_Connection profile has no `x-type` property defined. It is not valid for this version of composer_

_Error: Errors found in the connection profile in the card_
_Command failed_

What does it means “x-type”? Are the two problems related?
Since I have seen another post in which someone has the same problem and asked for composer-cli version and connection.json, I can tell you my composer-cli version is 0.19.13 and following is my connection.json code:

_{"name":"hlfv1","type":"hlfv1","orderers":[{"url":"grpc://localhost:7050"}],"ca":{"url":"http://localhost:7054","name":"ca.org1.example.com"},"peers":[{"requestURL":"grpc://localhost:7051","eventURL":"grpc://localhost:7053"},{"requestURL":"grpc://localhost:8051","eventURL":"grpc://localhost:8053"},{"requestURL":"grpc://192.168.1.118:9051","eventURL":"grpc://192.168.1.118:9053"}],"channel":"composerchannel","mspID":"Org1MSP","timeout":300}_

Thanks in advance!


(Pranjal Singh) #206

You are using older format. Try new syntax of ./createPeerAdminCard.sh


(Pranjal Singh) #207

Hi,
I successfully ran two peers on two different machines by following your instruction.
Now I am trying to add one more peer at runtime. I successfully able to do that at machine 3 by following same instruction that i followed for machine 2 peer but on machine third how do I run the chaincode(BNA) at the time of run .startFabric.sh because only 2 docker are coming currently, one for peer and other for its couchDB, docker for chaincode coming up only when I upgrade the chaincode from machine 1(machine with orderer and CA). I want chaincode docker on doing ./startFabric also


(Nico Ventrella) #208

Hi, thanks for the hint. I rewite the connection json following the new format. Now fabric network is up and running and I was able to create and import the PeerAdmin Card. Furthermore, I created my business network (BND) but when I try to install it:

composer network install -c PeerAdmin@hlfv1 -a fabric-dev-servers@0.0.13.bna

I receive the following error:

✖ Installing business network. This may take a minute...
Error: PEM encoded certificate is required.
Command failed

Shouldn’t the certificate be in the card? Have anyone had the same issue?

Thanks in advance.


(Pankaj Cheema) #209

I don’t recommend this for production. If you have to show just POC then ok. I used docker Swarm for this https://www.linkedin.com/feed/update/urn:li:activity:6442713866232262656/?commentUrn=urn%3Ali%3Acomment%3A(activity%3A6442713866232262656%2C6443423483320991744)


(Niraj Dhiman) #212

I have changed orderer.example.com:7050 to my local IP address 192.168.5.199:7050 in startFabricPeer2.sh . But when i am executing this on 2nd machine it showing me errors as

docker exec -e “CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp” [peer2.org1.example.com](http://peer2.org1.example.com/) peer channel fetch config -o 192.168.5.199:7050 -c composerchannel
2018-09-17 13:58:18.608 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-09-17 13:58:18.608 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-09-17 13:58:18.610 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-09-17 13:58:18.610 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2018-09-17 13:58:18.610 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2018-09-17 13:58:18.611 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2018-09-17 13:58:18.611 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2018-09-17 13:58:18.611 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AC9060A1B08021A0608FAE5FEDC0522…94607C4A684C12080A020A0012020A00
2018-09-17 13:58:18.611 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 41C793427C7C30635AD44D9E308E395109E2D4630D49DA40D1F2C98BF1F441BD
2018-09-17 13:58:18.613 UTC [channelCmd] readBlock -> DEBU 00a Got status: &{NOT_FOUND}
Error: can’t read the block: &{NOT_FOUND}

Can you please help me in resolving this?


(Niraj Dhiman) #214

@varun

I have paste same network to 2nd machine and changed orderer.example.com:7050 to my local IP address 192.168.5.199:7050 in startFabric-Peer2.sh file . But when i am running this on 2nd machine it showing me errors as

docker exec -e “CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp” [peer2.org1.example.com](http://peer2.org1.example.com/) peer channel fetch config -o 192.168.5.199:7050 -c composerchannel
2018-09-17 13:58:18.608 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-09-17 13:58:18.608 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-09-17 13:58:18.610 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-09-17 13:58:18.610 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2018-09-17 13:58:18.610 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2018-09-17 13:58:18.611 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2018-09-17 13:58:18.611 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2018-09-17 13:58:18.611 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AC9060A1B08021A0608FAE5FEDC0522…94607C4A684C12080A020A0012020A00
2018-09-17 13:58:18.611 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 41C793427C7C30635AD44D9E308E395109E2D4630D49DA40D1F2C98BF1F441BD
2018-09-17 13:58:18.613 UTC [channelCmd] readBlock -> DEBU 00a Got status: &{NOT_FOUND}
Error: can’t read the block: &{NOT_FOUND}

I am totally unable to understand it where the issue is. Can you please help me in resolving this?


(Anil Sharma) #215

I was also facing this error Error: Error connecting due to rpc error: code = Unavailable desc = grpc: the connection is unavailable For resolving above error, I had changed orderer.example.com:7050 to my local IP address (192.168.5.199:7050) in startFabric-Peer2.sh file . But when i am running this on 2nd machine it again showing me errors as

docker exec -e “CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp” [peer2.org1.example.com](http://peer2.org1.example.com/) peer channel fetch config -o 192.168.5.199:7050 -c composerchannel 2018-09-17 13:58:18.608 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP 2018-09-17 13:58:18.608 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity 2018-09-17 13:58:18.610 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized 2018-09-17 13:58:18.610 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP 2018-09-17 13:58:18.610 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity 2018-09-17 13:58:18.611 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP 2018-09-17 13:58:18.611 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity 2018-09-17 13:58:18.611 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AC9060A1B08021A0608FAE5FEDC0522…94607C4A684C12080A020A0012020A00 2018-09-17 13:58:18.611 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 41C793427C7C30635AD44D9E308E395109E2D4630D49DA40D1F2C98BF1F441BD 2018-09-17 13:58:18.613 UTC [channelCmd] readBlock -> DEBU 00a Got status: &{NOT_FOUND} Error: can’t read the block: &{NOT_FOUND}

I am totally unable to understand it where the issue is and how to resolve it. Can anybody please help me to resolve this?


(Niraj Dhiman) #216

Then what would you recommend for production?


(Davidecurcio) #217

Hi, I tried to execute the startFabric-Peer2.sh in the second machine and I got this error:

Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded.

Now I didn’t understand how the second machine can connect itself to the first machine. Because the second machine knows only “orderer.example.com”, but I didn’t understand how the second machine can associate this address with the IP address of the first machine.


(Jon Lee) #218

The article does not mention how to discover ip between 2 machines. I’m much appreciated if you could edit it in the article as there are so many discussions talking about mapping of ips by different methods.

How about the case that if the request is sent from machine 2 to machine 1? Thank you.


(Shaik Sharuk) #219

Hi, Thanks for the step by step article, by following the above steps, I had successfully started fabric on both machines and when I tried to install and start the chain code , I am receiving the following error “:heavy_multiplication_x: Starting business network definition. This may take a minute…
Error: Error trying to start business network. Error: Failed to receive commit notification from 192.168.1.55:9051 for transaction ‘8c56bac90a9f6ef76a3f204df10bd17f4eba40cfc2bb12b5faeca9c95a1ae19d’ within the timeout period
Command failed” , pls help me to solve the issue.


(Renu) #220

hi am a developer…now am working on hyperledger fabric-fabcar…i have created web pages and tried to access it from localhost:3000 it is working fine.but when i try to access it from different host name it is not accepting…please help me with this issue…how can i accpet the fabric server from multiple machines without composer