OSDN Git Service

Merge pull request #1829 from Bytom/dashboard
[bytom/bytom.git] / README.md
index fbbac76..985023d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,26 +1,11 @@
 Bytom
-=====
+======
 
-[![AGPL v3](https://img.shields.io/badge/license-AGPL%20v3-brightgreen.svg)](./LICENSE)
+[![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)
 
-## Table of Contents
-<!-- vim-markdown-toc GFM -->
+**Official golang implementation of the Bytom protocol.**
 
-* [What is Bytom?](#what-is-bytom)
-* [Build from source](#build-from-source)
-  * [Requirements](#requirements)
-  * [Installation](#installation)
-    * [Get the source code](#get-the-source-code)
-    * [Build](#build)
-* [Example](#example)
-  * [Create and launch a single node](#create-and-launch-a-single-node)
-    * [Asset issuance test](#asset-issuance-test)
-  * [Set up a wallet and manage the key](#set-up-a-wallet-and-manage-the-key)
-  * [Multiple node](#multiple-node)
-* [Contributing](#contributing)
-* [License](#license)
-
-<!-- vim-markdown-toc -->
+Automated builds are available for stable releases and the unstable master branch. Binary archives are published at https://github.com/Bytom/bytom/releases.
 
 ## What is Bytom?
 
@@ -28,10 +13,16 @@ Bytom is software designed to operate and connect to highly scalable blockchain
 
 In the current state `bytom` is able to:
 
-- Issue assets
-- Manage account as well as asset
+- Manage key, account as well as asset
+- Send transactions, i.e., issue, spend and retire asset
+
+## Installing with Homebrew
+
+```
+brew tap bytom/bytom && brew install bytom
+```
 
-## Build from source
+## Building from source
 
 ### Requirements
 
@@ -46,165 +37,141 @@ $ go version
 $ go env GOROOT GOPATH
 ```
 
-#### Get the source code
+- Get the source code
 
 ``` bash
-$ git clone https://github.com/Bytom/bytom $GOPATH/src/github.com/bytom
+$ git clone https://github.com/Bytom/bytom.git $GOPATH/src/github.com/bytom/bytom
 ```
 
-#### Build
-
-- Bytomd
+- Build source code
 
 ``` bash
-$ cd $GOPATH/src/github.com/bytom
-$ make install
-$ cd ./cmd/bytomd
-$ go build
+$ cd $GOPATH/src/github.com/bytom/bytom
+$ make bytomd    # build bytomd
+$ make bytomcli  # build bytomcli
 ```
 
-- Bytomcli
+When successfully building the project, the `bytomd` and `bytomcli` binary should be present in `cmd/bytomd` and `cmd/bytomcli` directory, respectively.
 
-```go
-$ cd $GOPATH/src/github.com/bytom/cmd/bytomcli
-$ go build
-```
+### Executables
 
-## Example
+The Bytom project comes with several executables found in the `cmd` directory.
 
-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`.
+| Command      | Description                                                  |
+| ------------ | ------------------------------------------------------------ |
+| **bytomd**   | bytomd command can help to initialize and launch bytom domain by custom parameters. `bytomd --help` for command line options. |
+| **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. |
 
-### Create and launch a single node
+## Running bytom
 
-When successfully building the project, the `bytom` and `bytomcli` binary should be present in `cmd/bytom/bytom` and `cmd/bytomcli/bytomcli`, respectively. The next step is to initialize the node:
+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`.
 
-```bash
-$ cd ./cmd/bytomd
-$ ./bytomd init --home ./.bytom
-```
+### Initialize
 
-After that, you'll see `.bytom` generated in current directory, then launch the single node:
+First of all, initialize the node:
 
-``` bash
-$ ./bytomd node --home ./.bytom
+```bash
+$ cd ./cmd/bytomd
+$ ./bytomd init --chain_id mainnet
 ```
 
-#### Asset issuance test
+There are three options for the flag `--chain_id`:
 
-Given the `bytom` node is running, the general workflow is as follows:
+- `mainnet`: connect to the mainnet.
+- `testnet`: connect to the testnet wisdom.
+- `solonet`: standalone mode.
 
-- create an account
-- create an asset
-- create/sign/submit a transaction to transfer an asset
-- query the assets on-chain
+After that, you'll see `config.toml` generated, then launch the node.
 
-Create an account named `alice`:
+### launch
 
-```bash
-$ ./bytomcli create-account alice
-xprv:<alice_account_private_key>
-responses:{acc04K9MCFBG0A04 alice [0xc4200966e0] 1 0xc4204be220}
-account id:<alice_account_id>
+``` bash
+$ ./bytomd node
 ```
 
-Create an asset named `gold`:
+available flags for `bytomd node`:
 
-```bash
-$ ./bytomcli create-asset gold
-xprv:<gold_asset_private_key>
-xpub:[98 55 100 48 102 100 53 101 54 55 55 49 48 52 97 100 50 100 51 51 98 49 56 98 98 100 55 55 50 51 98 53 102 51 101 97 56 55 49 52 48 53 57 54 50 56 55 48 49 97 50 99 97 100 101 51 51 102 100 100 97 53 56 51 49 54 97 50 57 54 101 49 102 100 48 102 53 57 99 55 50 49 53 98 50 54 55 102 50 52 102 52 54 50 48 101 51 48 102 55 99 51 50 56 49 102 97 52 99 55 97 53 102 50 57 97 100 53 51 100 56 100 55 56 50 50 98 98]
-responses:[{{4131000809721133708 15036469059929217352 9712753415038655527 16992088508821480533} gold [118 107 170 32 152 106 231 249 212 15 215 121 94 191 102 23 231 61 38 211 121 176 221 199 48 173 145 207 243 201 82 0 215 2 72 243 81 81 173 105 108 0 192] [0xc420020850] 1 0xc4204c1960 0xc4204c1980 true}]
-asset id:<gold_asset_id>
 ```
-
-Now we can transafer `<gold_asset_amount>` gold to `alice` using a single command `sub-create-issue-tx`:
-
-```bash
-$ ./bytomcli sub-create-issue-tx <alice_account_id> <gold_asset_id> <asset_private_key> <gold_asset_amount>
-To build transaction:
------------tpl:{version:1 serialized_size:314 result_ids:<71c3b949750c887e466422007cdd1a6a9f3449e3bacd43307e361e84d76fe37b> data:<130994550772:/* unknown wire type 7 */ 1642:/* unknown wire type 7 */ 10:17681930801800169409 159728:7652 9:4897805654558278394 9:/* unexpected EOF */ >min_time_ms:1506587706078 max_time_ms:1506588006078  [0xc4204c9060 0xc4204c91e0] true false}
-----------tpl transaction:version:1 serialized_size:314 result_ids:<71c3b949750c887e466422007cdd1a6a9f3449e3bacd43307e361e84d76fe37b> data:<130994550772:/* unknown wire type 7 */ 1642:/* unknown wire type 7 */ 10:17681930801800169409 159728:7652 9:4897805654558278394 9:/* unexpected EOF */ >min_time_ms:1506587706078 max_time_ms:1506588006078 
-----------btm inputs:&{1 [123 125] asset_id:</* proto: integer overflow */ >amount:1470000000000000000  [] []}
-----------issue inputs:&{1 [] 0xc4204c4120 [] []}
-xprv_asset:a89d5d5fa68af8ca8408d405db180bc5b2652d7f34bca753531861be3c1cbb6216a296e1fd0f59c7215b267f24f4620e30f7c3281fa4c7a5f29ad53d8d7822bb
-sign tpl:{version:1 serialized_size:314 result_ids:<71c3b949750c887e466422007cdd1a6a9f3449e3bacd43307e361e84d76fe37b> data:<130994550772:/* unknown wire type 7 */ 1642:/* unknown wire type 7 */ 10:17681930801800169409 159728:7652 9:4897805654558278394 9:/* unexpected EOF */ >min_time_ms:1506587706078 max_time_ms:1506588006078  [0xc4204c9060 0xc4204c91e0] true false}
-sign tpl's SigningInstructions:&{0 [0xc420010670]}
-SigningInstructions's SignatureWitnesses:&{0 [] [32 254 83 225 251 124 27 13 126 32 0 93 132 151 197 166 125 64 222 168 154 133 219 122 187 130 169 176 160 166 8 49 145 174 135] []}
-submit transaction:[map[id:cc4313fbae424bb945029adef193154f34de324316036e510bcc751d0013ccb7]]
+Flags:
+      --auth.disable                     Disable rpc access authenticate
+      --chain_id string                  Select network type
+  -h, --help                             help for node
+      --log_file string                  Log output file (default "log")
+      --log_level string                 Select log level(debug, info, warn, error or fatal)
+      --mining                           Enable mining
+      --p2p.dial_timeout int             Set dial timeout (default 3)
+      --p2p.handshake_timeout int        Set handshake timeout (default 30)
+      --p2p.keep_dial string             Peers addresses try keeping connecting to, separated by ',' (for example "1.1.1.1:46657;2.2.2.2:46658")
+      --p2p.laddr string                 Node listen address. (0.0.0.0:0 means any interface, any port) (default "tcp://0.0.0.0:46656")
+      --p2p.lan_discoverable             Whether the node can be discovered by nodes in the LAN (default true)
+      --p2p.max_num_peers int            Set max num peers (default 50)
+      --p2p.node_key string              Node key for p2p communication
+      --p2p.proxy_address string         Connect via SOCKS5 proxy (eg. 127.0.0.1:1086)
+      --p2p.proxy_password string        Password for proxy server
+      --p2p.proxy_username string        Username for proxy server
+      --p2p.seeds string                 Comma delimited host:port seed nodes
+      --p2p.skip_upnp                    Skip UPNP configuration
+      --prof_laddr string                Use http to profile bytomd programs
+      --simd.enable                      Enable SIMD mechan for tensority
+      --vault_mode                       Run in the offline enviroment
+      --wallet.disable                   Disable wallet
+      --wallet.rescan                    Rescan wallet
+      --wallet.txindex                   Save global tx index
+      --web.closed                       Lanch web browser or not
+      --ws.max_num_concurrent_reqs int   Max number of concurrent websocket requests that may be processed concurrently (default 20)
+      --ws.max_num_websockets int        Max number of websocket connections (default 25)
+
+Global Flags:
+      --home string   root directory for config and data
+  -r, --root string   DEPRECATED. Use --home (default "/Users/zcc/Library/Application Support/Bytom")
+      --trace         print out full stack trace on errors
 ```
 
-Query the assets on-chain:
-```bash
-$ ./bytomcli list-balances
-0 ----- map[<gold_asset_id>:<gold_asset_amount>]
-```
+Given the `bytomd` node is running, the general workflow is as follows:
 
-### Set up a wallet and manage the key
+- create key, then you can create account and asset.
+- send transaction, i.e., build, sign and submit transaction.
+- query all kinds of information, let's say, avaliable key, account, key, balances, transactions, etc.
 
-If you have started a bytom node, then you can create an account via `create-key password`, which will generate a `keystore` directory containing the keys under the project directory.
+__simd feature:__
 
-```bash
-$ ./bytomcli create-key account_name password   # Create an account named account_name using password
-$ ./bytomcli delete-key password pubkey         # Delete account pubkey
-$ ./bytomcli reset-password oldpassword newpassword pubkey  # Update password
+You could enable the _simd_ feature to speed up the _PoW_ verification (e.g., during mining and block verification) by simply:
+```
+bytomd node --simd.enable
 ```
 
-### Multiple node
+To enable this feature you will need to compile from the source code by yourself, and `make bytomd-simd`. 
 
-Get the submodule depenency for the two-node test:
+What is more,
 
-```bash
-$ git submodule update --init --recursive
-```
++ if you are using _Mac_, please make sure _llvm_ is installed by `brew install llvm`.
++ if you are using _Windows_, please make sure _mingw-w64_ is installed and set up the _PATH_ environment variable accordingly.
 
-Create the first node `bytomd0` and second node `bytomd1`:
+For more details about using `bytomcli` command please refer to [API Reference](https://github.com/Bytom/bytom/wiki/API-Reference)
 
-```bash
-$ cd cmd/bytomd/2node-test
-$ ./test.sh bytomd0  # Start the first node
-$ ./test.sh bytomd1  # Start the second node
-```
+### Dashboard
 
-Then we have two nodes:
+Access the dashboard:
 
-```bash
-$ curl -X POST --data '{"jsonrpc":"2.0", "method": "net_info", "params":[], "id":"67"}' http://127.0.0.1:46657
+```
+$ open http://localhost:9888/
 ```
 
-If everything goes well, we'll see the following response:
+### In Docker
+
+Ensure your [Docker](https://www.docker.com/) version is 17.05 or higher.
 
 ```bash
-{
-  "jsonrpc": "2.0",
-  "id": "67",
-  "result": {
-    "listening": true,
-    "listeners": [
-      "Listener(@192.168.199.178:3332)"
-    ],
-    "peers": [
-      {
-        "node_info": {
-          "pub_key": "03571A5CE8B35E95E2357DB2823E9EB76EB42D5CCC5F8E68315388832878C011",
-          "moniker": "anonymous",
-          "network": "chain0",
-          "remote_addr": "127.0.0.1:51058",
-          "listen_addr": "192.168.199.178:3333",
-          "version": "0.1.0",
-          "other": [
-            "wire_version=0.6.2",
-            "p2p_version=0.5.0",
-            "rpc_addr=tcp://0.0.0.0:46658"
-          ]
-        },
-......
+$ docker build -t bytom .
 ```
 
+For the usage please refer to [running-in-docker-wiki](https://github.com/Bytom/bytom/wiki/Running-in-Docker).
+
 ## Contributing
 
-Thank you for considering to help out with the source code! Any contributions are highly appreciated, and we are grateful for even the smallest of fixes!
+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!
 
-If you run into an issue, feel free to [file one](https://github.com/Bytom/bytom/issues/) in this repository. We are glad to help!
+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!
 
 ## License