Hello everyone, as you probably know the post promoter voting bot software had some issues recently dealing with the shutdown of the steemd.steemit.com node and the subsequent performance issues of the new api.steemit.com node (which also affected many other Steem related sites and services). These type of events are very important in the lifecycle of a software project because they highlight all of the issues which go unnoticed when everything is running smoothly.
I have been working quite some long hours both to update the code to make sure it handles these situations much more gracefully in the future and also to refund all bids that were missed from the bot during the outage. What doesn't kill you makes you stronger as the saying goes, and I feel that the software is much stronger now and ready to handle whatever the steem nodes want to throw at it!
Here are the specific changes that have been made in the past two days:
Removed "node_modules" folder and updated NPM package
If you've been following all of my updates you may recall that this is the first nodejs / npm project I have ever done, so there's a good bit of learning on my end regarding best practices. One such best practice is that the "node_modules" folder should be excluded from the git repository and all dependencies should be included in the NPM package (package.json file). These changes have now been made so if you're installing post promoter for the first time you can now do:
$ npm install
In the directory where you downloaded the project and all dependencies should be loaded automatically for you.
Price Feed Changes
Bots that accept both STEEM and SBD bids require a price feed to account for each type of currency correctly. Previously the post promoter software used a price feed URL that I set up and maintained myself and reloaded the prices every minute. This was unnecessary and caused significant issues for both the bot software and the Steem Bot Tracker website when my price feed went down.
Now the post promoter software loads the price feed directly from coinmarketcap.com and refreshes it once every 30 minutes. It also saves the last prices it loaded so if coinmarketcap.com goes down then it will continue to use the last prices it received and keep running without any issues.
Wait until previous vote goes through before sending next one
Previously the bot would send out a vote transaction, wait 5 seconds (3 second voting limit plus a little buffer) and then send out the next one. The problem with this approach is that if for whatever reason (such as nodes being slow, for example) the first vote transaction took say 4 seconds to go through, then the next vote would be sent only 1 second later and would then fail.
So now the software will wait until the previous vote transaction completes before scheduling the next one 5 seconds later. This way it is no longer possible for votes to be sent out within 3 seconds of each other, even if the nodes are running slowly, which will greatly reduce the possibility of missed votes in situations like we saw over the last couple of days.
Added RPC node setting to config.json
Perhaps most important of all, there is now an option to specify what RPC node to connect to in the config.json file. If api.steemit.com is having problems, you can now easily switch to say rpc.buildteam.io (props to for running that great node) or any other node that you like for that matter. You can set the RPC node to use in config.json as shown below, and if none is set then api.steemit.com will be used by default:
"rpc_node": "https://api.steemit.com"
In the future I plan to add the ability to specify a list of nodes and have the software fail over to the next node on the list if the current node is having issues, but that change is much more involved and I haven't gotten to that one yet. It would be great if the Steem JS library supported this since I feel that that's really where this belongs, but for now it doesn't so we will have to make due.
If anyone reading this has the ability to make that change to Steem JS and get it merged into the main repo I will do what I can to make sure you're adequately compensated for it!
Additional / updated error logging
Last, but not least, the error logging has been significantly updated and improved to make it much easier to figure out what is going on when and if errors do arise.
Thanks for your support!
As always I want to thank everyone who has helped and supported me in creating this software. I love that it has been able to help so many people get their content promoted and to help so many investors earn a return on their STEEM investment. Please stay tuned for more updates in the coming weeks!
Links to relevant commits:
- Removing node_modules and updated package.json
- Load prices every 30 minutes and added more error logging
- Wait until previous vote completed before sending next one
- Allow setting RPC node to use in config.json
Posted on Utopian.io - Rewarding Open Source Contributors