Open Sourcing Goodvoter - My Old Vote Trail Following Bot

in #hivedevs2 years ago

What is it?

This is a vote trail following bot that allows you to specify multiple accounts to follow the votes of, the weight used to follow that account, and a target amount of voting mana to try to keep your account at. Because of the target voting mana level you are free to continue to manually upvote things and the bot will automatically adjust.

It is written in NodeJS using the hive-js library and runs in a docker container. It only makes a call every 3 seconds to not overwhelm nodes with more calls than necessary. It simply gets the current irreversible head block number, fetches the latest block, parses it for transactions performed by the accounts specified in the config file, looks for vote operations, then adjusts the weight of the vote as necessary based on both the specified percentage and your currently available voting mana and target.

goodvoter-screenshot.png

Why now?

I wrote this years ago for Steem and eventually made the minimal changes to make it work on Hive. I figured some of you might be able to make use of it so open sourcing it is better than letting it rot away. Aspiring newbie Hive app developers may be able to learn from it and use it.

Are voting bots ethical? Why would you use this?

Personally I don't have time to regularly curate content but I do keep some Hive powered up in my account. Rather then let that HP go to waste I'd prefer to follow the votes of accounts that I "trust" to be voting on good content. I wasn't using my HP for a quite a long time but I had some spare time one day and figured I'd dust this off in hopes that my HP goes to good use.

goodvoter config.png

As you can see in the config file, I've currently chosen three accounts to follow with equal weight (33% of my votes each). One I chose is @ocdb because that always seemed like a good curation project and @acidyo always seemed like a cool person. The next is @curangel because that also always seemed like a good curation project. Lastly I chose @gtg because I trust his judgment in securing the network and also voting for things that are best for Hive (looks like lately he's mostly voting on @hbdstabilizer posts which is clearly a good thing for keeping HBD stable). By default it does not follow downvotes as I'd prefer to do that type of curation manually.

Does this maximize my curration rewards?

No, this is not designed for "maximum profits" or anything like that as that is not my goal here. My goal is simply to use my available HP in the best way that I can even if I don't have time to do it myself. I don't even want to get into theorizing about how to improve it to be honest. I simply do not care about this topic.

Are there bugs? Is it perfect?

This is not really production quality software and likely has bugs yes - especially the lack of error handling in some cases. I hacked this together for my own purposes and it is not perfect in any way. However, I will say that I've run this for months on end without it crashing or having any apparent issues. I have not taken a close look at the logs nor will I spend the time to do so.

If anyone wants to make a pull request to improve on this I will be happy to take a look when I have time.

Where can I find it?

It's on github right here: https://github.com/jredbeard/goodvoter

I no longer think that github is a great place to host your open source software and it's better to run your own instance of Gitea but I won't be hosting one just to publish this simple project, so, it is what it is.

Anyway, I hope this helps someone out! Enjoy!

Sort:  

Any chance you could have it not trail comment votes? While it's appreciated to give out a bit more there too it might look a bit weird with there being 5-10 voters on comments but nothing on the rest in a post. Just something I've noticed on the ocdb votes we some times throw towards great comments that our curators nominate or great poshtoken shares.

Btw, check out the Programming & dev community or Hivedevs communities in the future for possibly more visibility, but nice to see you posting :)

Thanks - I don't have any plans to further develop this, but, I'm happy to accept a pull request if anyone wants to change that functionality (or add an option for it).

My next spare time blockchain project will probably be something on #koinos - their mainnet is launching soon. It's a general purpose layer 1 smart contracts platform developed by most of the original steem team. It's free-to-use like Hive, but also for smart contracts. It's immune to the "exchange attack" and other issues with PoS/DPoS as it uses proof-of-burn. Cool stuff.

It is not immune to the Steemit effect though, I remember during mining one party was getting most of the rewards, I have a feeling it was the team, when asked about it they were very evasive. I wouldn't doubt if they ended up with 80% of the rewards like Steemit did.

There's a huge difference here though: steemit was literally a pre-mine situation. Koinos mining was open to everyone at the same time. I'm sure the team mined some and probably even bought some on uniswap, but, those were the only two ways to obtain the Koin erc-20 and everyone was on the same playing field. It's about as fair of an initial distribution as you can probably do. Most other new cyrptocurrency projects just outright issue themselves tokens at genesis to later dump on the market. There's no doubt that some professional miners got involved pretty quickly, but, it looks like they sold most of what they mined based on viewing wallet history on etherscan.

It's probably also worth noting that none of the team involved with Koinos were the individuals responsible for doing the pre-mine on steem (this was before my time there but is documented publicly in various articles).

Lastly, Koinos actually is still immune to such attacks because of proof-of-burn. In order to have an influence on governance you have to actually produce blocks (similar to how BIP's work on bitcoin). In order to produce blocks, you have to actually burn your stake. So in order to perform an attack you'd need to acquire 75% of the stake and then burn all of it and produce blocks for quite some time to effect governance. It's literally built to avoid the "steemit effect" scenario. If you haven't had a chance, check out the new unified whitepaper that was recently released - it goes more in depth on this topic (it's a pretty good read at a minimum, even if you don't care about the project itself).

Think I still have some I mined, horrible timing on the way it was distributed with the eth fees that pumped around the same time but looking forward to seeing what it does and how it works. I don't think exchanges are an issue for Hive anymore though same can't be said for whatever they're doing to EOS.

Yep those eth fees were crazy last year, but, that alone makes a good case for a free-to-use general purpose smart contracts chain.

I also doubt Hive would suffer another exchange attack, but, if it did, I suppose it would require a hard fork to mitigate within the 30 day window for witness voting. While that would work, having a mandatory hard fork as a feature isn't great. As we've seen before, PoS/DPoS works really well - until the day it doesn't. (not fear mongering, it'll probably all be just fine).

