ALIVE Tipping Bot - A Few Updates To Fix Some Issues - And What Still Remains An Issue

In this post I go over a few updates that I just made to the ALIVE tipping bot to fix some issues with it, plus also one issue that still remains with it, enjoy!


blogalive_1_original.jpg
Made in Desygner

Hi there and welcome to my blog, my name is Erik Gustafsson and I go by the handle @flaxz.

ALIVE Tipping Bot - A Few Updates To Fix Some Issues - And What Still Remains An Issue

So the ALIVE tipping bot that uses the !ALIVE command to send out 0.1 ALIVE tips given that the tipper has at least 1000 ALIVE tokens staked has been updated to fix a few issues.

We are using Distribubot, developed by @holger80 as the bot for this, and you can find the code on Github, https://github.com/hive-engine/distribubot

Properly configured Distribubot seldom has issues to stay operational, though I do know that a few projects using it has not configured it properly, which has kind of tarnished it's reputation a bit.

That being said, it's kind of a Swiss Army Knife as to it's features, which means it will miss some features for some types of applications.

One of those is the way we use it, Distribubot has not been programmed to work properly with floating point tips, only integers works correctly.

A float is a decimal number, such as our 0.1 ALIVE tips, while integers are whole unit numbers, such as 1.

We encountered this problem quite a while ago, and as our settings is for each tipper to be able to send out 10 tips per 1000 ALIVE staked I made a quick fix before by just 10x the tips, as Distribubot does not count float tips correctly until they are written to the log database.

Distribubot also does not write to the log database on a per event basis, but on a set time interval based on how many blocks it has processed, and with 300 blocks as default, which means once every 15 minutes.

I have now changed this to once every 6 blocks, meaning once every 18 seconds, which is lower than the once every 20 seconds that the blockchain has as a limit for comments.

With this I also reset the number of tips to actually be 10 tips per 1000 ALIVE staked.

I will also monitor quite closely to make sure that the resources the server uses does not go out of hand with the vastly increased logging, though it should not be a problem since the previous setting only used around 2% of resources, so even if it goes up it should not go out of hand.

One more thing that I have fixed is that it was coded to only approve stake above the set stake in the bots settings, but not equal to that, meaning it was coded as >, and I have now changed that to >= which means both equal and above the setting now works.

I only found out about this issue in the last few days, when some people tried to tip with exactly 1000 ALIVE staked and got an error, while 1001 ALIVE staked worked fine, so now 1000 ALIVE staked works great too.

What Still Remains An Issue

Now there is also a quite big issue that still remains, and that is about the error comments that the bot makes, since it does not make those comments on the comment that sent the tip command, but the comment or post that the tip is intended for.

I thought at first that it would be rather easy to fix this, but it turns out that it is not easy at all.

The problem here lies in the fact that the bot uses the same variable to define both the success and error messages that it will include in the comment, and a few if arguments as to which message is included, and then a single command for the comment.

To fix this requires quite a big rewrite of how the bot makes comments, an easier solution would be to do what some other projects have done and only comment on the comment made by the account sending the tip command, and then include the username of the account that got the tip.

That easier solution would still require quite some time too, but my main objection against it is that I want the success comment to be made on the post or comment that gets the tip, and the error comments to the one who sent the tip command.

The question then remains if it's actually easier to do a big rewrite, or if it is better to sort of fork Distribubot by making a new bot and only take the parts from it that we need, Distribubot is Open Source, and so would the new bot be as well.

With writing a new bot we could also fix the issue with a time interval for logging and go over to event based logging instead, plus we could even include a parameter in the success comment as to how many tips the tipping account has sent and how many tips remains.

I do know that there is other tipping bots out there too, but as far as I have been able to determine none are Open Source, so this is basically what options we have to work with.

What do you think?

Thank You!

Thank you very much for reading this post and I hope you liked it, leave your thoughts in the coments below, and ...

Stay Awesome!

Sincerely,
Erik Gustafsson

My profile on PeakD

My profile on We Are Alive

This is my own personal opinion, do your own research before investing, and seek legal counsel if uncertain.


Join the We Are Alive Discord


Made in Desygner


Made in Canva


@flaxz



0
0
0.000
12 comments
avatar

good work fixing them and you will fix others as well good luck

0
0
0.000
avatar

Thanks and yeah there is some work still to be done, I hope it will not take too long though.

!ALIVE
!BBH
!PIZZA

0
0
0.000
avatar

Because this is such an awesome post, here is a BBH Tip for you. . Keep up the fantastic work

0
0
0.000
avatar

Hey nice - one on the fixes - I'd come up against that exact issue with the 1000 token stake which is why I have 1001...

I'm a Developer when I'm not making music (not Python though) - but reading the above it sounds like you are leaning towards a fork and new bot!

Keep up the great work!

!PIZZA and !ALIVE

0
0
0.000
avatar

Thanks a lot, and yeah I have a few other things to focus on first, but then I will look deeper into the best way forward and start working on it, I am not really a coder though, but I have made a Python script for our weekly payouts of 3 BRO to ALIVE stakeholders, so it should not be too hard even if it will take time.

!ALIVE
!PIZZA

0
0
0.000
avatar

You need to stake more ALIVE tokens (you can send 10 tips for every 1000 ALIVE tokens that you have staked)

0
0
0.000