Accessing External Api in HyperLedger Fabric

0 votes

I am trying to access the following Api via hyperLedger Fabric chaincode :http://api.open-notify.org/astros.json.However I come up with following error

panic: Get http://api.open-notify.org/astros.json: proxyconnect tcp: dial tcp: i/o timeout

I have tried multiple ways to resolve proxy but it always times out.

Can anybody suggest a fix ?

Nov 17, 2018 in Blockchain by Perry
• 17,100 points
1,666 views

1 answer to this question.

0 votes

Generally you are not supposed to call external APIs from within hyperledger as doing so can lead to conflicts between the peer nodes. Assuming every peer needs to perform the request the number of requests exponential increase with the number of nodes involved in your system.

There is how the documentation says external requests should be performed.That being said the documentation on external requests has not been updated for current hyperledger version as far as I can tell. https://hyperledger.github.io/composer/v0.19/integrating/call-out

Consensus considerations when accessing external APIs are noted over here https://hyperledger.github.io/composer/v0.19/integrating/call-out#consensus-considerations

The workaround I have been using is to set up a second docker container which is not running hyperledger to perform api requests on port 3001, collate the results, then send them over to Hyperledger set up with the REST service on port 3000.

answered Nov 17, 2018 by Christine
• 15,790 points

Related Questions In Blockchain

+1 vote
2 answers

Challenge while setting up Hyperledger Fabric 1.0 in Ubuntu 16.04

The rocksdb error you're seeing wouldn't be ...READ MORE

answered Mar 27, 2018 in Blockchain by ned_crew
• 1,610 points

edited Jun 8, 2020 by Sirajul 1,135 views
+1 vote
1 answer
+15 votes
5 answers
+16 votes
4 answers
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,425 views
+4 votes
2 answers

How do I create a new block in Hyperledger Fabric?

This link might help you: https://github.com/hyperledger/fabric-sample ...READ MORE

answered Oct 11, 2018 in Blockchain by Sahu
2,616 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP