HyperledgerHandsOn / trade-finance-logistics

Trade Finance and Logistics based on Letter of Credit and Proof of Shipment
Apache License 2.0
178 stars 1.5k forks source link

Issue while running network in dev mode #53

Closed abhaypsoni closed 4 years ago

abhaypsoni commented 5 years ago

Hello Experts,

I am referring to the book "Hands-On Blockchain with Hyperledger" (By Nitin Gaur, Salman Baset etc) to create a sample trade finance logistic network as given in the ebook.

I am able to run the below commands and start the network

./trade.sh up

docker ps -a will list below containers

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4e636f0054fc hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp peer0.carrierorg.trade.com 28c18b76dbe8 hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer0.importerorg.trade.com 9308ad203362 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se..." 3 minutes ago Up 3 minutes 0.0.0.0:7054->7054/tcp ca_peerExporterOrg 754018a3875e hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se..." 3 minutes ago Up 3 minutes 0.0.0.0:8054->7054/tcp ca_peerImporterOrg 09a45eca60d5 hyperledger/fabric-orderer:latest "orderer" 3 minutes ago Up 3 minutes 0.0.0.0:7050->7050/tcp orderer.trade.com f86e50e6fc76 hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.exporterorg.trade.com 986c478a522a hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se..." 3 minutes ago Up 3 minutes 0.0.0.0:9054->7054/tcp ca_peerCarrierOrg 66f90036956a hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp peer0.regulatororg.trade.com a6478cd2ba6f hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se..." 3 minutes ago Up 3 minutes 0.0.0.0:10054->7054/tcp ca_peerRegulatorOrg

But when I run it in Dev network I am not getting any list of containers.

$ ./trade.sh up -d true

docker ps -a will return an empty list

Even I also run clean command (./trade.sh clean -d true) but still, no container created. Please let me know where is the issue.

abhaypsoni commented 5 years ago

Its a blocker for me. Request all to help me on this. Even I raised this in below link 3 months back, but no help. https://lists.hyperledger.org/g/fabric/topic/issue_while_running_network/27566382?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,120,27566382

VRamakrishna commented 5 years ago

I don't really keep an eye on the Hyperledger list, so putting a query here is more likely to get my attention.

Just curious, do you have any experience with docker, or containerization? FYI, you'll need to know at least the basics of creating, running, and stopping, docker containers to effectively use this material.

You did not say exactly what sequence of steps you followed. Did you clean up all the running containers and volumes from the first ./trade.sh command before you ran the second one? Did you create the artifacts for the dev network before you ran the up command (i.e., ./trade.sh generate -c tradechannel -d true)?

abhaypsoni commented 5 years ago

Thanks Rama for reply. Yes I followed all the steps. Yes i cleaned all the containers. Request you to look into the snapshot link here. Let me know what i am missing. https://github.com/abhaypsoni/repository/blob/master/Steps.docx

VRamakrishna commented 5 years ago

It looks like you are using the latest release of Fabric (1.4). The code and instructions in the book were created for the release-1.1 branch, so you'll need to clone that branch of Fabric and Fabric-CA, build the tools and images, and then run this application.

The initial print of the book did not state this version requirement clearly. But we soon noticed the omission and added the constraint in the errata page on the Pack website as well as on the README here (it's the first thing you'll see.)

Every new iteration of Fabric produces some incompatibilities (usually minor, but ones that prevent an application from running without slight modifications.) We did port to 1.2 (this repo has a release-1.2 branch), but not to 1.4 yet (we have day jobs that keep us busy, so we maintain this project on a best effort basis.)

abhaypsoni commented 5 years ago

Thank you Rama for response. I checked the version, I am using Fabric 1.3. May be that is the issue. I will downgrade to Fabric 1.2 and use the Trade-Finance release 1.2 and will again check it. Hopefully it should work. I will use the below link code https://github.com/HyperledgerHandsOn/trade-finance-logistics/tree/release-1.2

VRamakrishna commented 5 years ago

I got a comment from you in my email, but it seems to be missing here. Did you delete it?

Check out the network log to see why the containers aren't starting up. By default they should be in network/logs/network.log.

abhaypsoni commented 5 years ago

Yes Rama, I deleted it. Actually container creation took few minutes in dev mode after running the dev mode startup. Finally container got created after waiting for a minute and i am able to install and invoke chaincode. Till now no issues. Thanks for your help.

Kpadia05 commented 4 years ago

Yes Rama, I deleted it. Actually container creation took few minutes in dev mode after running the dev mode startup. Finally container got created after waiting for a minute and i am able to install and invoke chaincode. Till now no issues. Thanks for your help.

Hi, I am having an error in building and running the chain code in the command "CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=tw:0 ./trade_workflow_v1" The error is as shown in the snapshot. Can you please help me with this? chaincode_error

VRamakrishna commented 4 years ago

Peer container doesn't seem to be running. Please clean up your environment (use down and clean with trade.sh) and retry. If you follow the instructions and you are using the right versions of Fabric and Fabric-CA, you should get the applications up and running.

Kpadia05 commented 4 years ago

Thank You So Much :)

On Mon, 24 Feb 2020 at 01:31, VRamakrishna notifications@github.com wrote:

Peer container doesn't seem to be running. Please clean up your environment (use down and clean with trade.sh) and retry. If you follow the instructions and you are using the right versions of Fabric and Fabric-CA, you should get the applications up and running.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HyperledgerHandsOn/trade-finance-logistics/issues/53?email_source=notifications&email_token=AHLOSACWG4N2W36ENUDFJQTRELI2RA5CNFSM4GWWV7R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMWFYCA#issuecomment-590109704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLOSAEGRJXT6HN7EOJRQDLRELI2RANCNFSM4GWWV7RQ .

-- Regards, Karnika Padia

Kpadia05 commented 4 years ago

Peer container doesn't seem to be running. Please clean up your environment (use down and clean with trade.sh) and retry. If you follow the instructions and you are using the right versions of Fabric and Fabric-CA, you should get the applications up and running.

I tried executing the ./trade.sh down and ./trade.sh clean commands. I am getting some warnings here and it seems as the required task isn't working out. I had also installed everything as guided. The snapshot is attached below. warning

VRamakrishna commented 4 years ago

No, there's nothing wrong. You can ignore the warning.

Kpadia05 commented 4 years ago

Okay. But I'm still getting the same error of context deadline exceeding. What can be the reason, and how can I resolve it?

On Tue, Feb 25, 2020, 00:22 VRamakrishna notifications@github.com wrote:

No, there's nothing wrong. You can ignore the warning.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HyperledgerHandsOn/trade-finance-logistics/issues/53?email_source=notifications&email_token=AHLOSAHWGLW5V2YHCSUVJRLREQJNRA5CNFSM4GWWV7R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMZCUYA#issuecomment-590490208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLOSADEPZAK5OB4DR6PYFDREQJNRANCNFSM4GWWV7RQ .

VRamakrishna commented 4 years ago

You'll need to look at the container logs. If the peer container crashed, run docker logs <peer-container-ID> to see why.