OSDN Git Service

feat(warder): add warder backbone (#181)
[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=vapor --home <vapor-data-path>
36 ```
37
38 For example, you can store vapor data in `$HOME/bytom/vapor`:
39
40 ```
41 $ vapord init --chain_id=vapor --home $HOME/bytom/vapor
42 ```
43
44 Then, start your node:
45
46 ```
47 $ vapord node --home <vapor-data-path>
48 ```
49
50 ## Running in Docker
51
52 ### Build the image
53
54 ```
55 $ cd $GOPATH/src/github.com/vapor
56 $ docker build -t vapor .
57 ```
58
59 ### Enter the iterative mode
60
61 ```
62 $ docker run -it --net=host -v <vapor/data/directory/on/host/machine>:/root/.vapor vapor:latest
63 ```
64
65 vapor data directory has three config files:
66
67 - `config.toml`
68 - `federation.json`
69 - `node_key.txt`
70
71 Use `exit` to exit Docker's iterative mode.
72
73 ### Daemon mode
74
75 For example,
76
77 ```bash
78 $ docker run -d --net=host -v <vapor/data/directory/on/host/machine>:/root/.vapor vapor:latest vapord node --web.closed --auth.disable
79 ```
80
81 To list the running containners and check their container id, image, corresponding command, created time, status, name and ports being used:
82
83 ```
84 $ docker container ls
85 ```
86
87 or
88
89 ```
90 $ docker ps
91 ```
92
93 To execute a command inside a containner, for example:
94
95 ```
96 $ docker exec -it <containerId> vaporcli create-access-token <tokenId>
97 ```
98
99 To stop a running containner:
100
101 ```
102 $ docker stop <containerId>
103 ```
104
105 To remove a containner:
106
107 ```
108 $ docker rm <containerId>
109 ```
110
111 ## License
112
113 [AGPL v3](./LICENSE)