How to Create Your Own Curation Trail Bot (Part 2- Tutorial)

in #curation7 years ago (edited)

In this post, I'll show you how to create your own curation trail bot.



As a reminder, a curation trail bot will allow your account to vote on posts that another account votes on. If you're looking for a bot that will upvote specific accounts, refer to this tutorial by @bitcoinparadise.

I summarized the functions of a curation trail bot as well as my personal experience learning how to use this bot in Part 1 of this post, so if you would like to read more about bots and how I arrived at the idea for this post, feel free to read it here:

Let's get started.

Here's what you'll need:

  • A computer running Mac OS or Linux that is connected to the Internet
    • Windows users please see the notes below.
  • A text editing program (optional)
    • I recommend Atom. It's available for Windows, Mac, and Linux)
  • The ability to open a terminal or command line
  • The ability to copy and paste or type in commands

A Special Note for Windows Users

Windows users, support for these installation instructions are not included by default in Windows. Because of this, you have a couple of options:

Option 1: Install Linux

You can forgo Windows, seek out an old PC you may have lying around, and install a distribution of Linux on it. This is a fairly straightforward process as most Linux distributions have installation guides on their websites.

If you've never experimented with Linux distributions, now is a great time to get started. It is possible to dual-boot Linux with Windows, but you would be unable to use Windows if you wanted the bot to run constantly. Also, dual-booting involves changing the boot and partition structure of your hard drive, so you should proceed with caution if you've never done it.

For users new to Linux, I suggest starting with Ubuntu. It's a common distribution that has long term support. You can read more about it and download it here, access installation instructions here, and read about how to dual-boot with Windows here.

Option 2: Enable Ubuntu Support Within Windows

The other option is to enable Ubuntu support within Windows, which is a fairly new feature and is still in beta. Steemit user @bitcoinparadise provided a great guide on how to do this, so check it out here.

If you're running Mac OS or Linux, you may proceed with the installation of the bot!

Linux and Mac Instructions

Installing the bot is fairly simple. In Linux (Mac users skip to the next command), open a Terminal and type the following command:

$ sudo apt-get install ruby-full git openssl libssl1.0.0 libssl-dev

Press enter and wait for the installation to complete. (Since you're using the sudo command, you will be prompted for your administrator or logon password, so have that handy. If you're new to Linux, note that when you begin typing your password, the cursor does not move. The password will still be entered, so type it normally and press enter.) You may also need to press the Y key when prompted.

For Mac and Linux, now type:

$ gem install bundler

Wait for the bundles to install, then proceed. The next step will clone files from the GitHub project for this bot to your machine, so you'll need to decide on a name for the folder you want the files in. Here are the commands to clone the files:

$ git clone https://gist.github.com/d57c9bc744f05ada01d173521c01df8a.git drdoogie

Note that drdoogie in this command is the name of the folder the files will clone to. If you'd like to name the folder something else, simply replace drdoogie with your desired folder name.

Now we navigate into the directory we just created:

$ cd drdoogie

And finally install the dependencies for the bot:

$ bundle install

After you've completed these steps, all the files are in place and you're almost ready to run the bot. Now you'll need to edit the configuration files to tell the bot which account you'd like to trail.

Changing Configuration Settings

Outside of the terminal, navigate to the folder where you just cloned the drdoogie files. You should see several files, one of which is named drdoogie.yml. Open this with your favorite text editor. Now it's time to change the settings.

Alternatively, you can edit the file within the terminal. While inside the directory you just created, use the command

sudo nano drdoogie.yml

You'll see the contents of the file and be able to edit them. Follow the on-screen keyboard shortcuts to edit and save the file, then return to the regular terminal interface.

Enter Your Voting Key

You'll need your Private Active or Posting key from the Permissions tab of your wallet page on Steemit. With these handy, look for these lines in the file:

:voters:
- social 5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYF

  • Replace "social" with your Steemit account name, and replace "5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYF" with your private active or posting key.

Choose Your Trailing Options

Next, you'll need to tell the bot which account to trail. The default account in drdoogie.yml is banjo, so you will see the lines:

:trails:
:banjo:
:scale_votes: 100.00 %
:max_age: 1440
:allow_upvote: true
:allow_downvote: true
:enable_comments: true
:skip_tags:
- nsfw
- test
# :only_tags:
# - steemit

