定制 wpbc/metahash-rewards 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wpbc/metahash-rewards

Composer 安装命令:

composer require wpbc/metahash-rewards

包简介

Automated PHP script for paying Metahash delegation rewards.

关键字:

README 文档

README

Metahash Rewards is a automated PHP script to pay bonus rewards to delegators from MetaHash nodes.

Requirements

  • PHP 7.1+
  • composer
  • xboston/metahash-php 0.2.*

Installation

  1. Open your terminal and change the current working directory to the location where you want the cloned directory to be made.
$ cd path/to/your/folder/metahash-rewards/
  1. Clone repository by typing the following in your terminal:
$ git clone git@github.com:WPBC/metahash-rewards.git
  1. Run the following command in your terminal.
$ composer install
  1. Open the index.php and enter your node details in the $nodes array.
$nodes = [
  'address'         => '', // Node address. Example - 0x0....
  'private_key'     => '', // Node private Key. Example 3074020... or 3077020...
  'data'            => '', // Text data sent with transaction. Example - Reward from my SuperNode
  'percentage'      => 80, // Default percentage paid to delegators.
  'superAddresses'  => $superAddresses
];
  1. To skip payments on certain addresses, add the address to the $skipAddresses array.
$skipAddresses = [
    '0x0072578dg76acc75554erg84es81seg4esg14se84841wfaw87',
    '0x00256841dg47csca774de4gib6154see8451ff151841ddsd11'
];
  1. Add any addresses that get paid different percentages from default percentage to the $superAddresses array.
$superAddresses = [
    '0x0072578dg76acc75554erg84es81seg4esg14se84841wfaw87' => 90, // 90%
    '0x00256841dg47csca774de4gib6154see8451ff151841ddsd11' => 85, // 83%
];
  1. To automatically run the reward script. Firstly, run the following command in your terminal to open crontab.
$ crontab -e
  1. Set the PHP script to run at 0:02 am everyday by adding the following line to you crontab and pressing enter.
$ 2 0 * * * /usr/bin/php /metahash-rewards/example/index.php >> /metahash-rewards/example/log.log 2>&1

Debug Mode

Debug mode is initially enabled. Whilst in debug, the script will return an array of effective delegations, grouped by address. please note that payments will not be sent.

To disable debug mode, open index.php and set $node->debug to "false".

$rewards->debug = true;

License

This package is released under the MIT license.

统计信息

  • 总下载量: 48
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 6
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固