I haven't really followed EOS at all but I suppose that would be the next closest thing to koinos - as far as I understand it's split up into varying resources (cpu/ram/network) which isn't a great user experience and doesn't have payer/payee semantics like koinos or delegation like hive. It seems pertinent to be able to launch applications with free accounts and for dApps to be able to allow their users to use them completely for free in order for dApps to go mainstream.

I also doubt Hive would suffer another exchange attack, but, if it did, I suppose it would require a hard fork to mitigate within the 30 day window for witness voting

The exchange attack wasn't enough, it was combined with the fact Justin Sun got 76M under the table without affecting the market. This will never happen again as no one party owns even close to that. I doubt exchanges will ever fall for that again I'm honestly surprised there hasn't been a legal action taken against them for their involvement and what they did to customers funds. Never too late I suppose.

Agree that the whole thing was a result of multiple factors. I also agree that Hive stake appears to be much more split up at this point. However, the protocol itself still isn't immune to these issues and stake can still changes hands. It's way less likely, but, not impossible over a longer period of time.

I'd argue it'd get harder over time, especially if the stake is distributed properly to people that value decentralization and wouldn't assist in such an attack, understand what went down the last time and how it hurt the people who helped centralize Steem, etc. Though currently with a somewhat high inflation and stake that's being sold being unaccounted for in who's hands it's landing on exchanges may be a risk. Either way even in the worst case scenario where the attacker were to slowly power up a lot of accounts with the stake they're buying to vote in their witnesses people would notice them going up the ranks, a lot of stake being withdrawn from exchanges going towards it, etc. Nothing a call to action to vote the witnesses they know wouldn't fix.

On the behalf of Curangel team thank you for the support to the project @justinw! I am sure a bunch of hivers will find this useful! :)

And so cool about Koinos too, I am still keeping what I managed to mine and bought on uniswap.

Oh hi! I remember you! I hope you're doing well. Glad to see you're still around here. Thanks @m31!


~~~ embed:1563261580791660545 twitter metadata:Q2xvdWRzeXN0ZW04M3x8aHR0cHM6Ly90d2l0dGVyLmNvbS9DbG91ZHN5c3RlbTgzL3N0YXR1cy8xNTYzMjYxNTgwNzkxNjYwNTQ1fA== ~~~
The rewards earned on this comment will go directly to the people( @claudio83 ) sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.

Oh and if you register on hiveposh.com by linking your twitter and hive account together @justinw you could earn some posh tokens and hive rewards if people upvote the comment up. Right now the tokens will just end up going to @null and hive rewards to @hive.fund.

Thanks for sharing this. I’ve been needing to find a voting trail for a while now. I hate seeing my voting power at 100%. It slows my HP growth so much… ugh

Last night I published a blog - Learn "Coding" To Have Unfair Advantage On Hive. xD

This bot is the reason why it makes sense.

While I disagree with the title of "Unfair Advantage", the content of the post otherwise has a good message about learning to code. Upvoted.

As far as I know, there are vote trail services you can subscribe to on Hive without needing any technical know-how so this should already be possible for everyone without running a bot themselves (at least, these types of services existed on steem - I'm assuming they are still around on Hive).

Thanks a lot Justin. Wanted to motivate others to learn to code. "Unfair Advantage" is a business term that may sound negative but it simply means to have an "Edge" over others. Everyone wants that for themselves.

As far as I know, there are vote trail services you can subscribe to on Hive...

Yes, we do have such no-code tools and services available. I use Hive.vote and it's cool. Can do a lot of stuff with it.

Yep I suppose I prefer the term "Having an edge" over "Unfair advantage" because "Unfair advantage" seems to imply that it isn't something others can acquire.

Glad to hear those services are still available

uhh juicy

Congratulations @justinw! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

You distributed more than 52000 upvotes.
Your next target is to reach 53000 upvotes.
You received more than 2750 upvotes.
Your next target is to reach 3000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Support the HiveBuzz project. Vote for our proposal!

Thanks for confirming this works - 52k votes and counting lol

as a newcomer i have to understand about stuff like this, it's important for development when in hive. thanks for the useful article for a newborn.

Great! Profit from holding a great deal of tokens while new fish ensure there is a platform at all. What could go wrong.

Thank you for open sourcing it , will gonna check the code out.

Thank you for sharing this amazing post on HIVE!
  • Your content got selected by our fellow curator @priyanarc & you just received a little thank you via an upvote from our non-profit curation initiative!

  • You will be featured in one of our recurring curation compilations and on our pinterest boards! Both are aiming to offer you a stage to widen your audience within and outside of the DIY scene of hive.

Join the official DIYHub community on HIVE and show us more of your amazing work and feel free to connect with us and other DIYers via our discord server: https://discord.gg/mY5uCfQ !

If you want to support our goal to motivate other DIY/art/music/homesteading/... creators just delegate to us and earn 100% of your curation rewards!

Stay creative & hive on!

Once I have enough Hive power I plan to utilize this great tool!

Dear @justinw, we need your help!

The Hivebuzz proposal already got important support from the community. However, it lost its funding a few days ago and only needs a bit more support to get funded again.

May we ask you to support it so our team can continue its work?
You can do it on Peakd, ecency,

Hive.blog / https://wallet.hive.blog/proposals
or using HiveSigner.
https://peakd.com/me/proposals/199

Your support will be really appreciated.
Thank you!

hello am reading this and it was very helphfully for me because i try to find post to create a trail with my friends and your post is the only one that could guide me. Am very new here and learning all i can, thanks for the great content because i was a few step to surrender in my search :D . Now i have a question, i copy this but where i paste this? i dont know too much about programs, i hope i do a good question 😅