Actifit BOT Development Updates: Signups, Referrals, Endpoints & More
Repository
https://github.com/actifit/actifit-bot
Introduction
Actifit bot hosts the integral core of the Actifit project and its processes.
For this round, we implemented several new features, modifications and fixes to enhance Actifit, particularly in relation to the AFIT token pricing, signup and referral modules, including the creation of new API endpoints, new random daily lucky winner for doubled up rewards, STEEM value benefactor calculation, as well as daily calculation of Actifit account rewards.
Below you will find more details about this update.
Also noteworthy is that we have finally moved our actifit repos into an actifit organization instead of my personal account.
Technology Stack
The bot is scripted using Node.js, and connects to a MongoDB instance for storing and retrieving values.
Work Done
Creating new API endpoint
curAFITPrice
to allow querying the current AFIT token price. The current pricing is based on our projections and plans till reaching May 2019, and hence the API end point helps providing the proper pricing against USD, which is used across different functionality, including maximizing AFIT payout (AFIT/STEEM converstion), signup functionality, and other areas.Creating new
signups
endpoint to fetch signups by referral, so as to allow proper display of user's referralsCreating new endpoint
confirmPayment
which will signal the initiation of awaiting for user's proper transaction of sending funds to actifit.signup account, while using the actifit.io/signup form and data. The success of which will propagate a series of subsequent function calls relating to creating an account, delegating SP to the account, but also sending out AFIT token rewards to the new account, and to the referrer account, if such an account is set.In order to avoid timeouts on heroku instance, particularly that heroku has a 30 seconds timeout set for reach running transaction, we needed to constantly send a response back to the calling instance as a
res.write(' ');
which will prevent timeouts while awaiting for transfers to occur. The reason we are sending out empty space is to avoid breaking the JSON data structure being sent as a result. Extra leading spaces cause no issue with JSON format being properly read and parsed as a result.Also implementing the above required that we no longer use the
res.send
function call as it doesn't work ifres.write
was already used, and hence we needed to use againres.write
while passing as a param aJSON.stringify
version of the data we normally send withres.send
, and follow that with ares.end
to close down our stream.Creating a new random generated lucky winner to get a doubled up reward, both in terms of AFIT tokens and upvote value. The number generated is limited by the total amount of potential posts to be upvoted, which will ensure a single actifitter gets rewarded once per every upvote cycle.
Adding the calculation of the STEEM beneficiary rewards as part of the maximize AFIT token payout option to properly reward users with the accurate amount of AFIT tokens in compensation of their STEEM, SP and SBD post rewards.
Creating a new function
lookupAccountPay
which will allow calculating the rewards earned via the following transaction types: beneficiary, curation, and witness producing blocks. Options include a single day, a week, or a month.Refactoring the code to eliminiate frequent
res.header
calls settingAccess-Control-Allow-Origin
and utilizing theapp.use
function which captures all API calls instead.Adding a testing scenario which relies on local db instead of live db.
Roadmap
Further continuous improvements are planned for Actifit core functionality, particularly as the project grows, starting with the development of new endpoints to improve the website, app, and stats/info gathering processes.
How to contribute?
You can chat to us on the official actifit discord, or to me in discord private @mcfarhat#6013.
Contributions are accepted as pull requests to the official github repo.
We are having continuous tasks assigned to different contributors to our project. More official tasks are continuously announced :)
Lovely! Love Actifit!
Posted using Partiko iOS
Hi @mcfarhat!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server
Hi, @mcfarhat!
You just got a 0.1% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.
Hey, @mcfarhat!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!
Sounds great, keep up the good work. this will develop into a great project
Congratulations @mcfarhat! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard: