[Accusta] Witness`s rewards (v 0.7)

in #utopian-io6 years ago (edited)

Now you can see How much you erned by your Witness Node. Go to https://steemit.accusta.tk.
Enter any account and you can view statistics. Use by yourself and tell the others Witnesses

In 0.7 release of accusta_logo_line_170.png:

  • Added Witness`s rewards
  • Added possibility to Async Load some informations as widget
    link to release

More information about coding

At first we must find information about rewards.
in account_history we see:

array:6 [▼
      "producer" => "prc"
      "vesting_shares" => "1972.244089 VESTS"
      "trx_id" => "0000000000000000000000000000000000000000"
      "block" => 17712125
      "timestamp" => "2017-12-01T19:08:33"
      "op" => "producer_reward"
    ]

That is all we need.
For showing infomation on page we will use new component laravel-wigets by arrilot

With laravel and this new packege we can enter in command line

php artisan make:widget WitnessRewards

that get us two new files:

  • app/Widgets/WitnessRewards.php
  • resources/views/widgets/witness_rewards.blade.php

In WitnessRewards class we collected all data about producer_reward from account_history

$data = collect(BchApi::getTransaction($acc, 'producer_reward'));
//dump($data);
$data = $data->map(function ($item, $key) {
    $data = $item;
    if (getenv('BCH_API') == 'golos') {
        $data['GESTS'] = str_replace(' GESTS', '', $item['vesting_shares']);
    }
    if (getenv('BCH_API') == 'steemit') {
        $data['VESTS'] = str_replace(' VESTS', '', $item['vesting_shares']);
    }
    return $data;
});

result we transfer to view:

return view(getenv('BCH_API') . '.widgets.witness_rewards', [
    'config' => $this->config,
    'account' => $acc,
    'data' => $data,
]);

Then in view (resources/views/steemit/widgets/witness_rewards.blade.php) we can design all information as we want. I decided to show information in table by some time period.

View file is big You can view it on github: https://github.com/semasping/Accusta/blob/0.7/resources/views/steemit/widgets/witness_rewards.blade.php

This release base on commits:

https://github.com/semasping/Accusta/commits/master

accusta_logo_line_170.png roadmap:

  • Wittness SP rewards (Done)
  • Benefactor SP rewards
  • rework post and authors rewards (to show together)
  • more graphs and charts
  • rework collecting data (to use mongoDb for storage transaction history)



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @semasping I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Ups
There is some errors in witnesses rewards
Working on it.
For top witnesses a lot of transactions and neet to change collecting metod...

I look forward to it! I love what you have done already.

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

I looked at the statistics. Thank you for your work.

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.030
BTC 63574.15
ETH 3404.81
USDT 1.00
SBD 2.54