drphil.rb - Voting Bot - gem update and bug fixes
New Features
- Bug/console output fixes.
- Improved
unique_author
logic to useaccount_history
instead of internal timer for improved accuracy between runs. - Gem update.
- Additional error handling.
- Handling bad json_metadata.
Features
- YAML config.
voting_rules
winfrey
mode that acts like the winfrey bot, all voters vote for everyonedrphil
mode one random voter votes for everyone (default)following_vote_weight
- for accounts that the voter followsfollowers_vote_weight
- for accounts that follow the votermin_rep
(default25.0
)min_wait
andmax_wait
(in minutes) so that you can fine-tune voting delay.favorite_accounts
list and separatefavorites_vote_weight
option.- Note: votes will be cast for favorites irregardless of rep.
enable_comments
option to vote for post replies (default false).only_first_posts
option to only vote on an author's first post (default false).max_rep
option, useful for limiting votes to newer authors (default 99.9).vote_signals
account list.- Optionally allows multiple bot instances to cooperate by avoiding vote swarms.
- If enabled, this feature allows cooperation without sharing keys (in
drphil
mode).
min_rep
can now accept either a static reputation or a dynamic property.- Existing static reputation still supported, e.g.:
25.0
- Dynamic reputation, e.g.:
dynamic:100
. This will occasionally query the top 100 trending posts and use the minimum author reputation. - Now checking
vote_weight: 0.00 %
and skipping without broadcast.- This is useful for special configurations that only vote for favorites.
min_voting_power
to create a floor with will allow the voter to recharge over time without having to stop the script.
- Existing static reputation still supported, e.g.:
- Optionally configure
voters
as a separate filename. E.g:voters: voters.txt
- The format for the file is just:
account wif
(no leading dash, separated by space)
- The format for the file is just:
- Or continue to use the previous format.
- Also optional support for separate files in each (format one per line or separated by space or both):
favorite_accounts
skip_accounts
skip_tags
flag_signals
vote_signals
only_fully_powered_up
which will only vote for posts that receive 100% STEEM Power author rewards.
- Skip posts with declined payout.
- Skip posts that already have votes from external scripts and posts that were edited.
- Argument called
replay:
allows a replay of n blocks allowing you to catch up to the present.- E.g.:
ruby drphil.rb replay:90
will replay the last 90 blocks (about 4.5 minutes).
- E.g.:
- Thread management
- Counter displayed so you know what kind of impact
^C
will have. - This also keeps the number of threads down when authors edit before Dr. Phil votes.
- Counter displayed so you know what kind of impact
- Now streaming on Last Irreversible Block Number, just to be fancy.
- Now checking for new HF18
cashout_time
value (if present).- This will skip voting when authors edit their old archived posts.
- Added
unique_author
(optional) which takes an integer in minutes. This will limit voting to 1 vote per period. E.g.: Set it to 1440 to only vote for each author once a day. - Added
max_votes_per_post
(optional) which only votes n times per post (winfrey
mode only). - Added
only_tags
(optional) which only votes on posts that include these tags. - Alternative voting weights all inherit from
vote_weight
if not present. - Favorites (
favorite_accounts
) can now have individual vote percent.- Formatted as: account:weight (e.g.:
inertia:100.00
)
- Formatted as: account:weight (e.g.:
- Now checking if any voter can vote at all. If at least one voter has a non-zero vote_weight, return true. Otherwise, don't bother to even queue up a new thread, thus saving memory.
- Argument called
stream:false
will exit without streaming the blockchain. Useful in situations where you only want toreplay:
and exit.
Overview
Dr. Phil (drphil.rb
) is reimplementation of the "Winfrey" voting bot specification. The goal is to give everyone an upvote.
One optional improvement is that instead of voting 1% by 100 accounts like the Winfrey bot spec, this script can vote 100% with 1 randomly chosen account.
If the complaint about Winfrey is blockchain bloat, Dr. Phil prescribes weight loss to address this. But this feature would only work if there are enough voters defined in the script. If you plan to use this script for one or two accounts, you'll probably want to adjust the VOTE_WEIGHT
constant to something a bit lower.
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 gist and install the dependencies:
$ git clone https://gist.github.com/61bcc2b821aa5acb24f7fc88921950c7.git drphil
$ cd drphil
$ bundle install
Then run it:
$ ruby drphil.rb
Dr. Phil will now do it's thing. Check here to see an updated version of this bot:
https://gist.github.com/inertia186/61bcc2b821aa5acb24f7fc88921950c7
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: What does this error mean?
drphil.yml:1: syntax error, unexpected ':', expecting end-of-input
Solution: You ran ruby drphil.yml
but you should run ruby drphil.rb
.
Problem: Everything looks ok, but every time Dr. Phil 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 voter
items have the account name, followed by a space, followed by the account's WIF posting key. Also make sure you have removed the example accounts (social
and bad.account
are 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/
See my previous Ruby How To posts in: /f/ruby
Get in touch!
If you're using Dr. Phil, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on STEEM and SteemSpeak.
License
I don't believe in intellectual "property". If you do, consider Dr. Phil as licensed under a Creative Commons License.
@inertia wow I can't really say because I still need to ask questions, is this a new type of bot vote buying?
The way you have represented these codes it's so amazing and all different the 100% part would really make a difference.
Please fill me in, fantastic analysis here
The original goal of this bot was to give everyone an upvote. Legend has it, some people used this bot to vote 1% on every new post. That was in the days of 3,000 active users per day.
These days, people use it as a replacement for Streemian Fanbase™.
Wow that would have been awesome if the original agenda was maintained
Thank you for filling me in on this and great analysis too
Sure, but the problem was that there's not enough voting power to go around. A single account can only vote for about 4,000 people per day at 0.25%, let alone 1%.
I thought delegation would have helped the bot, you know from various users with influence?
@inertia, drphil was working perfectly, implicitly stopped working a day ago, and I do not find the problem. In "Drphil.log" in the last lines it says:
` W, [2018-06-01T17: 09: 33.410252 # 881] WARN -: condenser_api.get_ops_in_block :: Removing misconfigured node from failover urls: https://rpc.curiesteem.com, retrying ... W, [2018-06-01T17: 09: 37.955758 # 881] WARN -: Failing over to https://rpc.buildteam.io ... W, [2018-06-01T17: 09: 41.380394 # 881] WARN -: condenser_api.get_ops_in_block :: Removing misconfigured node from failover urls: https://rpc.buildteam.io, retrying ... W, [2018-06-01T17: 09: 44.681753 # 881] WARN -: Failing over to https://rpc.steemviz.com ... W, [2018-06-01T17: 09: 48.577660 # 881] WARN -: condenser_api.get_ops_in_block :: Removing misconfigured node from failover urls: https://rpc.steemviz.com, retrying ... W, [2018-06-01T17: 09: 49.980104 # 881] WARN -: Failing over to https://steemd.minnowsupportproject.org ... W, [2018-06-01T17: 09: 51.296818 # 881] WARN -: condenser_api.get_ops_in_block :: Removing misconfigured node from failover urls: https://steemd.minnowsupportproject.org, retrying ... E, [2018-06-01T17: 09: 53.846700 # 881] ERROR -: Health check failure for https://rpc.steemliberator.com: # <OpenURI :: HTTPError: 502 Bad Gateway> E, [2018-06-01T17: 09: 55.027698 # 881] ERROR -: Health check failure for https://seed.bitcoiner.me: # <OpenURI :: HTTPError: 404 Not Found> W, [2018-06-01T17: 09: 57.943636 # 881] WARN -: Failing over to https://api.steem.house ...
`I have changed to other active nodes in the "Drphil.yml" configuration, in:
` : chain_options: : chain: steem : url: https://api.steemit.com
`Still, it still does not work.
I would appreciate a help.
Inertia, I am new in this of the healing bots, I have a problem and it is difficult for me to reach the solution. Once inside the directory / drphil $ I try with $ bundle install and the following happens >>>>
I can not solve, I tried update and aupgrade Bundle. Thank you so much.
The bot doesn't require that much memory, but it's possible that bundler needs a bit more in the beginning. Maybe you can enable a temporary swap to get it to bundle:
Thank you very much for the quick answer. I have made the suggested steps but the same problem persists.
Wow, thank you again. The amzing work you do into this platform is such an added value.. #INERTIAISMASTER
Great news. I'm looking forward to upgrading in the near future and trying out some of the new features.
Good Result!! Thanks
Thanks for all the hard work with the bot! It truly is one of the best out there an I use it to run @qurator. Without it I would be lost! =)
Nice! Thanks @inertia and @seablue for mentioning this in #SteemSpeak
Inertia thank you for the great work
I'm trying to setup drphil on a raspberry pi3 and it wont let me vote. Maybe I dont have libssl installed correctly ??
I keep getting the following error:
Pausing 0.4 :: Unable to vote with praguepainter. undefined method `regenerate_key' for Bitcoin::OpenSSL_EC:Module
Any idea what I'm doing wrong?
I see this bot votes for everybody, maybe I should use a more targetted bot ? Just wading into the world of curation bots ..
Also I dont understand bandwidth issues .. is there a way to allow the bot to only vote when I have enough bandwidth?
Many thanks
Try:
bundle update
Thanks for your time
I couldnt update ffi
Installing ffi 1.9.21 (was 1.9.18) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
I'll keep fooling around with it .. .
I'm a noob so perhaps I need a fresh install
Or do it on Jesse on a Pi2 ...
I managed to update by installing libdevffi
still have the regenerate_key error:
Unable to vote with praguepainter. undefined method `regenerate_key' for Bitcoin::OpenSSL_EC:Module