hyperledger-archives / education-sawtooth-simple-supply

https://wiki.hyperledger.org/display/LMDWG
Apache License 2.0
51 stars 61 forks source link

Error while Confirming Connectivity to the REST API (for Docker) curl http://localhost:8008/blocks #45

Closed M-Zeeshan-Haider closed 4 years ago

M-Zeeshan-Haider commented 4 years ago

I am trying to set up Hyperledger sawtooth testing node, so I followed this link: setting up a sawtooth testing node with Docker I have started node by using this command: docker-compose -f sawtooth-default.yaml up and it running. https://imgur.com/a/wx7oke5 Screenshot from 2020-09-02 17-10-48

To confirm that the REST API and validator are running and reachable from the client container, I run this curl command: curl http://rest-api-0:8008/blocks and it works fineview output Screenshot from 2020-09-02 17-12-56 but in the second step I need to check connectivity from the host computer, from a new terminal window on my host system I run this curl command: curl http://localhost:8008/blocksand it gives this error [view error](https://imgur.com/r5dWPA5) ![Screenshot from 2020-09-02 17-13-06](https://user-images.githubusercontent.com/36418814/91965749-83ea8d00-ed43-11ea-8fc9-63eec200e268.png) : curl:(7) Failed to connect to localhost port 8008: connection refused.`

I am using the ubuntu 20.04 system, I have found some solution link, but that was on the AWS server which quoted this "On AWS doing a curl http://localhost:8008/blocks gives me an error message. I resolved the issue by changing the docker container ‘hosts’ file, use AWS ec2 private IP instead.

cd /etc
echo AWS PRIVATE IP ADDRESS localhost > hosts
root@99a2e75d41f6:/etc# echo 10.0.1.224 localhost > hosts
root@99a2e75d41f6:/etc# cat hosts
10.0.1.224 localhost

Please help me to resolve the issue.