Open sourcing @randowhalesteemCreated with Sketch.

in #development5 years ago (edited)


Repository: https://github.com/emre/randowhale_bot


@randowhale is a random voting bot burning STEEM and contributes to less STEEM in circulation. See introduction post

@nextgencrypto had this idea and supports @randowhale with his own SP while I'm doing the development and maintenance work for it.

It was started a closed-source project. However, we like to keep it open-source. That should be a good reference for developers to see how easy to build these things.

It uses @themarkymark's global blacklist API by default, and refunds vote requests immediately if a username is blacklisted by any projects.

There are checks implemented to refund the request if:

  • Post age is below than minimum limit
  • Post age is greater than the maximum limit
  • Post is not a main post (comment)
  • Post is already voted
  • Sender or Author in the blacklist
  • The VP of the bot is not enough to vote
  • Memo doesn't include a valid author/permlink pair

Installation

Requires Python3.6+ and a Mongodb server.

$ virtualenv -p python3.6 randowhale-env
$ git clone https://github.com/emre/randowhale_bot.git
$ pip install -r requirements.txt
$ vim config.py

Running:

$ python run.py

It's always suggested to use a process manager to make sure the runner is always up and running. I use supervisor to manage this kind of scripts, personally.

Configuration

Config variables are pretty straight-forward.

PROBABILITY_DIMENSIONS = (
    (1, 25, 0.4),
    (25, 50, 0.3),
    (50, 75, 0.2),
    (75, 99, 0.09),
    (99, 100, 0.01),
)
BOT_ACCOUNT = "randowhale.test"
POSTING_KEY = "posting_key"
ACTIVE_KEY = "active_key"
MIN_AGE_TO_VOTE = 300  # 5 mins
MAX_AGE_TO_VOTE = 432000  # 5 days
MINIMUM_VP_TO_VOTE = 80 # in percent
VOTE_PRICE = "0.001 STEEM"

PROBABILITY_DIMENSIONS is the root of the weighted random number generator. The first element in each item is the vote percent start, the second element is the vote percent end, the third element is the probability factor of the item.

For this configuration, there is a %40 chance that the vote will be between %1 and %25. There is a %30 chance the vote will be between %25 and %50, and so on.


Vote for my witness


If you like what I do, consider casting a vote on Steemconnect or on Steemit

Sort:  

!trdovoter 100

Congratulations @trendo.marketing, you are successfuly trended the post that shared by @emrebeyler!
@emrebeyler will receive 18.39717000 TRDO & @trendo.marketing will get 12.26478000 TRDO curation in 3 Days from Post Created Date!

"Call TRDO, Your Comment Worth Something!"

To view or trade TRDO go to steem-engine.com
Join TRDO Discord Channel or Join TRDO Web Site

Great work there!
!BEER

Also, thanks to me, we know, the blacklist is working;)
You are welcome!
!BEER



Hey @emrebeyler, here is a little bit of BEER for you. Enjoy it!

!BEER for devs

Posted using Partiko Android



Hey @emrebeyler, here is a little bit of BEER for you. Enjoy it!

Congratulations @trendo.marketing, 100% upvote has been shared with your successful call on the post that shared by @emrebeyler!


Support @trendotoken projects by delegating : 100SP , 200SP , 500SP , 1000SP , 2000SP

Congratulations @emrebeyler, your post successfully recieved 18.39717 TRDO from below listed TRENDO callers:

@trendo.marketing earned : 12.26478 TRDO curation


To view or trade TRDO go to steem-engine.com
Join TRDO Discord Channel or Join TRDO Web Site

Emailed 👌


Powered by witness untersatz!

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64029.44
ETH 3157.04
USDT 1.00
SBD 4.02