OSDN Git Service

f469dcf2d04511e79171aa16183313b2aa30dab6
[bytom/vapor.git] / cmd / votereward / README.md
1 ## database
2
3 - Create a MySQL database locally or with server installation
4 - Import table structure to MySQL database, table structure path:  vapor/toolbar/vote_reward/database/dump_reward.sql
5
6
7
8 ## configuration file
9
10 - Default file name:reward.json
11 - A `reward.json` would look like this:
12
13 ```json
14 {
15   "node_ip": "http://127.0.0.1:9889", // node API address, replace with self node  API address
16   "chain_id": "mainnet", //Node network type
17   "mysql": { // Mysql connection information
18     "connection": {
19       "host": "192.168.30.186",
20       "port": 3306,
21       "username": "root",
22       "password": "123456",
23       "database": "reward"
24     },
25     "log_mode": false // default
26   },
27   "reward_config": {
28     "xpub": "9742a39a0bcfb5b7ac8f56f1894fbb694b53ebf58f9a032c36cc22d57a06e49e94ff7199063fb7a78190624fa3530f611404b56fc9af91dcaf4639614512cb64", // Node public key (from dashboard Settings), replaced with its own
29     "account_id": "bd775113-49e0-4678-94bf-2b853f1afe80", // accountID
30     "password": "123456",// The password corresponding to the account ID
31     "reward_ratio": 20,// The percentage of a reward given to a voter per block
32     "mining_address": "sp1qfpgjve27gx0r9t7vud8vypplkzytgrvqr74rwz" // The address that receives the block reward, use the get-mining- address for mining address, for example, curl -x POST http://127.0.0.1:9889/get-mining-address -d '{}'
33   }
34 }
35 ```
36
37
38
39 tool use
40
41 params
42
43 ```shell
44 distribution of reward.
45
46 Usage:
47   reward [flags]
48
49 Flags:
50       --config_file string         config file. default: reward.json (default "reward.json")
51   -h, --help                       help for reward
52       --reward_end_height uint     The end height of the distributive income reward interval, It is a multiple of the dpos consensus cycle(1200). example: 2400
53       --reward_start_height uint   The starting height of the distributive income reward interval, It is a multiple of the dpos consensus cycle(1200). example: 1200
54 ```
55
56 example:
57
58 ```shell
59 ./votereward reward --reward_start_height 6000 --reward_end_height 7200
60 ```
61
62
63
64 Note: 
65
66 When an error (Gas credit has been spent) is returned, UTXO needs to be merged.