Dr. Otto: Vote Bidding Bot

in #radiator7 years ago

drotto

Dr. Otto is a voting bot that accepts payments for votes.




The default is that Dr. Otto will only vote in 10 batches a day. Multiple users can bid in a voting batch. If only one person bids, they get the entire upvote. If two people bid an equal amount, they share the vote 50/50. The higher the bid, the higher percentage for the upcoming vote batch.

The bot operator can set any vote weight for the batch, which will affect the number of daily votes to bid on. Therefore, each day per batch has:

VotesPercentageTimeframeBlocks
10100 %every 2.4 hours2,880
2050 %every 1.2 hours1,440
4025 %every 36 minutes720
8012.5 %every 18 minutes360
1606.25 %every 9 minutes180
3203.13 %every 270 seconds90

Example A

If you set the bot to vote at 100.00%, bids open every 2.4 hours. Alice and Bob both bid for in the same voting batch. If Alice bids 4 SBD and Bob bids 2 SBD, Alice will get a 66.66% upvote and Bob will get a 33.33% upvote.

Example B

If you set the bot to vote at 3.13%, bids open every 270 seconds. Alice and Bob both bid for in the same voting batch. If Alice bids 4 SBD and Bob bids 2 SBD, Alice will get a 2.09% upvote and Bob will get a 1.04% upvote.

Usage Rules:

  1. If there are multiple bids with the same post, only one vote will be cast and the remaining bids will not be returned.
  2. If the bot has already voted for a post, additional bids will not be returned.
  3. The URL must be correctly expressed in the memo alone. Malformed memos will not be returned.

Install

To use this Radiator bot:

Linux
$ sudo apt-get update
$ sudo apt-get install ruby-full git openssl libssl1.0.0 libssl-dev
$ sudo apt-get upgrade
$ gem install bundler
macOS
$ gem install bundler

I've tested it on various versions of ruby. The oldest one I got it to work was:

ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-darwin14.4.0]

First, clone this git and install the dependencies:

$ git clone https://github.com/inertia186/drotto.git
$ cd drotto
$ bundle install
Configure

Edit the config.yml file.

:drotto:
  :block_mode: irreversible
  :account_name: <voting account name here>
  :posting_wif: <posting wif here>
  :active_wif: <active wif here>
  :batch_vote_weight: 100.00 %
  :minimum_bid: 2.000 SBD

:chain_options:
  :chain: steem
  :url: https://steemd.steemit.com

Edit the support/confirm.md template, used to reply to the post when voting.

This ${content_type} has received a ${vote_weight_percent} % ${vote_type} from @${account_name} thanks to @${from}.
Run Mode

Then run it:

$ rake run

Dr. Otto will now do it's thing. Check here to see an updated version of this bot:

https://github.com/inertia186/drotto

Bounce Mode

Dr. Otto is designed to only vote in such a way that it will never run out of voting power. Ideally, you should never need to shut down for breaks in order to recharge. However, if it's ever time for Dr. Otto to take a break for some other reason, bounce will return transfers to accounts instead of voting.

For your own safety, it is recommended that you transfer your funds out of your wallet before running this mode.

Dr. Otto will now return the funds as they arrive in the wallet. You can also just use bounce_once to have Dr. Otto make a single pass rather than loop forever until signaled (^C).

$ rake bounce_once

Both bounce modes accept a limit value as argument, which is especially useful for bounce_once. The default limit is to go back 200 transactions in the history. You can set up to 10000, if you need to go back further for some reason.

$ rake bounce_once[10000]
Report Mode

Same as bounce_once but only for reporting without doing the transfers.

$ rake report

Also accepts a limit argument.

$ rake report[10000]

Upgrade

Typically, you can upgrade to the latest version by this command, from the original directory you cloned into:

$ git pull

Usually, this works fine as long as you haven't modified anything. If you get an error, try this:

$ git stash --all
$ git pull --rebase
$ git stash pop

If you're still having problems, I suggest starting a new clone.


