OSDN Git Service

Merge pull request #1375 from Bytom/dev
[bytom/bytom.git] / README.md
1 Bytom
2 ====
3
4 [![Build Status](https://travis-ci.org/Bytom/bytom.svg)](https://travis-ci.org/Bytom/bytom) [![AGPL v3](https://img.shields.io/badge/license-AGPL%20v3-brightgreen.svg)](./LICENSE)
5
6 **Official golang implementation of the Bytom protocol.**
7
8 Automated builds are available for stable releases and the unstable master branch. Binary archives are published at https://github.com/Bytom/bytom/releases.
9
10 ## What is Bytom?
11
12 Bytom is software designed to operate and connect to highly scalable blockchain networks confirming to the Bytom Blockchain Protocol, which allows partipicants to define, issue and transfer digitial assets on a multi-asset shared ledger. Please refer to the [White Paper](https://github.com/Bytom/wiki/blob/master/White-Paper/%E6%AF%94%E5%8E%9F%E9%93%BE%E6%8A%80%E6%9C%AF%E7%99%BD%E7%9A%AE%E4%B9%A6-%E8%8B%B1%E6%96%87%E7%89%88.md) for more details.
13
14 In the current state `bytom` is able to:
15
16 - Manage key, account as well as asset
17 - Send transactions, i.e., issue, spend and retire asset
18
19
20 ## Building from source
21
22 ### Requirements
23
24 - [Go](https://golang.org/doc/install) version 1.8 or higher, with `$GOPATH` set to your preferred directory
25
26 ### Installation
27
28 Ensure Go with the supported version is installed properly:
29
30 ```bash
31 $ go version
32 $ go env GOROOT GOPATH
33 ```
34
35 - Get the source code
36
37 ``` bash
38 $ git clone https://github.com/Bytom/bytom.git $GOPATH/src/github.com/bytom
39 ```
40
41 - Build source code
42
43 ``` bash
44 $ cd $GOPATH/src/github.com/bytom
45 $ make bytomd    # build bytomd
46 $ make bytomcli  # build bytomcli
47 ```
48
49 When successfully building the project, the `bytom` and `bytomcli` binary should be present in `cmd/bytomd` and `cmd/bytomcli` directory, respectively.
50
51 ### Executables
52
53 The Bytom project comes with several executables found in the `cmd` directory.
54
55 | Command      | Description                                                  |
56 | ------------ | ------------------------------------------------------------ |
57 | **bytomd**   | bytomd command can help to initialize and launch bytom domain by custom parameters. `bytomd --help` for command line options. |
58 | **bytomcli** | Our main Bytom CLI client. It is the entry point into the Bytom 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 Bytom network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `bytomcli --help` and the [bytomcli Wiki page](https://github.com/Bytom/bytom/wiki/Command-Line-Options) for command line options. |
59
60 ## Running bytom
61
62 Currently, bytom 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 `bytom`. This section won't cover all the commands of `bytomd` and `bytomcli` at length, for more information, please the help of every command, e.g., `bytomcli help`.
63
64 ### Initialize
65
66 First of all, initialize the node:
67
68 ```bash
69 $ cd ./cmd/bytomd
70 $ ./bytomd init --chain_id mainnet
71 ```
72
73 There are three options for the flag `--chain_id`:
74
75 - `mainnet`: connect to the mainnet.
76 - `testnet`: connect to the testnet wisdom.
77 - `solonet`: standalone mode.
78
79 After that, you'll see `config.toml` generated, then launch the node.
80
81 ### launch
82
83 ``` bash
84 $ ./bytomd node
85 ```
86
87 available flags for `bytomd node`:
88
89 ```
90       --auth.disable                Disable rpc access authenticate
91       --chain_id string             Select network type
92   -h, --help                        help for node
93       --mining                      Enable mining
94       --p2p.dial_timeout int        Set dial timeout (default 3)
95       --p2p.handshake_timeout int   Set handshake timeout (default 30)
96       --p2p.laddr string            Node listen address.
97       --p2p.max_num_peers int       Set max num peers (default 50)
98       --p2p.pex                     Enable Peer-Exchange  (default true)
99       --p2p.seeds string            Comma delimited host:port seed nodes
100       --p2p.skip_upnp               Skip UPNP configuration
101       --prof_laddr string           Use http to profile bytomd programs
102       --vault_mode                  Run in the offline enviroment
103       --wallet.disable              Disable wallet
104       --wallet.rescan               Rescan wallet
105       --web.closed                  Lanch web browser or not
106       --simd.enable                 Enable the _simd_ feature to speed up the _PoW_ verification (e.g., during mining and block verification)
107 ```
108
109 Given the `bytomd` node is running, the general workflow is as follows:
110
111 - create key, then you can create account and asset.
112 - send transaction, i.e., build, sign and submit transaction.
113 - query all kinds of information, let's say, avaliable key, account, key, balances, transactions, etc.
114
115 __simd feature:__
116
117 You could enable the _simd_ feature to speed up the _PoW_ verification (e.g., during mining and block verification) by simply:
118 ```
119 bytomd node --simd.enable
120 ```
121
122 To enable this feature you will need to compile from the source code by yourself, and `make bytomd-simd`. 
123
124 What is more,
125
126 + if you are using _Mac_, please make sure _llvm_ is installed by `brew install llvm`.
127 + if you are using _Windows_, please make sure _mingw-w64_ is installed and set up the _PATH_ environment variable accordingly.
128
129 For more details about using `bytomcli` command please refer to [API Reference](https://github.com/Bytom/bytom/wiki/API-Reference)
130
131 ### Dashboard
132
133 Access the dashboard:
134
135 ```
136 $ open http://localhost:9888/
137 ```
138
139 ### In Docker
140
141 Ensure your [Docker](https://www.docker.com/) version is 17.05 or higher.
142
143 ```bash
144 $ docker build -t bytom .
145 ```
146
147 For the usage please refer to [running-in-docker-wiki](https://github.com/Bytom/bytom/wiki/Running-in-Docker).
148
149 ## Contributing
150
151 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!
152
153 If you run into an issue, feel free to [bytom issues](https://github.com/Bytom/bytom/issues/) in this repository. We are glad to help!
154
155 ## License
156
157 [AGPL v3](./LICENSE)