OSDN Git Service

modify readme for voterewatd (#370)
[bytom/vapor.git] / README.md
1 Vapor
2 ======
3
4 [![Build Status](https://travis-ci.org/Bytom/vapor.svg)](https://travis-ci.org/Bytom/vapor) [![AGPL v3](https://img.shields.io/badge/license-AGPL%20v3-brightgreen.svg)](./LICENSE)
5
6 **Golang implemented sidechain for Bytom.**
7
8 ## Requirements
9
10 - [Go](https://golang.org/doc/install) version 1.11 or higher, with `$GOPATH` set to your preferred directory
11
12 ## Get source code
13
14 ```
15 $ git clone https://github.com/Bytom/vapor.git $GOPATH/src/github.com/vapor
16 ```
17
18 Then, you have two ways to get vapor executable file:
19
20 1. compile source code
21 2. build it using Docker
22
23 ## Installation
24
25 ```
26 $ cd $GOPATH/src/github.com/vapor
27 $ make install
28 ```
29
30 ## Run Directly
31
32 Firstly, you need initialize node:
33
34 ```
35 $ vapord init --chain_id=mainnet --home <vapor-data-path>
36 ```
37
38 The default vapor data path (on the host) is:
39 + Mac: `~/Library/Application Support/Vapor`
40 + Linux: `~/.vapor`
41 + Windows: `%APPDATA%\Vapor`
42
43 Then, start your node:
44
45 ```
46 $ vapord node --home <vapor-data-path>
47 ```
48
49 ## Running in Docker
50
51 ### Build the image
52
53 ```
54 $ cd $GOPATH/src/github.com/vapor
55 $ docker build -t vapor .
56 ```
57
58 ### Enter the iterative mode
59
60 ```
61 $ docker run -it --net=host -v <vapor/data/directory/on/host/machine>:/root/.vapor vapor:latest
62 ```
63
64 vapor data directory has three config files:
65
66 - `config.toml`
67 - `federation.json`
68 - `node_key.txt`
69
70 Use `exit` to exit Docker's iterative mode.
71
72 ### Daemon mode
73
74 For example,
75
76 ```bash
77 $ docker run -d --net=host -v <vapor/data/directory/on/host/machine>:/root/.vapor vapor:latest vapord node --web.closed --auth.disable
78 ```
79
80 To list the running containners and check their container id, image, corresponding command, created time, status, name and ports being used:
81
82 ```
83 $ docker container ls
84 ```
85
86 or
87
88 ```
89 $ docker ps
90 ```
91
92 To execute a command inside a containner, for example:
93
94 ```
95 $ docker exec -it <containerId> vaporcli create-access-token <tokenId>
96 ```
97
98 To stop a running containner:
99
100 ```
101 $ docker stop <containerId>
102 ```
103
104 To remove a containner:
105
106 ```
107 $ docker rm <containerId>
108 ```
109
110 ### Reward distribution tool
111
112 After the supernode and alternative node receive the reward from the node, they will allocate the reward
113
114 according to the interest rate. 
115
116 The reward calculation rules: 
117
118  calculate the reward (consensus reward * interest rate * voting weight) according to the weight of votes
119
120 cast in consensus around, and choose how many rounds of consensus to allocate the reward flexibly.
121
122 [Tool usage details](./cmd/votereward/README.md)
123
124 ## License
125
126 [AGPL v3](./LICENSE)