OSDN Git Service

add store test (#1632)
[bytom/bytom.git] / README.md
index 9c21f81..98107b3 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)
-  * [Set up a wallet and manage the key](#set-up-a-wallet-and-manage-the-key)
-  * [Create and launch a single node](#create-and-launch-a-single-node)
-    * [Asset issuance test](#asset-issuance-test)
-  * [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
 
-## Build from source
+```
+brew tap bytom/bytom && brew install bytom
+```
+
+## Building from source
 
 ### Requirements
 
@@ -46,124 +37,125 @@ $ 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
 ```
 
-#### Build
-
-- Bytom
+- Build source code
 
 ``` bash
 $ cd $GOPATH/src/github.com/bytom
-$ make install
-$ cd ./cmd/bytom
-$ go build
+$ make bytomd    # build bytomd
+$ make bytomcli  # build bytomcli
 ```
 
-- Bytomcli
+When successfully building the project, the `bytom` 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. |
 
-### Set up a wallet and manage the key
+## Running bytom
 
-You can create an account via `create-key password`, which will generate a `keystore` file containing the keys under the project 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`. 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`.
+
+### Initialize
+
+First of all, initialize the node:
 
 ```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
+$ cd ./cmd/bytomd
+$ ./bytomd init --chain_id mainnet
 ```
 
-### Create and launch a single node
+There are three options for the flag `--chain_id`:
 
-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:
+- `mainnet`: connect to the mainnet.
+- `testnet`: connect to the testnet wisdom.
+- `solonet`: standalone mode.
 
-```bash
-$ cd ./cmd/bytom
-$ ./bytom init --home ./.bytom
-```
+After that, you'll see `config.toml` generated, then launch the node.
 
-After that, you'll see `.bytom` generated in current directory, then launch the single node:
+### launch
 
 ``` bash
-$ ./bytom node --home ./.bytom
+$ ./bytomd node
 ```
 
-#### Asset issuance test
-
-Given the `bytom` node is running, you can use the provoided `issue-test` to test the asset issuance functionality:
+available flags for `bytomd node`:
 
-```bash
-$ cd ./cmd/bytomcli
-$ ./bytomcli issue-test
+```
+      --auth.disable                Disable rpc access authenticate
+      --chain_id string             Select network type
+  -h, --help                        help for node
+      --mining                      Enable mining
+      --p2p.dial_timeout int        Set dial timeout (default 3)
+      --p2p.handshake_timeout int   Set handshake timeout (default 30)
+      --p2p.laddr string            Node listen address.
+      --p2p.max_num_peers int       Set max num peers (default 50)
+      --p2p.pex                     Enable Peer-Exchange  (default true)
+      --p2p.seeds string            Comma delimited host:port seed nodes
+      --p2p.skip_upnp               Skip UPNP configuration
+      --prof_laddr string           Use http to profile bytomd programs
+      --vault_mode                  Run in the offline enviroment
+      --wallet.disable              Disable wallet
+      --wallet.rescan               Rescan wallet
+      --web.closed                  Lanch web browser or not
+      --simd.enable                 Enable the _simd_ feature to speed up the _PoW_ verification (e.g., during mining and block verification)
 ```
 
-### Multiple node
+Given the `bytomd` node is running, the general workflow is as follows:
 
-Get the submodule depenency for multi-node test:
+- 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.
 
-```bash
-$ git submodule update --init --recursive
+__simd feature:__
+
+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
 ```
 
-Create the first node `bytom0` and second node `bytom1`:
+To enable this feature you will need to compile from the source code by yourself, and `make bytomd-simd`. 
 
-```bash
-$ cd cmd/bytom/2node-test
-$ ./test.sh bytom0  # Start the first node
-$ ./test.sh bytom1  # Start the second node
-```
+What is more,
 
-Then we have two nodes:
++ 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.
+
+For more details about using `bytomcli` command please refer to [API Reference](https://github.com/Bytom/bytom/wiki/API-Reference)
+
+### Dashboard
+
+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/
+```
+
+### In Docker
 
-If everything goes well, we'll see the following response:
+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