Troubleshooting

Problem: Everything looks ok, but every time Dr. Otto tries to vote, I get this error:
Unable to vote with <account>.  Invalid version
Solution: You're trying to vote with an invalid key.

Make sure the .yml file contains the correct voting key and account name (social is just for testing).

Problem: The node I'm using is down.

Is there a list of nodes?

Solution: Yes, special thanks to @ripplerm.

https://ripplerm.github.io/steem-servers/


Tests

  • Clone the client repository into a directory of your choice:
    • git clone https://github.com/inertia186/drotto.git
  • Navigate into the new folder
    • cd drotto
  • Basic tests can be invoked as follows:
    • rake
  • To run tests with parallelization and local code coverage:
    • HELL_ENABLED=true rake

Get in touch!

If you're using Dr. Otto, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on STEEM and Discord.

License

I don't believe in intellectual "property". If you do, consider Dr. Otto as licensed under a Creative Commons CC0 License.

Sort:  

This is amazing. Thank you so much @inertia! I think you are the best developer on steemit and a genuine great @SteemSpeak guy. I am thrilled to start working with this script later tonight when I get powered up.

I second that! @inertia is an Honorable and well respected developer who have delivered a long list of extremely useful tools for the community. An amazing person and a trustworthy person of high intelligence. Great product again Sir. Radiator, Made in the U.S.A! This is absolutely amazing!

I got enthusiasm in my heart, question marks on my brain? but surey I am appreciating. Could you please elaborate this below point

Usage Rules:
If there are multiple bids with the same post, only one vote will be cast and the remaining bids will not be returned

Question: So is it mean that we won't get back our STEEMs in this scenario?

Absolutely amazing no dought!

@fyrstikken If you approve I approve :) I see him in the chat all the time. He is definitely an great asset to steemit and his intelligence speaks for it self through his work and passion here. Take care and have a great weekend

Thanks very good post !!!!

Awesome Work!

Keep it up!!!

@cryptoinvestinfo

your CryptoInvestmentExpert

Hello, sorry for enter here to ask, but i saw that you know more about it theme, i like to program but i can't understand very well how or where this work could be made, could you give me a recomendation about where i can start to learn?, thanks for your help

Can you set the minimum bid below 2 SBD?

Yes, you can set it to 0.001. It should work for STEEM as well. But to accept both at the same time, you should run two instances. I haven't tested that yet, though.

Right now, I recommend only accepting SBD.

Great coding! Keep the hard work up!

And thanks for making Steemit grow :D

now is this the new steemit, bots voting for people?

This is my take on implementing a @randowhale bot.

is this @randowhale really gonna be worth it? I mean it just looks to me like a an opportunity for uncreative people seeking to just make some sleazy dollars..., this trend will make many not mind if there articles are worth an upvote... Just my thought though

A a minnow who spends a great deal of time and effort on my posts, I appreciate the opportunity to trade 2 SBD for an upvote worth more than that. I think the best I ever came out was a 6 SBD profit.

I don't see how it's any more incentive to shitty posting than the ability of someone to throw money at Steem and buy weight on the platform. At least randowhale is accessible to those of us who don't have thousands of dollars to go that route.

yeah, what a bad idea, i hope people wont follow this or steemit will lose many of its interesting aspect. IF you can pay to have upvote, so you can post something with zero contents and get money out of it

Well, the top comment has itself made $180 w/ only 5 votes sooooo if that's not a good indicator of the caliber of user this bot is ACTUALLY designed to benefit then idk what does.

Someone who alreadys has a lot SP....

I'm testing here, but I'm having a error, '
"Voting for eliel/mylink with a coefficnent of NaN."
rake aborted!
FloatDomainError: NaN
'

I just made some fixes. Do: git pull to try it.

I pointed a copy of drotto at that account. I think it will work if you upgrade:

{ :INF => "Looking for new bids starting at block 13290913 and (current time: 2017-07-01 04:22:39 UTC) ..." }
{ :INF => "Last block in this timeframe is: 13292353 (1440 blocks)." }
{ :INF => "Bid from eliel for 0.001 SBD." }
{ :INF => "Bid from eliel for 0.001 SBD." }
{ :INF => "Bid from eliel for 0.001 SBD." }
{ :INF => "Bid from eliel for 0.005 SBD." }
{ :INF => "Bid from eliel for 0.001 SBD." }
{ :INF => "Bid from eliel for 0.001 SBD." }
{ :INF => "Bids collected.  Ready to vote.  Processing bids: 6" }
{ :DBG => "Total: 0.010000000000000002; amount: 0.008" }
{ :DBG => "Voting for eliel/meet-the-new-project-of-elon-musk-neuralink with a coefficnent of 0.7999999999999998." }
{ :DBG => "Total: 0.010000000000000002; amount: 0.002" }
{ :INF => "Bidding closed for current timeframe at block 13292353, took 274 seconds to run." }
{ :DBG => "Voting for eliel/do-not-be-afraid-of-new-technology-they-will-help-humanity with a coefficnent of 0.19999999999999996." }
{ :ERR => "Failed vote: Check posting key." }
{ :ERR => "Failed vote: Check posting key." }

Ignore the final two error lines. That's just because I don't actually have the keys to vote. My guess is that the amounts were too small for the previous version to handle. Get on the latest version and you should be good to go.

Thank you, now it worked.

@inertia where i put all these commands kindly can you guide from 1st step as a nursery student

Very interesting idea. I might actually try this!

For sure my question will appear really idiot for some steemians here, but I need to ask :D : how do I use this bot on Windows please? Because I see the code for linux and Mac OS but not for windows huhu.

This post received a 3.1% upvote from @randowhale thanks to @styleyfrancky! For more information, click here!

This is a very good question. I installed ruby for windows. Then opened the command prompt for ruby and typed without the $ sign and things started happening on my screen.
$ git clone https://github.com/inertia186/drotto.git
$ cd drotto
$ bundle install

When all of that was done I typed in without the $sign
$ rake run

But I get the error....
:WRN => "API exception, retrying (SSL_connect returned=1 errno=0 state=error: certificate verify failed)",
:detail => #<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed>,
:backtrace => [

Somewhere I think I seen @inertia talk about running on windows. I'll try to find it and If i figure it out I'll share. I'm a complete noob but see many of the small minnow bots are now all dolphin bots. We could use some more minnow bots for sure to help the little guys. Thanks @inertia.
It looks like you get this error when you don't have gems installed....You can use 2 lines of code to fix it according to the official Ruby guide....
$ gem install rubygems-update
after that runs the you run this.
$ update_rubygems
This takes about 5 minutes. It shows all of the bugs fixes and ssl certification fixes....Alas It doesn't resolve the error. This is my only option to get ruby working on windows. Anyone with a solution to the error might get some surprise upvotes for the help.

@inertia, just a question, is github a programming language? This is a very creative way of helping the other intheir upvote and also to you as well perhaps? So giving and taking. I LIKE the platform and maybe one day if Im already a whale, will make same formed as this . Thanks for the idea.

Github is a place to post programs. It also has a social networking aspect.

So it means that it is not a stand alone programming language but a platform that you can post your program and will convert it to github language? Sorry for making it complicated cause I wanted to know lil bit about github. Maybe I will do some research about it. Thanks for the idea @inertia. Btw, followed you and will wait more of your helpful and informative post as well as this one! Nearly genius. Power to you to all and the developers behind.

Any plans for a windows version?

Use it on a virtual machine ;) should work fine!

This post received a 1.1% upvote from @randowhale thanks to @hackerwhacker! For more information, click here!

Very interest idea mate...Thanks for sharing.

Hi there! I'm new to this platform! Let's help each other! Please follow me, vote my posts and I'll do it back!

And also, can you please resteem my post about puppy? I'll resteem some of yours.