Bytom
-=====
-[![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 -->
-
-* [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)
- * [Create an account](#create-an-account)
- * [Create an asset](#create-an-asset)
- * [Asset issuance test](#asset-issuance-test)
- * [Expenditure test](#expenditure-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 -->
+======
+
+[![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)
+
+**Official golang implementation of the Bytom protocol.**
+
+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?
In the current state `bytom` is able to:
-- Issue assets
-- Manage account as well as asset
-- Spend assets
+- 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
$ 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
-
-- Bytomd
+- Build source code
``` bash
$ cd $GOPATH/src/github.com/bytom
-$ make install
-$ cd ./cmd/bytomd
-$ go build
-```
-
-- Bytomcli
-
-```go
-$ cd $GOPATH/src/github.com/bytom/cmd/bytomcli
-$ go build
+$ make bytomd # build bytomd
+$ make bytomcli # build bytomcli
```
-## Example
+When successfully building the project, the `bytom` and `bytomcli` binary should be present in `cmd/bytomd` and `cmd/bytomcli` directory, respectively.
-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`.
+### Executables
-### Create and launch a single node
+The Bytom project comes with several executables found in the `cmd` directory.
-When successfully building the project, the `bytom` and `bytomcli` binary should be present in `cmd/bytomd` and `cmd/bytomcli` directory, respectively. The next step is to initialize the node:
+| 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. |
-```bash
-$ cd ./cmd/bytomd
-$ ./bytomd init
-```
-
-After that, you'll see `.bytom` generated in current directory, then launch the single node:
-
-``` bash
-$ ./bytomd node --wallet.enable
-```
-
-Given the `bytom` node is running, the general workflow is as follows:
-
-- create an account
-- create an asset
-- create/sign/submit a transaction to transfer an asset
-- query the assets on-chain
+## Running bytom
+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`.
-#### Create an account
+### Initialize
-Create an account named `alice`:
+First of all, initialize the node:
```bash
-$ ./bytomcli create-account alice
-xprv:<alice_account_private_key>
-responses:<create-account-responses>
-account id:<alice_account_id>
+$ cd ./cmd/bytomd
+$ ./bytomd init --chain_id mainnet
```
-Check out the new created account:
+There are three options for the flag `--chain_id`:
-```bash
-$ ./bytomcli list-accounts
-```
+- `mainnet`: connect to the mainnet.
+- `testnet`: connect to the testnet wisdom.
+- `solonet`: standalone mode.
-#### Create an asset
+After that, you'll see `config.toml` generated, then launch the node.
-Create an asset named `gold`:
+### launch
-```bash
-$ ./bytomcli create-asset gold
-xprv:<gold_asset_private_key>
-xpub:<gold_asset_public_key>
-responses:<create-asset-responses>
-asset id:<gold_asset_id>
+``` bash
+$ ./bytomd node
```
-Check out the new created asset:
+available flags for `bytomd node`:
-```bash
-$ ./bytomcli list-assets
```
+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)
-#### Asset issuance test
-
-Since the account `alice` and the asset `gold` are ready, we need to create another account `bob`, which is also neccessary for the following Expenditure test:
-
-```bash
-$ ./bytomcli create-account bob
+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
```
-Firstly, Alice issue `<issue_amount>`, e.g., 10000, `gold`:
+Given the `bytomd` node is running, the general workflow is as follows:
-```bash
-$ ./bytomcli sub-create-issue-tx <alice_account_id> <bob_account_id> <gold_asset_id> <gold_asset_private_key> <issue_amount>
-```
+- 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.
-When the transaction above is mined, query the balances:
+__simd feature:__
-```bash
-# Alice should have 10000 gold now
-$ ./bytomcli list-balances
+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
```
-#### Expenditure test
+To enable this feature you will need to compile from the source code by yourself, and `make bytomd-simd`.
-- Alice -> Bob
+What is more,
-Alice pays Bob `<payment_amount>`, e.g., 1000, `gold`:
++ 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.
-```bash
-$ ./bytomcli sub-spend-account-tx <alice_account_id> <bob_account_id> <gold_asset_id> <alice_private_key> <payment_amount>
-# In our case, after Alice pays Bob 1000 gold, the amount of Alice's gold should be 9000, Bob's balances should be 1000
-$ ./bytomcli list-balances
-```
+For more details about using `bytomcli` command please refer to [API Reference](https://github.com/Bytom/bytom/wiki/API-Reference)
-- Bob -> Alice
+### Dashboard
-Bob pays Alice `<payment_amount>`, e.g., 500, `gold`:
+Access the dashboard:
-```bash
-$ ./bytomcli sub-spend-account-tx <bob_account_id> <alice_account_id> <gold_asset_id> <bob_private_key> <payment_amount>
-# In our case, after Bob pays Alice 500 gold, the amount of Alice's gold should be 9500, Bob's balances should be 500
-$ ./bytomcli list-balances
```
-
-### Set up a wallet and manage the key
-
-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.
-
-```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
+$ open http://localhost:9888/
```
-### Multiple node
-
-Get the submodule depenency for the two-node test:
+### In Docker
-```bash
-$ git submodule update --init --recursive
-```
-
-Create the first node `bytomd0` and second node `bytomd1`:
+Ensure your [Docker](https://www.docker.com/) version is 17.05 or higher.
```bash
-$ cd cmd/bytomd/2node-test
-$ ./test.sh bytomd0 # Start the first node
-$ ./test.sh bytomd1 # Start the second node
+$ docker build -t bytom .
```
-Then we have two nodes:
-
-```bash
-$ ./bycomcli net-info
-net-info:map[listening:true listeners:[Listener(@192.168.199.43:3332)] peers:[map[node_info:map[listen_addr:192.168.199.43:3333 version:0.1.2 other:[wire_version=0.6.2 p2p_version=0.5.0] pub_key:D6B76D1B4E9D7E4D81BA5FAAE9359302446488495A29D7E70AF84CDFEA186D66 moniker:anonymous network:bytom remote_addr:127.0.0.1:51036] is_outbound:false connection_status:map[RecvMonitor:map[Start:2017-10-30T13:45:47.18+08:00 Bytes:425130 AvgRate:27010 Progress:0 Active:true Idle:1.04e+09 Samples:42 InstRate:4591 CurRate:3540 PeakRate:114908 BytesRem:0 TimeRem:0 Duration:1.574e+10] Channels:[map[RecentlySent:5332 ID:64 SendQueueCapacity:100 SendQueueSize:0 Priority:5]] SendMonitor:map[Active:true Idle:1.24e+09 Bytes:16240 Samples:41 CurRate:125 AvgRate:1032 Progress:0 Start:2017-10-30T13:45:47.18+08:00 Duration:1.574e+10 InstRate:147 PeakRate:4375 BytesRem:0 TimeRem:0]]]]]
-```
+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