Replace "banjo" with the name of the account you'd like to trail.

The scale_votes attribute accepts a percentage. The bot will vote at this percentage of the vote given by the bot account. For example, if the account you are following votes for a post at 100%, and you have your scale_votes attribute also set to 100%, your account will vote at 100%. If the account you're trailing votes at 50% and you are trailing at 100%, your account will vote at 50%.

If you prefer an equation, the bot will vote like this:

Vote weight of account being trailed (%) * [(scale_votes value (%))/100] = your voting percentage (%)

If the account you're trailing votes at 75% and you have your scale_votes set to 25%, the math would look like this:

75 * (25/100) = 18.75

Your account would vote at 18.75%.

It's important to note how the account you're trailing votes. If it typically gives out large votes, you'll want to scale this percentage down so you won't drain your voting power. This can take some adjustment to figure out, but when you first start out, it may be a good idea to start low at 25% or so and increase from there.

The max_age attribute allows you to tell the bot to exclude posts older than the assigned value in minutes. The default is 1440 minutes, or 24 hours. The max value is 10080 minutes, or 7 days, since that's how long the voting window is on Steemit.

The other attributes are self explanatory, and you can tell the bot to exclude or only vote on certain tags.

Pick a Steemit Node

The final section of this file tells the bot where to look for the blockchain data:

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

Due to a recent change in the Steemit API, you may want to change this to https://api.steemit.com. As @inertia has pointed out, however, you may simply run the command bundle update within the directory of your bot to grab the latest nodes. A current list of active nodes may be found here in case you cannot get the default one to work.

Run the Bot

Now that you've configured all of the settings, be sure to save the changes you've made to drdoogie.yml before proceeding. Your bot is ready to run.

Return to the terminal window and run your bot with the command

ruby drdoogie.rb

After a moment, you should see a message that says

Now trailing [insert account name here]...

That's it! All you have to do now is wait for the account to vote, and you'll start to see some action in your terminal window. Be sure to monitor both the account you're trailing and your account on Steemd or SteemDB to be sure your account is voting correctly.

Possible Error Messages

You may see long strings of text from something called Hashie that looks like an error message. @inertia has said that these are safe to ignore as long as you can see that your account is voting like you want it to. You may see another error message that says

'from_base58': Invalid version (RuntimeError)

This means that the posting or active key you entered is incorrect. Simply update the key in the drdoogie.yml file and run the bot again.

Your bot will now run as long as your Linux or Mac is turned on and connected to the Internet.

You may need to tweak the settings, and you may do so by editing the drdoogie.yml file any time, saving your changes, and restarting the bot.

Other options

Throughout my messages with @inertia, I discovered several other features. One instance of the bot will allow multiple voting accounts and multiple account trails. I have not tried adding multiple voting accounts, but it only requires adding another line beneath where you specified your account name and posting/active key.

As for trailing multiple accounts, @inertia said that adding another account underneath the first one within colons is the proper way, e.g.

:banjo:
:curie:

and so on. When I tried this, I had mixed results, so I resorted to using multiple instances of the bot to trail different accounts. This is also necessary if you want to weight each account differently. If anyone who is better at coding has a suggestion on how to modify the bot to allow such considerations, please let me know in the comments!

Final Thoughts

I have very much enjoyed being able to trail quality curation accounts. It allows me to add value to hundreds of posts each day rather than just the few I'm able to do manually. Figuring out the voting weight takes some time and experimentation, but it's worth it in the end. I've yet to see how the bot impacts my curation earnings since I haven't had it running a full 7 days yet, but I will let you know when that happens!

I'm mostly glad that I don't have to worry about being locked out of Streemian anymore.

Please let me know if you have questions about this process. I'd be happy to address them in the comments. Also, if you have suggestions on how to improve the bot, I'd love to work with you on creating a new iteration of the bot that we can distribute to the Steemit community.

If you are interested in setting up a bot that votes on your behalf for specific accounts, @inertia has created a bot for that purpose also. You can check out the GitHub page here, and if you're interested in installing it, @bitcoinparadise has posted an excellent tutorial.

As always, thank you for stopping by!

Footer

Sort:  

In case you don't have a spare computer to run the bot, AWS Amazon Web Services) provides you with a Linux/Windows machine on cloud. It also gives a 1 year free trial period.
Check out how to set up a machine here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html

