OSDN Git Service

Modify readme
[bytom/vapor.git] / README.md
1 Vapor
2 ====
3
4 [![Build Status](https://travis-ci.org/Bytom/bytom.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 ## What is Vapor?
9
10 Vapor is software designed to extensions to the Bytom protocol, which allows partipicants to define, issue and transfer digitial assets on a multi-asset shared ledger or networks pegged to Bytom as a sidechain or run as a standalone blockchain.
11
12
13 ## Building from source
14
15 ### Requirements
16
17 - [Go](https://golang.org/doc/install) version 1.11.4 or higher, with `$GOPATH` set to your preferred directory
18
19 ### Installation
20
21 Ensure Go with the supported version is installed properly:
22
23 ```bash
24 $ go version
25 $ go env GOROOT GOPATH
26 ```
27
28 - Get the source code
29
30 ``` bash
31 $ git clone https://github.com/bytom/vapor.git $GOPATH/src/github.com/vapor
32 ```
33
34 - Build source code
35
36 ``` bash
37 $ cd $GOPATH/src/github.com/vapor
38 $ make vapor    # build vapor
39 $ make vaporcli  # build vaporcli
40 ```
41
42 When successfully building the project, the `vapor` and `vaporcli` binary should be present in `cmd/vapor` and `cmd/vaporcli` directory, respectively.
43
44 ### Executables
45
46 The Vapor project comes with several executables found in the `cmd` directory.
47
48 | Command      | Description                                                  |
49 | ------------ | ------------------------------------------------------------ |
50 | **vapor**   | vapor command can help to initialize and launch vapor domain by custom parameters. `vapor --help` for command line options. |
51 | **vaporcli** | Our main Vapor CLI client. It is the entry point into the Vapor network (main-, test- or private net), capable of running as a full node archive node (retaining all historical state). It can be used by other processes as a gateway into the Vapor network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `vaporcli --help`. |
52
53 ## Running vapor
54
55 Currently, vapor is still in active development and a ton of work needs to be done, but we also provide the following content for these eager to do something with `vapor`. This section won't cover all the commands of `vapor` and `vaporcli` at length, for more information, please the help of every command, e.g., `vaporcli help`.
56
57 ### Initialize
58
59 First of all, initialize the node:
60
61 ```bash
62 $ cd ./cmd/vapor
63 $ ./vapor init --chain_id mainnet
64 ```
65
66 There are three options for the flag `--chain_id`:
67
68 - `mainnet`: connect to the mainnet.
69 - `testnet`: connect to the testnet wisdom.
70 - `solonet`: standalone mode.
71
72 After that, you'll see `config.toml` generated, then launch the node.
73
74 ### launch
75
76 ``` bash
77 $ ./vapor node
78 ```
79
80 available flags for `vapor node`:
81
82 ```
83       --auth.disable                            Disable rpc access authenticate
84       --chain_id string                         Select network type
85   -h, --help                                    help for node
86       --log_file string                         Log output file
87       --log_level string                        Select log level(debug, info, warn, error or fatal
88       --mainchain.mainchain_rpc_host string     The address which the daemon will try to connect to validate peg-ins, if enabled. (default "127.0.0.1")
89       --mainchain.mainchain_rpc_port string     The port which the daemon will try to connect to validate peg-ins, if enabled. (default "9888")
90       --mainchain.mainchain_token string        The rpc token that the daemon will use to connect to validate peg-ins, if enabled.
91       --mining                                  Enable mining
92       --p2p.dial_timeout int                    Set dial timeout (default 3)
93       --p2p.handshake_timeout int               Set handshake timeout (default 30)
94       --p2p.laddr string                        Node listen address. (0.0.0.0:0 means any interface, any port) (default "tcp://0.0.0.0:46656")
95       --p2p.max_num_peers int                   Set max num peers (default 50)
96       --p2p.pex                                 Enable Peer-Exchange  (default true)
97       --p2p.seeds string                        Comma delimited host:port seed nodes
98       --p2p.skip_upnp                           Skip UPNP configuration
99       --prof_laddr string                       Use http to profile bytomd programs
100       --side.fedpeg_xpubs string                Change federated peg to use a different xpub.
101       --side.parent_genesis_block_hash string    (default "a75483474799ea1aa6bb910a1a5025b4372bf20bef20f246a2c2dc5e12e8a053")
102       --side.pegin_confirmation_depth uint      Pegin claims must be this deep to be considered valid. (default: 6) (default 6)
103       --side.sign_block_xpubs string            Change federated peg to use a different xpub.
104       --signer string                           The signer corresponds to xpub of signblock
105       --validate_pegin                          Validate pegin claims. All functionaries must run this.
106       --vault_mode                              Run in the offline enviroment
107       --wallet.disable                          Disable wallet
108       --wallet.rescan                           Rescan wallet
109       --web.closed                              Lanch web browser or not
110
111 ```
112
113 Given the `vapor` node is running, the general workflow is as follows:
114
115 - create key, then you can create account.
116 - send transaction, i.e., build, sign and submit transaction.
117 - query all kinds of information, let's say, avaliable key, account, key, balances, transactions, etc.
118
119 ### Dashboard
120
121 Access the dashboard:
122
123 ```
124 $ open http://localhost:8888/
125 ```
126
127 ### Sidechain
128
129 * [Sidechain deployment](docs/vapor-docs/0.1/core/vapor-deployment.md)
130
131 ## Contributing
132
133 Thank you for considering helping out with the source code! Any contributions are highly appreciated, and we are grateful for even the smallest of fixes!
134
135 If you run into an issue, feel free to [vapor issues](https://github.com/bytom/vapor/issues/) in this repository. We are glad to help!
136
137 ## License
138
139 [AGPL v3](./LICENSE)