Repository
https://github.com/semasping/Accusta
In 1.0.0 release of
:
- Add information about Benefactor rewards.
- New structure for pages with rewards with charts and ajax data loading.
- Bugfixes
Detailed information
New Features
In this release, I started adding charts so let’s look at the example of beneficiary reward to see reward pages form.
In the current release, I also added on-demand data download to the tables. Now it is possible to show data over all the time of the account exists.
How receiving beneficial rewards are implemented:
So far as all accounts’ data is stored in the MongoDB we can get all operations of the type:
comment_benefactor_reward
As there are cases when we need to handle a lot of data so I solved that the data for charts will be collected using the DB by the following request:
$data_by_monthes = $collection->aggregate([
[
'$match' => [
'type' => ['$eq' => 'comment_benefactor_reward'],
'op.benefactor' => ['$eq' => $acc]
]
],
['$unwind' => '$op'],
[
'$group' => [
'_id' => ['date' => ['M' => ['$month' => '$date'], 'Y' => ['$year' => '$date'],]],
'total' => ['$sum' => '$op.VESTS'],
'count' => ['$sum' => 1]
]
],
]);
We have two reward types:
those which are received by the account 'op.benefactor' => ['$eq' => $acc]
those which are given out by the account (i.e.from its posts) 'op.benefactor' => ['$ne' => $acc]
Data sampling for this kind of tables are proceeded by the request:
$data_by_monthes = $collection->aggregate([
[
'$match' => [
'date' => ['$gte' => $date_start, '$lt' => $date_end],
'type' => ['$eq' => 'comment_benefactor_reward'],
'op.benefactor' => [$typeQ => $acc]
]
]
]);
So we get monthly data, then handle them in foreach and convert them into desirable form.
foreach ($data_by_monthes as $state) {
if ($type == 'In') {
$arr['author'] = $state['op'][1]['author'];
}
if ($type == 'Out') {
$arr['author'] = $state['op'][1]['benefactor'];
}
$arr['permlink'] = $state['op'][1]['permlink'];
$arr['VESTS'] = $state['op'][1]['VESTS'];
$arr['SP'] = BchApi::convertToSg($state['op'][1]['VESTS']);
$arr['timestamp'] = $state['timestamp'];
$res_arr[] = $arr;
}
See more details here: app/Http/Controllers/BenefactorRewardsController.php
Bugfixes
Besides each release contains changes for data transfer from blockchain to the DB. I can’t find an error-free way so far. Any sort of bugs occurs all the time :(
I suppose it's needed to move on to the separate library for work with DB and to implement a full-value initial collection of data from blocks.
Commits in this release:
[update] readme semasping 17.05.2018 19:17
[update] benefactor code [update] readme semasping 17.05.2018 18:27
[update] information about out rewards by month semasping 15.05.2018 18:27
[add] information about out rewards by month semasping 15.05.2018 16:46
[add] information about out rewards by month semasping 15.05.2018 16:45
[update] benefactor rewards [add] information about rewards by month [add] sort in table for rewards semasping 15.05.2018 11:45
[update] for php client semasping 15.05.2018 2:26
[update] loading transactions semasping 10.05.2018 12:44
[update] composer semasping 10.05.2018 12:28
[update] notify failed load transactions jobs semasping 10.05.2018 4:24
[bugfix] add exception semasping 10.05.2018 4:17
[bugfix] add exception semasping 10.05.2018 4:15
[bugfix] add exception semasping 10.05.2018 4:14
[bugfix] add exception semasping 10.05.2018 4:11
[bugfix] add exception semasping 10.05.2018 4:07
[bugfix] remove echo laravel version semasping 10.05.2018 4:06
[update] notify about failed jobs in trnasactions semasping 10.05.2018 4:03
[update] transation count in DB semasping 08.05.2018 3:29
[update] benefactorRewards statistics [Add] more info semasping 08.05.2018 2:55
[update] benefactorRewards statistics [Add] more info semasping 08.05.2018 2:53
[update] benefactorRewards statistics semasping 08.05.2018 2:32
[new] benefactorRewards statistics semasping 08.05.2018 2:19
[update] PowerDown info from mongoDB semasping 03.05.2018 4:01
[bugfix] footer on steemit part semasping 03.05.2018 4:01
[bugfix] link and logo on witness votes page semasping 03.05.2018 3:49
[update] footer for steemit semasping 30.04.2018 14:07
This release it is the beginning of new development stage of the Accusta system.
Redesign of curation rewards will be next in line for development, i.e.:
- transferring to a separate page
- charts adding