Introduction
For the last couple of weeks, I've been posting a lot less frequently - that's mostly thanks to a pet project I've undertaken - a working bid bot!
In this post I plan to detail all the features I've built in and also give you a few pointers to it's operation.
Firstly, what is a bid bot?
If you don't already know what a bid bot is, take a trip to https://steembottracker.com/ and you'll have a pretty good idea. Every 2.4 hours, a bot shares its 100% upvote between users who have placed a bid for a share of that vote.
Well, people have already created bid bots, why is this code relevant?
Yes, there are already bots in existence, some of them are huge. But a lot of that code is closed source, it would be bad business practice to share it.
One bot owner, @therising made a post sharing their code which I thought was very generous...
However I like to do stuff from the ground up so I can have an intimate understanding of the code. I also noticed his code didn't have some features I was after and was difficult to read.
My bot, @steemroasted, is now finished, unfortunately I'm not able to get it onto Steem Bot Tracker because:
- It has too little steem power.
- I live in student accommodation and we're not allowed static IP addresses.
Feel free to send it a bid though, it still works.
Features
- Auto-payout to delegators every 24 hours
- Choose payout percentage
- Blacklist delegators to prevent refund loops with other bots
- Choose minimum delegation ammount
- Keeps earnings in an external file
- Steem Bot Tracker API compatability
- Automatic refunds
- Memo explaining why bid was invalid
- Age
- Already voted
- Already bid
- Invalid URL
- Bid too small
- Memo explaining why bid was invalid
- Comment upvoting
- Can deal with blockstream downtime (still needs a little work)
- Updates JSON metadata to let people know bot is down
- Keeps a log of downtime
- Accepts SBD and STEEM
- Payouts to delegators in both
- Converts both to USD at payout using Coin Market Cap for optimal accuracy
Use
Running this script requires a few other things.
Python anaconda
To make this I've been using Anaconda for Python and the Spyder IDE. I strongly recommend it if you're on windows as I had problems with the scrypt library on base python. Here's a great guide.
Additional Packages
Hosting
You only need this bit if you plan on putting your bot on steem bot tracker.
WAMP
My script saves the data file to c:/wamp64/www/
WAMP is an Apache server for windows and allows you to host files on your PC by making it into a server. Out of the box, it's only designed for local networks so you'll need to do some tinkering.
Of course, this is for windows users on home PCs, if you have a better option I urge you to go for it.
- Set yourself a static IP (I can't do this thanks to my ISP so unfortunately haven't been able to test past this point).
- Open port 443 on your PC (since steem bot tracker requires https, not http).
- You'll also need to mess around with the settings files (there's loads of tutorials online) so Apache knows to use https/SSL port 443 instead of http port 80.
- Change some more settings so Apache accepts connections from external machines.
- Get an SSL certificate for your IP/domain name. Using openSSL won't work as a self signed certificate is considered unsafe. Hosting your own webside becomes a huge advantage here as you likeley already have SSL certificates and a domain name.
- Buy a domain and bind it to your IP.
Alternatively
Online code hosting services
https://www.heroku.com/ lets you run python scripts on their site. However their services are more geared towards web hosting and dJango applications - I'm also not sure how file storage works on there and users have said applications hosted on there have a habit of going to sleep which would be unacceptable for a real-time script like this.
https://www.pythonanywhere.com/ is also a possible choice, they do have limited hardware usage for free. You can only make so many requests or use so many process cycles per second - not great for a script running two threads at a time. I also tried installing steem python on their bash console and got errors, I tried the custom Scrypt fork from the Anaconda tutorial but it seems to be only for windows.
Maybe there's a way around this but I don't know of it yet.
Customisation
Posted on Utopian.io - Rewarding Open Source Contributors
I have been looking into the code for therising and postpromoter lately but haven't been able to crack it all, as I just do programming as a hobby kind of thing. I more familar with python than javascrip and I think I will fork your code and see what I can do with it.
If say I am working on ubuntu can you list all the bundle and stuff I need to install or import because I feel like I leave some out and that is why I never get the rising code to work for me
It shouldn't be too different working on ubuntu, you just use:
pip install <package name>
For every package in the 'Additional Packages' section of the post, the rest of the packages are all built in :)
But, it is my understanding that the scrypt library I linked is windows only and the one on PyPi is broken too so if the wheel I've linked doesn't work, you might have to find someone else's custom fork and use that.
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thanks man, it means a lot to me :)
Hey @sisygoboom I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Thanks @sisygoboom so much for your contribution. I've been using and studying bots for a while and this really helps. Looking forward to reading thru the code.
Glad I could be of help, I know how hard it was for me working out all this stuff by just reading through the documentation and random, often outdated, posts. So hopefully people can use this to learn some handy techniques that are working for now :)
very interesting technology :)
Cheers dude, I'll be coding to the sound of your edm from now on ;)
Hello sisygoboom, I am a scheduling service for randowhale. Read more at my guide post.
You recieved a 100.0% upvote from @sisygoboom - your post is on fire!
Consider delegating to us and recieve 100% of the earnings! (We're happy just recieving curation)
Congratulations! This post has been upvoted from the communal account, @minnowsupport, by sisygoboom from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.
If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.
Your Post Has Been Featured on @Resteemable!
Feature any Steemit post using resteemit.com!
How It Works:
1. Take Any Steemit URL
2. Erase
https://
3. Type
re
Get Featured Instantly & Featured Posts are voted every 2.4hrs
Join the Curation Team Here | Vote Resteemable for Witness
Your contribution was on the wrong category (blog posts). I have moved it to development. Please, make sure you post the correct category next time.
Sorry, I figured with it being an intro and a tutorial, it would be best placed in blog. Thanks for the help!
Usually we also like to avoid having unrelated content/banners in the contributions, so please consider to remove the banners at the bottom.
All done.