Hyperledger: Not able to connect from docker container to validator. curl http://rest-api:8008/blocks

0 votes

I am trying to execute the command:

curl http://rest-api:8008/blocks 

to test the connectivity of Validator from Client Container. I get this error: 

could not resolve host rest-api
Nov 2, 2018 in Blockchain by digger
• 26,550 points
119 views

1 answer to this question.

0 votes

The REST API service is exposed on port 8008 on the rest-api container, and also forwarded to port 8008 on the host:

rest-api:
  image: sawtooth-rest-api:latest
  container_name: sawtooth-rest-api-default
  expose:
    - 8008
  ports:
    - "8008:8008"
  depends_on:
    - validator
  entrypoint: sawtooth-rest-api --connect tcp://validator:4004 --bind rest-api:8008

The service should therefore be accessible from another Docker container as http://rest-api:8008/blocks or from the host as http://127.0.0.1:8008/blocks via a web browser or curl. If it does not work, try changing the entrypoint command to use --bind 0.0.0.0:8008 as the last argument.

answered Nov 2, 2018 by Omkar
• 67,660 points

Related Questions In Blockchain

0 votes
1 answer

Hyperledger Fabric: Not able to install docker

Clean up the invalid package repository: cd ../../etc/apt/sources.list.d sudo ...READ MORE

answered Nov 2, 2018 in Blockchain by Omkar
• 67,660 points
106 views
0 votes
1 answer

Hyperledger composer: Not able to issue identities from a Business network.

To specify your own affiliation you need ...READ MORE

answered Nov 6, 2018 in Blockchain by Omkar
• 67,660 points
286 views
0 votes
1 answer

Not Able to register a user with Hyperledger-Fabric v1.1 preview

The error: "Certificate not found with AKI 'e729224e8b3f31784c8a93c5b8ef6f4c1c91d9e6e577c45c33163609fe40011' ...READ MORE

answered Jun 16, 2018 in Blockchain by charlie_brown
• 7,720 points
435 views
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
81 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
169 views
0 votes
2 answers

Not able to POST chaincode to hyperledger-fabric using API

TypeError: Cannot read property 'curve' of undefined     at ...READ MORE

answered Jan 30 in Blockchain by SHRADDHA
101 views
0 votes
1 answer

Docker: How to connect Node.js in container to Hyperledger Fabric?

You need to map ~/.composer/cards of your Docker host ...READ MORE

answered Oct 31, 2018 in Blockchain by Omkar
• 67,660 points
108 views