Asynchronous request on blockchain

in #utopian-io7 years ago (edited)

Hi everyone!

I’m currently developing a website using Express.js to list challenges we can find on steemit. I was facing a bug when I was requesting the blockchain.

My error was a timeout every time I was trying to request the blockchain for the second time. The first request was always working but the second one always gave me this « Timeout Error » and I had to restart my server every time to be able to request again the blockchain.

I tried everything and I finally found my answer thanks to @codingdefined.

Here is the link to @codingdefined ’s post where i found the solution

As @codingdefined explain in his post, we need to use another URL to request the blockchain with asynchronous functions.

Here are the commands to change the URL you will use :

// Steem var
const steem = require('steem');
steem.api.setOptions({url: 'https://api.steemit.com'});

Using that helped me to get rid of the timeout error.

Hope that’s gonna help you guys.

@cedric-g



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it is not as informative as other contributions. See the Utopian Rules. Contributions need to be informative and descriptive in order to help readers and developers understand them.

You can contact us on Discord.
[utopian-moderator]

Congratulations @cedric-g! You received a personal award!

1 Year on Steemit

Click here to view your Board of Honor

Do not miss the last post from @steemitboard:

Saint Nicholas challenge for good boys and girls

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @cedric-g! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.22
TRX 0.24
JST 0.038
BTC 94692.02
ETH 3236.92
USDT 1.00
SBD 3.29