Once you set up the instance, the rest of the steps remain the same.
And BTW, thanks @ethandsmith for the post!

Thanks for this information! I think I might try out AWS for myself and perhaps use it for future tutorials! Thanks so much!

Thanks for this info @drishitmitra!

Im glad you have the bot 100% working now @ethandsmith =)

And thank you for sharing such an awesome post to help out the users who would prefer to setup their own bot.

Keep up the good work!

You're very welcome! I'm glad I can support your efforts via @qurator! I hope that it will help others trail the account soon!

I'll have to show this post to my husband, he'll understand the parts I don't lol This seems like a useful tool. I tend to be on ehre often enough, but if I have to be absent from Steemit for a few days, but what to still upvote some people I tend to regularly upvote, this could prove useful.

Keep in mind that this bot will only trail another account's votes. So your account will vote on everything the other account votes on. If you want to set up a bot that votes only for specific accounts, check out this tutorial that I linked to in the post.

I appreciate this comment, as it reminded me I need to make this distinction in the main post for others. Thank you so much.

Oh, glad I could help then ;) Thanks for specifying, I'll check out the link.

I read both parts of this series, great initative, you deserve big props for diving into the world of coding and bot development. Im interested to see how your curation works out for you. I've used streemian for a few weeks now, but during the first week I made the mistake of following several curators and had my voting weight set at 20%. Less than a day later I had absolutely no voting power haha, lesson learned.

Interested to see your results. Solid work bud

Hey Jason, thanks for dropping by.

So far, it's been great for my curation. I'm trailing three accounts, and this bot allows you to vote at a percentage of what the accounts you are following vote at, so I've been able to keep my voting power from getting depleted like crazy.

I'm coming up on the first full week since the bot has been running, and so far, it has increased my curation rewards per week by a significant margin compared to when I was only manually curating. I've really enjoyed diving into the world of bots, so I'll hopefully discover some more new things and post them for everyone to enjoy.

That's awesome. Good to see you're having some success. Automating some little things like curation will definitely be helpful to build up some extra SP down the road

I know this isn't as difficult as it looks at first glance, but a little daunting for a first-timer. I'll keep this dream alive, when some time opens up. Really appreciate the detailed instructions. @ironshield

I completely understand that sentiment. It took me many hours of fiddling with this to get it to work and I know there is a lot of background knowledge that I have that made this easier.

My goal is to make things like this accessible to the average Steemian. If you do try it someday, let me know if you need help!

Thanks, that's a generous offer, I may take you up on that. :-)

@ironshield

Nice job @ethansmith,

I can't help you with modifying the bot unfortunately, as I don't speak the language. But...

...I wanted to mention that if one doesn't have an unused pc for the bot but have €3 to share each month, can open an account at Scaleway and get a linux server with just a few mouse clicks!

Hope that helps.

Keep steemin'! :)

Hey! Thanks so much for the recommendation. That's a great thing to know. I know I was fortunate to have a spare PC to put Linux on. I hope that your suggestion will take away a barrier for people who normally wouldn't consider running a bot.

Sure wish I was more tech savvy this looks to be a great step by step piece of information with tons of additional leads @ethandsmith

This method has been working very well for me over the past week. My goal here is to make things like this available to people who may not consider themselves the most tech-savvy person. If you ever decide to give it a try, be sure to let me know if you have any questions!

This actually does look pretty easy, if I ever need to set one up! Thanks!

You're very welcome! Thanks for reading. Let me know if you have any further questions!

Wow, this is some serious stuff! I think I will need to read it a few times but even then it may be beyond me

On the topic of curation, check out the regular post of @abh12345 where he compares curation stats for a range of people. If you send him a note, and an upvote or two, you could get yourself added to his list and see how you are doing

Cheers

I'll definitely check out that account! Thanks for reading. I'm always looking for other accounts dedicated to curation.

If you do decide to give the bot a try, let me know if you have any questions!

Sent to a friend of mine who was trying to make a bot. Amazing detail! Would love to see more like this.

I hope it helps your friend! I'll try to share anything else that I learn about how to do things like this. Thanks for reading!

Coin Marketplace

STEEM 0.15
TRX 0.15
JST 0.028
BTC 53622.13
ETH 2208.05
USDT 1.00
SBD 2.29