SteemPlus API Updates : Fix Delegation and Weekly Bonus Payouts + Ads API

in #utopian-io6 years ago

Hi Steemians,

We have made a few updates, mostly to fix some issues regarding SPP distribution, and to make it easier for us to replay our algorithm after pushing some fixes.

Replay

Something that I ve pushed back for too long and was doing manually every time.
When some new code is pushed and must affect the previous blocks as well, a replay is needed. The database needs to be cleared and all the jobs regarding SPP calculation need to be relaunched.
I've created an endpoint that launches an algorithm to execute this replay.

// Starting replay to get all the SPP since they were released.
    console.log("Starting Replay...");
    console.log("Updating SteemPlus Points for comments transfers and reblogs");
    await spp.updateSteemplusPoints();
    console.log("Done updating SPP");
    console.log("Starting Delegations");
    await spp.payDelegations();
    console.log("Done rewarding delegations");
    console.log("Debiting premium subscriptions");
    await premium.debitPremium();
    console.log("Done debiting");
    console.log("Start paying weekly rewards");
    await spp.payWeeklyRewards();
    console.log("Done paying daily rewards");
    console.log("Loading ads");
    await ads.add();
    console.log("Done loading ads");
    console.log("Done replaying");

You can try and see the calculation of SPP by running localhost:3000/replay/[MASTER]
[MASTER] being a password set in your .env file.

When I ll have time, I ll completely change the SPP calculation to a block streaming method, instead of using SteemSQL.

Fixing SPP rewards for delegations

After talking with @masoom, I realized that delegations rewards were broken in a very specific case : when a user delegated to @steem-plus, undelegated then delegated again.
This is now fixed. Delegate to us to get more SPP ! ;)

Fixing SPP weekly bonus rewards

At the end of each week (sunday night), the 10 top SPP earners will get extra SPP.
There was a problem with the computation of this bonus, that has now been fixed. Thanks @jason7282 for reporting the issue!

For information, you can check your current rank on steemplus.app, on the Ranking tab.

Ads

This update also included the addition of endpoints used for the Ads feature, coming soon on SteemPlus.

Repository:

https://github.com/stoodkev/steemplus-api

Pull Request

Wanna contribute?

Join us on Discord

How to test this code?

  • Subscribe to SteemSQL (10 SBD/month)
  • Clone this repository
  • npm install
  • Set the environment variables (information received by transfer when you subscribe to SteemSQL). These environment variables are LOGIN, PASSWORD, SQL_API and DB.
  • npm run start
  • You should be able to test it on localhost:3000.



@stoodkev and @cedricguillas for @steem-plus

Powered by @adsactly

Powered by @utopian-io

Like what I do? Vote @stoodkev for witness!

Sort:  

From a reviewer/3rd party stand point, It would have been better if we see the different features sets merged in different batches.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @emrebeyler! Keep up the good work!

I support your work, but i don't understand much ;-)))) Thank you. Kadna

This post has been just added as new item to timeline of SteemPlus on Steem Projects.

If you want to be notified about new updates from this project, register on Steem Projects and add SteemPlus to your favorite projects.

Congratulations @steem-plus! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 51000 upvotes. Your next target is to reach 52000 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem 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!

Do not miss the last post from @steemitboard:

The Steem blockchain survived its first virus plague!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Que éxito 👏👏👏👏

Les invitamos a seguir de cerca el MeetUp Steem VotoVzla que los integrantes del equipo @votovzla realizaremos mañana en El Tigre Edo Anzoátegui Venezuela 🤗

IMG_20190404_191138_813.jpgmañana

Hi @steem-plus :) I noticed that I lost over 2k SPP after y'all updated the API. I'm not sure why this is though because I didn't notice this with other users. Any idea why this might be?

@artbyclark I ll DM you on Discord so we can try and figure that out.

Hi @steem-plus!

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

Always glad to help :)

Posted using Partiko iOS

Hey, @steem-plus!

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!

Magic Dice has rewarded your post with a 44% upvote. Thanks for playing Magic Dice.

Coin Marketplace

STEEM 0.20
TRX 0.19
JST 0.034
BTC 91309.02
ETH 3119.19
USDT 1.00
SBD 2.91