[Bot Wars]Third week report - SocialBoost
First of all i want say everyone - ‘Happy New Year’. And I would like to wish more interesting projects, ideas and health for their implementation to all. Last week i didn’t publish progress report because it was one of important weeks in my life - i finished my university. But this doesn’t matter, weekends it’s the best time to catch up progress. So let’s walk around SocialBoost Bot!
Yes, i am newbie in coding. And let's be honest - Byteball have problems with the support of developers, but the recent release of the portal - developer.byteball.org, guides from core-developer @xjenek and also created telegram chat @devBB - redirect the vector of growth of developer community in the right direction and I really want everything to grow further. Bot-contest in turn - this is a good opportunity to consolidate the dev.bb material and also for people like me boost own coding skills. For my part, I want not just to face in the battle of Bot Wars, but show the same newcomers like me, what problems anyone can face as novice programmer in Byteball and generally.
As I already pointed out in the first week report, this bot should help to earn the first bytes. In turn, this project hooked me with another advantage and a solution to another problem. Any project should have its target audience with the help of which it could exist and develop. Six months ago, byteball launched Steam Attestation Airdrop. As the statistics showed, there were more than 70 thousand certified users! With this information in my head I had only thoughts - ‘WOW!’ But, there is only a question - “How many of these people are interested in byteball not only as a free distribution?”. Therefore, projects of various kinds are needed and they will in turn appear with a good developer community. In result, i want to give a virtual promotion tool for SteemIt users - just a few messages to the bot, the minimum payment and post begins rise up in list.
Main progress: database features, collection information for both side(workers, boosters), statistics for workers, payments with balance system, SteemAPI test, some interface features for usability and other small details.
At the start, when I built a plan for interaction with the bot, I thought that there is flexibility and you can easily build something like ‘interface’. And yes you can, but eventBus.on imposes some nuances of construction.
Since the bot helps to earn bytes and promote posts, we will have two types of accounts - earn_bytes and boost_post. In order for the bot to track at what stage the user and correctly read the messages in one or another role (as worker or as booster), we divide into separate steps - step_worker and step_booster.
In order for the user to start receiving bytes, we need to collect data about his steem account — SteemIt login, SteemPrivatePostKey, Byteball Wallet Address and also save the user's device_address — this will be the main identifier. When you click the Earn Bytes button, we write to the account type - earn_bytes. All data is written to the database, in a specially created users table using sqlite. After registration, the last step will display to us each time account statistics:
- How many was UpVotes done?
- How many was reposts done?
- How much money is earned - balance?
- Button to withdraw balance to the specified Byteball Wallet Address.
In order to promote posts, we need to ask the customer:
- Steemit login of post author
- PermLink of post (example: introducing-the-great-byteball-bot-war)
On this step I used ".split('/')" , to get from customers just link on post and then get from it last part.
- How many upvotes customer need?
- How many reposts customer need?
Next, calculate by the formula ‘UpVotePrice * upvote_target + RepostPrice * repost_target’ and send invoice. After receiving payment, change the status of the order to paid and start the promotion process. I write all the data into the database, into a specially created table boost_tasks using sqlite.
As a result, we have a base of steemit accounts that will promote posts and base of orders that needs to be promoted. It remains only to connect it all in one function using Steem API, that i alredy tested on this week and it works, for Upvote and Repost. Make withdraw balance function for workers. And MVP will be ready.