Skip to content

Commit

Permalink
update install, cli user guide, config instruction document (ontio#501)
Browse files Browse the repository at this point in the history
* update testnet and cli user guide document

* add config.md

* add link to config.md in other document
  • Loading branch information
qiluge authored and Arbio5zt committed Jul 5, 2018
1 parent d9921b1 commit 0ce0a01
Show file tree
Hide file tree
Showing 12 changed files with 317 additions and 20 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The public test network is described below. We sincerely welcome and hope more d
* [get from release](#get-from-release)
* [Server deployment](#server-deployment)
* [Select network](#select-network)
* [Mainnet sync node deployment](#mainnet-sync-node-deployment)
* [Public test network Polaris sync node deployment](#public-test-network-polaris-sync-node-deployment)
* [Single-host deployment configuration](#single-host-deployment-configuration)
* [Multi-hosts deployment configuration](#multi-hosts-deployment-configuration)
Expand Down Expand Up @@ -106,7 +107,6 @@ Run ontology straightly
./ontology --networkid 1
```

PS: There is no need of config.json file, will use the default setting.

#### Public test network Polaris sync node deployment

Expand All @@ -116,7 +116,6 @@ Run ontology straightly
./ontology --networkid 2
```

PS: There is no need of config.json file, will use the default setting.

#### Single-host deployment configuration

Expand Down Expand Up @@ -145,7 +144,8 @@ Note: When using --networkid with a custom value, you must also use the --config

In the multi-hosts enviroment, we need 7 nodes to run ontology at least in VBFT.

We can perform a quick deployment by modifying the default configuration file `config.json`.
We can perform a quick deployment by modifying the default configuration file `config.json`, click [here](./docs/specifications/config.md)
to read instruction of config file.

1. Generate 7 wallet file, each wallet contains an account. These account is bookkeepers of consensuse. The account generated by :
```
Expand Down Expand Up @@ -188,8 +188,8 @@ We can perform a quick deployment by modifying the default configuration file `c

In the multi-hosts enviroment, we need 4 nodes to run ontology at least in DBFT.

We can perform a quick deployment by modifying the default configuration file `config-dbft.json`.

We can perform a quick deployment by modifying the default configuration file `config-dbft.json`, click [here](./docs/specifications/config.md)
to read instruction of config file.
1. Copy related file into target host, including:

- Default configuration file`config-dbft.json`
Expand Down
5 changes: 3 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Ontology致力于创建一个组件化、可自由配置、跨链支持、高性
* [从release获取](#从release获取)
* [服务器部署](#服务器部署)
* [选择网络](#选择网络)
* [主网同步节点部署](#主网同步节点部署)
* [公开测试网Polaris同步节点部署](#公开测试网polaris同步节点部署)
* [单机部署配置](#单机部署配置)
* [多机部署配置](#多机部署配置)
Expand Down Expand Up @@ -137,7 +138,7 @@ ontology的运行支持以下三种方式

多机环境下,根据VBFT共识算法的要求,最少需要7个节点(共识节点)完成部署。

我们可以通过修改默认的配置文件`config.json`进行快速部署。
我们可以通过修改默认的配置文件`config.json`进行快速部署,配置文件的说明请点击[这里](./docs/specifications/config_CN.md)

1. 生成七个钱包文件,每个钱包文件包含一个账户,共七个账户,分别作为每个节点的记账人。生成账户和钱包的命令为:
```
Expand Down Expand Up @@ -176,7 +177,7 @@ ontology的运行支持以下三种方式
##### DBFT部署方法

多机环境下,最少需要4个节点(共识节点)完成部署。
我们可以通过修改默认的配置文件`config-dbft.json`进行快速部署。
我们可以通过修改默认的配置文件`config-dbft.json`进行快速部署,配置文件的说明请点击[这里](./docs/specifications/config_CN.md)

1. 将相关文件复制到目标主机,包括:
- 默认配置文件`config-dbft.json`
Expand Down
5 changes: 5 additions & 0 deletions docs/specifications/cli_user_guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Ontology CLI Instruction

[English|[中文](cli_user_guide_CN.md)]

Ontology CLI is an Ontology node command line Client for starting and managing Ontology nodes, managing user wallets, sending transactions, and deploying and invoking contracts.

## 1. Start and Manage Ontology Nodes
Expand Down Expand Up @@ -295,6 +297,9 @@ The wallet parameter specifies the wallet file path. If the wallet file does not
--number
The number parameter specifies the number of accounts that need to be created. You can batch create accounts by number parameter. The default value is 1.

--ontid
The parameter is used to create ONT ID instead of account.

**Add account**

```
Expand Down
5 changes: 5 additions & 0 deletions docs/specifications/cli_user_guide_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Ontology cli 使用说明

[[English](cli_user_guide.md)|中文]

Ontology cli 是Ontology命令行客户端,用于启动和管理Ontology节点,管理钱包 账户,发送交易以及部署和调用智能合约等。

## 1、启动和管理Ontology节点
Expand Down Expand Up @@ -293,6 +295,9 @@ wallet 参数用于指定钱包文件路径。如果钱包文件不存在,则
--number
number参数用于需要创建的账户数量。可以通过number来批量创建账户。number默认值为1。

--ontid
ontid参数用来创建ONT ID,而不是普通账户。

**添加账户**

```
Expand Down
144 changes: 144 additions & 0 deletions docs/specifications/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Ontology Config File Instruction

[English | [中文](config_CN.md)]

Ontology would support multiple consensus algorithm(VBFT/DBFT/RBFT/SBFT/PoW),and provide a pluggable consensus switching mechanism. Ontology has
supported VBFT and DBFT, they have different config method. It is mainly embodied in the configuration file.

## Content
* [DBFT Configuration](#dbft-configuration)
* [VBFT Configuration](#vbft-configuration)

## DBFT Configuration

DBFT configure file is [`config-dbft.json`](../../config-dbft.json),as follows:

```json
{
"SeedList": [
"ip1:20318",
"ip2:20318",
"ip3:20318",
"ip4:20318"
],
"ConsensusType":"dbft",
"DBFT":{
"Bookkeepers": [
"bookKeeper1",
"bookKeeper2",
"bookKeeper3",
"bookKeeper4"
],
"GenBlockTime":6
}
}
```

SeedList:This is used to configure seed node of ontology network。Seed node is the link entrance of ontology network. When a new node link to
ontology network, it request network information from seed node. At least one seed node should be configured in the configuration file.

ConsensusType:Consensus algorithm type, it indicates waht consensus is configured in the configuration file. The value could be set as "VBFT"
or "DBFT".

DBFT: DBFT consensus configuration,as follows:

- Bookkeepers:bookkeeper, the configuration is bookkeeper's public key;

- GenBlockTime:block generation interval, define as seconds.

## VBFT Configuration

VBFTis the default consensus mechanism for ontology at present, with [`config-vbft.json`](../../config-vbft.json) or
[`config.json`](../../config.json) configuration files, as follows:

```json
{
"SeedList": [
"127.0.0.1:20338"
],
"ConsensusType":"vbft",
"VBFT":{
"n":7,
"c":2,
"k":7,
"l":112,
"block_msg_delay":10000,
"hash_msg_delay":10000,
"peer_handshake_timeout":10,
"max_block_change_view":1000,
"admin_ont_id":"did:ont:AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"min_init_stake":100000,
"vrf_value":"1c9810aa9822e511d5804a9c4db9dd08497c31087b0daafa34d768a3253441fa20515e2f30f81741102af0ca3cefc4818fef16adb825fbaa8cad78647f3afb590e",
"vrf_proof":"c57741f934042cb8d8b087b44b161db56fc3ffd4ffb675d36cd09f83935be853d8729f3f5298d12d6fd28d45dde515a4b9d7f67682d182ba5118abf451ff1988",
"peers":[
{
"index":1,
"peerPubkey":"028541d32f3b09180b00affe67a40516846c16663ccb916fd2db8106619f087527",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":100000
},
{
"index":2,
"peerPubkey":"02dfb161f757921898ec2e30e3618d5c6646d993153b89312bac36d7688912c0ce",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":200000
},
{
"index":3,
"peerPubkey":"039dab38326268fe82fb7967fe2e7f5f6eaced6ec711148a66fbb8480c321c19dd",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":300000
},
{
"index":4,
"peerPubkey":"0384f2729bc5d9b14dcbf17aba108261dc7ad867127e413d3c8bfb4731739687b3",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":400000
},
{
"index":5,
"peerPubkey":"03362f99284daa9f581fab596516f75475fc61a5f80de0e268a68430dc7589859c",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":300000
},
{
"index":6,
"peerPubkey":"03db6e37a2d897f2d61b42dcd478323a8a20c3444af4ee29653849f38d0bdb67f4",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":200000
},
{
"index":7,
"peerPubkey":"0298fe9f22e9df64f6bfcc1c2a14418846cffdbbf510d261bbc3fa6d47073df9a2",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":100000
}
]
}
}
```
SeedList:same as SeedList in DBFT configuration。

ConsensusType:same as ConsensusType in DBFT configuration。

VBFT:VBFT consensus configuration,as follows:

- n:the number of node in whole ontology network;
- c:the number of fault-tolerant nodes;
- k:the number of consensus nodes;
- l:the number of POS table items;
- block_msg_delay:block message maximum broadcast delay;
- hash_msg_delay:hash message maximum broadcast delay;
- peer_handshake_timeout:node handshake connection timeout time limit;
- max_block_change_view:Consensus period;
- admin_ont_id:ONT ID of administrator;
- min_init_stake:the minimum amount of initial stack ONT;
- vrf_value:compose a verifiable random value with'vrf_proof';
- vrf_proof:compose a verifiable random value with'vrf_value';
- peers:bookkeeper in consensus nodes configuration, as follows:

- index:index;
- peerPubkey:bookkeeper's public key;
- address:bookkeeper's address;
- initPos:initial mortgage ONT number of this bookkeeper.

141 changes: 141 additions & 0 deletions docs/specifications/config_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Ontology 配置文件说明

[[English](config.md) | 中文]

Ontology计划支持多种共识算法,并提供可插拔式的共识切换机制。目前已支持的共识算法为VBFT与DBFT,这两种算法有不同的配置方法,主要体现在配置文件里。
现对配置文件的内容和结构解释如下。

## 目录
* [DBFT 配置](#dbft-配置)
* [VBFT 配置](#vbft-配置)

## DBFT 配置

DBFT配置文件为[`config-dbft.json`](../../config-dbft.json),如下:

```json
{
"SeedList": [
"ip1:20318",
"ip2:20318",
"ip3:20318",
"ip4:20318"
],
"ConsensusType":"dbft",
"DBFT":{
"Bookkeepers": [
"bookKeeper1",
"bookKeeper2",
"bookKeeper3",
"bookKeeper4"
],
"GenBlockTime":6
}
}
```
SeedList:用来配置ontology网络的种子节点。种子节点是ontology网络的链接入口,新节点加入ontology网络时,会先向种子节点请求网络相关信息。
配置文件里至少需配置一个种子节点。

ConsensusType:共识模式,指示该配置文件配置的是何种共识,目前支持"VBFT"和"DBFT"。

DBFT: DBFT共识配置,内容如下:

- Bookkeepers:记账人,用来配置记账人的公钥,需要配置四个;

- GenBlockTime:区块生成时间,单位为秒。

## VBFT 配置

VBFT是目前ontology的默认共识机制,配置文件为[`config-vbft.json`](../../config-vbft.json)或者[`config.json`](../../config.json),如下:

```json
{
"SeedList": [
"127.0.0.1:20338"
],
"ConsensusType":"vbft",
"VBFT":{
"n":7,
"c":2,
"k":7,
"l":112,
"block_msg_delay":10000,
"hash_msg_delay":10000,
"peer_handshake_timeout":10,
"max_block_change_view":1000,
"admin_ont_id":"did:ont:AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"min_init_stake":100000,
"vrf_value":"1c9810aa9822e511d5804a9c4db9dd08497c31087b0daafa34d768a3253441fa20515e2f30f81741102af0ca3cefc4818fef16adb825fbaa8cad78647f3afb590e",
"vrf_proof":"c57741f934042cb8d8b087b44b161db56fc3ffd4ffb675d36cd09f83935be853d8729f3f5298d12d6fd28d45dde515a4b9d7f67682d182ba5118abf451ff1988",
"peers":[
{
"index":1,
"peerPubkey":"028541d32f3b09180b00affe67a40516846c16663ccb916fd2db8106619f087527",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":100000
},
{
"index":2,
"peerPubkey":"02dfb161f757921898ec2e30e3618d5c6646d993153b89312bac36d7688912c0ce",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":200000
},
{
"index":3,
"peerPubkey":"039dab38326268fe82fb7967fe2e7f5f6eaced6ec711148a66fbb8480c321c19dd",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":300000
},
{
"index":4,
"peerPubkey":"0384f2729bc5d9b14dcbf17aba108261dc7ad867127e413d3c8bfb4731739687b3",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":400000
},
{
"index":5,
"peerPubkey":"03362f99284daa9f581fab596516f75475fc61a5f80de0e268a68430dc7589859c",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":300000
},
{
"index":6,
"peerPubkey":"03db6e37a2d897f2d61b42dcd478323a8a20c3444af4ee29653849f38d0bdb67f4",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":200000
},
{
"index":7,
"peerPubkey":"0298fe9f22e9df64f6bfcc1c2a14418846cffdbbf510d261bbc3fa6d47073df9a2",
"address":"AVaSGN1ugQJBS7R7ZcVwAoWLVK6onBgfyg",
"initPos":100000
}
]
}
}
```
SeedList:与DBFT配置文件的SeedList相同。

ConsensusType:与DBFT配置文件的ConsensusType相同。

VBFT:VBFT共识配置,内容如下:

- n:链上节点总数(网络规模);
- c:容错节点数量;
- k:共识节点数目;
- l:POS表条目数;
- block_msg_delay:区块消息最大广播延迟;
- hash_msg_delay:哈希消息最大广播延迟;
- peer_handshake_timeout:节点握手连接超时时限;
- max_block_change_view:共识周期;
- admin_ont_id:管理员的ONT ID;
- min_init_stake:初始抵押ONT的最小数量;
- vrf_value:与'vrf_proof'一起构成可验证随机值;
- vrf_proof:与'vrf_value'一起构成可验证随机值;
- peers:共识节点(记账人)配置,内容如下:

- index:序号;
- peerPubkey:记账人公钥;
- address:记账人地址;
- initPos:该记账人初始抵押ONT数目。

Loading

0 comments on commit 0ce0a01

Please sign in to comment.