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


(Varun Raj) #156

I think the peers should have stopped or crash. Just make sure if its running properly with

docker ps

(Saeedi) #157

On my first machine i have four containers running as i only used one peer on that machine

CONTAINER ID        IMAGE                                     COMMAND                  CREATED             STATUS              PORTS                                            NAMES
e4bf8b344a6c        hyperledger/fabric-peer:x86_64-1.1.0      "peer node start --p…"   9 minutes ago       Up 9 minutes        0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp   peer0.org1.example.com
5cd59b59d8b9        hyperledger/fabric-ca:x86_64-1.1.0        "sh -c 'fabric-ca-se…"   9 minutes ago       Up 9 minutes        0.0.0.0:7054->7054/tcp                           ca.org1.example.com
52b69b96e30f        hyperledger/fabric-orderer:x86_64-1.1.0   "orderer"                9 minutes ago       Up 9 minutes        0.0.0.0:7050->7050/tcp                           orderer.example.com
59330c76d7fe        hyperledger/fabric-couchdb:x86_64-0.4.6   "tini -- /docker-ent…"   9 minutes ago       Up 9 minutes        4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp       couchdb

And on second machine there are two containers running.
    bd199c33b7ba        hyperledger/fabric-peer:x86_64-1.1.0      "peer node start --p…"   11 minutes ago      Up 11 minutes       0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp   peer1.org1.example.com
    cce1d5d4346f        hyperledger/fabric-couchdb:x86_64-0.4.6   "tini -- /docker-ent…"   11 minutes ago      Up 11 minutes       4369/tcp, 9100/tcp, 0.0.0.0:6984->5984/tcp       couchdb1

(Paresh Varde) #158

@varun Both Peer2 and Peer3 have joined the channel. Is there any command to verify that they have actually joined? Thanks for your resposne

here is the commands on machine 1 (Peer0 and Peer1). Had to add space before “com” because post was not accepting to as links.

Create the channel

docker exec peer0.org1.example. com peer channel create -o orderer.example. com:7050 -c composerchannel -f /etc/hyperledger/configtx/composer-channel.tx

Join peer0.org1.example. com to the channel.

docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example. com peer channel join -b composerchannel.block

Create the channel

docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer1.org1.example. com peer channel fetch config -o orderer.example. com:7050 -c composerchannel

Join peer1.org1.example. com to the channel.

docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer1.org1.example. com peer channel join -b composerchannel_config.block

(Saeedi) #159

I restarted and it worked. But now I am trying to import a card in 2nd machine that i exported from 1st machine but when i execute composer card import -f jdoe.card

It produces following error.

Error: Unable to read card file: /home/saeedi/jdoe.card
Command failed

#160

the newest version of composer requires a different format for the peer admin card so either downgrade composer or update createPeerAdminCard.sh to reflect the new changes like in this file /createPeerAdminCard.sh

[createPeerAdminCard-hlv11](https://github.com/hyperledger/composer-tools/blob/master/packages/fabric-dev-servers/fabric-scripts/hlfv11/createPeerAdminCard.sh)

(zia) #161

Hi All,

When i try to start bna i am receiving the below error

✖ 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: 2 UNKNOWN: chaincode error (status: 500, message: Unknown chaincodeType: NODE)
Command failed

I have only 1 peer endorsing and remaining 2 peers set as false in connection.json.

Peer logs shows this error not sure how to proceed further i have tried restarting and removing all docker images and everything. Please help

2018-05-15 20:33:21.654 UTC [endorser] ProcessProposal -> ERRO 3ba simulateProposal() resulted in chaincode response status 500 for txid: 2baa7dfde5fd46dd53949ea557058269fb438db62ab2e753023a2d5a7a4dee65

(vinod) #162

Thank you very much @InflatibleYoshi , Now i am able to create my network card.

Then After i am trying to executing ./startFabric-Peer2.sh in machine 2 it showing below error.

**DEBU 003 grpc: addrConn . resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup orderer. example. com on 127.0.0.11:53: no such host"; Reconnecting to {orderer. example. com:7050 <nil>}**
**Error: Error connecting due to  rpc error: code = Unavailable desc = grpc: the connection is unavailable**

Also i tried to change orderer address to localhost ip address then also it is not working.

any idea of this could please help me on this?

Thanks,
Vinod.


(Paresh Varde) #163

Please use IP address of your orderer machine. Or you can update your host config to mapping this domain to an IP address of your orderer.


(vinod) #164

Hi @Paresh_Varde

Can you please help me how to update host config to mapping this domain to an IP address of your orderer.

Thanks,
Vinod.


(Paresh Varde) #165

@varun still waiting for your help.


(Paresh Varde) #166

you do not need to buy domain. I believe step #3 only should help

If this do not help modify your configtx.yaml on main system to have an IP address instead of orderer.example.com. Regenerate crypto (copy to other system as well) Change your createPeerAdminCard.sh connection.json generator code to have an IP address. This is how I have my network setup.


(vinod) #167

Thank you @Paresh_Varde i am working on this


(vinod) #168

Hi @Paresh_Varde,

After adding the machine1 ip address instead of orderer.example.com  in machine2 i am getting below error:
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer2.org1.example.com peer channel fetch config -o 192.168.1.38:7050 -c composerchannel
2018-05-16 09:07:52.553 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-05-16 09:07:52.553 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-05-16 09:08:12.554 UTC [grpc] Printf -> DEBU 003 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 192.168.1.38:7050: i/o timeout"; Reconnecting to {192.168.1.38:7050 <nil>}
Error: Error connecting due to  rpc error: code = Unavailable desc = grpc: the connection is unavailable

Thanks,
Vinod.


(Paresh Varde) #169

did you change orderer address in configtx.yaml? If yes you need to regenerate cypto, genesis blocks and copy them into machine 2 as well. That should fix it.


(vinod) #170

Thank You Paresh it is working fine, now i am trying to deploying bna files


(Paresh Varde) #171

great @vinod. Please update me how your BNA install goes. I am stuck at that place. I did not find any issues while network deploy and network start. However I see database only one Peer0 and rest of the peers (peer1 and peer2) do not have the required database. I believe doing network deploy should update all the peers.


(Paresh Varde) #172

any update? @varun please let me know your bna deployment goes


(Varun Raj) #173

You can use peer channel list for listing the channels that the peers have joined.


(Varun Raj) #174

This is just the fabric part. I believe you can use the same multi org article from composer docs to handle BNA deployment part.

https://hyperledger.github.io/composer/v0.16/tutorials/deploy-to-fabric-multi-org


(vinod) #175

@Paresh_Varde
I am installing network card in following command getting some error, please find the below details.

**vinod@vinod-VirtualBox:~/BlockChainPoc/trealth$ composer network install --card PeerAdmin@hlfv1 --archiveFile tutorial-network@0.0.1.bna**
**✔ Installing business network. This may take a minute...**
**Successfully installed business network tutorial-network, version 0.0.1**

**Command succeeded**

**vinod@vinod-VirtualBox:~/BlockChainPoc/trealth$ composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card**
**Starting business network tutorial-network at version 0.0.1**

**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: 2 UNKNOWN: chaincode error (status: 500, message: Unknown chaincodeType: NODE)**
**Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: Unknown chaincodeType: NODE)**
**Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: Unknown chaincodeType: NODE)**
**Command failed**