Skip to content

Commit 3e61e9b

Browse files
Update: Quorum network add node (#70)
* Fix quorum network setting and path while creating * Modify gas setting & Add error handler * Fix: superuser privileges not allow * Fix: update blockscout and quorum to lastest * Feat: update genesis.json config * Fix: uid and gid enviroment variable * Fix: blockscout url is nil * Feat: ora spinner in command * Feat: default of explorer creating * Feat: default of network creating * Fix: quorum explorer can not be deleted * Fix: modify Validator/Member expose port * Fix: eslint & package audit update * Feat: add local validator * Fix: modify add validator * Feat: add local member * Fix: add trytime for adding node in quorum network * Feat: add downOneService in quorum network * Feat: add check command * Feat: add check chainId * Fix: modify ports of node connections * Feat: add generate & addValidatorRemote & joinValidator * Fix: modify json file & send empty transaction * Feat: add get command to get Quorum network information * Fix: modify addValidatorRemote parameter requirement & get validator enode information * Feat: add addMemberRemote & modify join/generate * Doc: new example of adding remote node & Modify document introduction * Doc: unified quorum Example.md format * fix: backup dockerCompose file according to node * Doc: upgrade 2.0.2 README.md and CHANGELOG.md --------- Co-authored-by: kidneyweak <kidneyweak@gmail.com>
1 parent 4751732 commit 3e61e9b

39 files changed

Lines changed: 1659 additions & 1465 deletions

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@ All notable changes to BDK project will be documented here.
1818

1919
[2.0.1]: https://github.com/cathayddt/bdk/releases/tag/v2.0.1
2020

21+
[2.0.2]: https://github.com/cathayddt/bdk/releases/tag/v2.0.2
22+
23+
## [2.0.2][2.0.2] - 2023-03-
24+
25+
### new
26+
1. New Package: `ora`
27+
2. New Command: `bdk quorum network add`
28+
3. New Command: `bdk quorum network generate`
29+
4. New Command: `bdk quorum network join`
30+
5. New Command: `bdk quorum network check`
31+
6. New Command: `bdk quorum network get`
32+
7. New Example: add remote node
33+
34+
### changed
35+
1. Fix: path not found, provide `PathError` notification
36+
2. Fix: superuser privilege, not provide su execute
37+
3. Fix: `bdk quorum network delete` cannot delete image
38+
4. Upgrade: quorum (22.7.4) and blockscout (v4.1.5-beta)
39+
5. Modify: `gasLimit` from `0xFFFFFF` to `0xE0000000`
40+
6. Modify: `emptyBlockPeriodSeconds` from 60 to 3600
41+
7. Modify: `requestTimeoutSeconds` from 4 to 60
42+
8. Modify: `bdk quorum network create` member node default value 0
43+
2144
## [2.0.1][2.0.1] - 2022-12-
2245

2346
### new

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ bdk fabric network create -i
2121

2222
| Latest | Stable |
2323
| ---------------- | ---------------- |
24-
| [v2.0.1][v2.0.1] | [v1.0.4][v1.0.4] |
24+
| [v2.0.2][v2.0.2] | [v2.0.2][v2.0.2] |
2525

26-
[v1.0.4]: https://github.com/cathayddt/bdk/releases/tag/v1.0.4
27-
[v2.0.1]: https://github.com/cathayddt/bdk/releases/tag/v2.0.1
26+
[v2.0.2]: https://github.com/cathayddt/bdk/releases/tag/v2.0.2
2827

2928
[更新內容 (Changelog)](CHANGELOG.md)
3029

docs/quorum/COMMANDS.md

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,29 @@
1010

1111
## Network
1212

13+
### `bdk quorum network add`
14+
15+
Description: 新增 Quorum Node
16+
17+
| Options | Type | Description | Required | Default |
18+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
19+
| --help | boolean | Show help | | |
20+
| --version | boolean | Show version number | | |
21+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
22+
23+
### `bdk quorum network check`
24+
25+
Description: 確認 Quorum Node 資訊
26+
27+
| Options | Type | Description | Required | Default |
28+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
29+
| --help | boolean | Show help | | |
30+
| --version | boolean | Show version number | | |
31+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
32+
1333
### `bdk quorum network create`
1434

15-
Description: 產生 Quorum network 所需的相關設定檔案
35+
Description: 產生 Quorum Network 所需的相關設定檔案並建立網路
1636

1737
| Options | Type | Description | Required | Default |
1838
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
@@ -22,32 +42,62 @@ Description: 產生 Quorum network 所需的相關設定檔案
2242

2343
### `bdk quorum network delete`
2444

25-
Description: 刪除現有的 Quorum Network.
45+
Description: 刪除現有的 Quorum Network
2646

2747
| Options | Type | Description | Required | Default |
2848
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
2949
| --help | boolean | Show help | | |
3050
| --version | boolean | Show version number | | |
3151

32-
### `bdk quorum network up`
52+
### `bdk quorum network down`
53+
54+
Description: 停止現有的 Quorum Network
55+
56+
| Options | Type | Description | Required | Default |
57+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
58+
| --help | boolean | Show help | | |
59+
| --version | boolean | Show version number | | |
60+
61+
### `bdk quorum network generate`
3362

34-
Description: 啟動現有的 Quorum Network.
63+
Description: 產生 Quorum Network 所需的相關設定檔案
3564

3665
| Options | Type | Description | Required | Default |
3766
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
3867
| --help | boolean | Show help | | |
3968
| --version | boolean | Show version number | | |
4069
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
41-
| -a, --all | boolean | 是否啟動所有節點 | | |
4270

43-
### `bdk quorum network down`
71+
### `bdk quorum network get`
72+
73+
Description: 取得 Quorum 檔案資訊
74+
75+
| Options | Type | Description | Required | Default |
76+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
77+
| --help | boolean | Show help | | |
78+
| --version | boolean | Show version number | | |
79+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
80+
81+
### `bdk quorum network join`
4482

45-
Description: 停止現有的 Quorum Network.
83+
Description: 選擇現有節點加入 Quorum Network
4684

4785
| Options | Type | Description | Required | Default |
4886
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
4987
| --help | boolean | Show help | | |
5088
| --version | boolean | Show version number | | |
89+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
90+
91+
### `bdk quorum network up`
92+
93+
Description: 啟動現有的 Quorum Network
94+
95+
| Options | Type | Description | Required | Default |
96+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
97+
| --help | boolean | Show help | | |
98+
| --version | boolean | Show version number | | |
99+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
100+
| -a, --all | boolean | 是否啟動所有節點 | | |
51101

52102
## Explorer
53103

@@ -74,7 +124,7 @@ Description: 刪除現有的 Quorum Explorer.
74124

75125
### `bdk quorum backup export`
76126

77-
Description: 匯出現有的 Quorum Network.
127+
Description: 匯出現有的 Quorum Network
78128

79129
| Options | Type | Description | Required | Default |
80130
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
@@ -85,7 +135,7 @@ Description: 匯出現有的 Quorum Network.
85135

86136
### `bdk quorum backup import`
87137

88-
Description: 匯入現有的 Quorum Network.
138+
Description: 匯入現有的 Quorum Network
89139

90140
| Options | Type | Description | Required | Default |
91141
| --------------------- | :-----: | ------------------------------ | :------: | ------- |

docs/quorum/EXAMPLE.md

Lines changed: 71 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,118 @@
22
(English version)(Work In Progress)
33

44
## 目錄
5-
- [建立 Blockchain network](#建立-blockchain-network)
5+
- [確認 BDK 安裝狀態](#確認-bdk-安裝狀態)
6+
- [建立 Quorum Network](#建立-quorum-network)
7+
- [建立 Blockscout Explorer](#建立-blockscout-explorer)
8+
- [加入 Remote 節點](#加入-remote-節點)
69
- [備份還原 Node](#備份還原-node)
710

8-
## 建立 Blockchain network
9-
10-
Quorum 無須做過多的前置設定,只需確認 BDK 套件是否安裝完成即可
11+
## 確認 BDK 安裝狀態
1112

1213
```bash
14+
# 確認 BDK 套件是否安裝完成
1315
bdk hello
1416
```
1517

1618
如果指令已順利安裝,你會看到 `You have installed bdk successfully!!!`
1719

18-
### 建立 Network
20+
## 建立 Quorum Network
21+
22+
```bash
23+
# 輸入指令,啟動 Quorum 網路互動式介面
24+
bdk quorum network create -i
25+
```
26+
27+
依序輸入 `chain id`(預設為 81712)、`validator` 以及 `member` 的數量,並填入自己的錢包,如無錢包則選擇 `false`,會提供一組公私鑰來作為使用 Quorum 網路的帳號,該組帳號將在創始區塊擁有代幣
28+
29+
## 建立 Blockscout Explorer
30+
31+
```bash
32+
# 輸入指令,啟動 Blockscout 區塊鏈瀏覽器
33+
bdk quorum explorer create -i
34+
```
35+
36+
輸入 `port`,並稍待片刻,即可使用區塊鏈瀏覽器
37+
38+
## 加入 Remote 節點
39+
40+
範例情境:建立擁有三個 Validator 節點的 Quorum 網路,且三個節點分別建置在不同機器。
41+
42+
> `需確認機器的 IP Address 以及 Port 30303 (Validator) 或 Port 30403 (Member) 有互相開放`
43+
44+
Validator 以及 Member 節點的加入流程相同,此處以 Validator 為例。
1945

20-
輸入指令,啟動 Quorum 網路互動式介面
46+
### Step 0: 建立 Network
2147

2248
```bash
49+
# 於第一台機器上建立 Validator 數量為 1,Member 數量為 0 的 Quorum 網路。
2350
bdk quorum network create -i
2451
```
2552

26-
依序輸入 chain id (預設為1337)、validator 以及 member 的數量,以及填入自己的錢包,如無填入(選擇 false ),則會提供一組公私鑰來作為使用 Quorum 網路的帳號,該組帳號會在創始區塊擁有代幣
53+
### Step 1:產生 Node 設定檔,取得 enodeInfo
2754

28-
### 建立 Blockscout Explorer
55+
```bash
56+
# 分別於第二台及第三台機器產生 Node 設定檔, Validator 數量填入 1,Member 數量填入 0。
57+
bdk quorum network generate -i
58+
59+
# 選擇 node,選擇剛產生的節點,選擇 enodeInfo 保留下來。
60+
bdk quorum network get -i
61+
```
2962

30-
輸入指令,啟動 Blockscout 區塊鏈瀏覽器
63+
### Step 2:新增節點
3164

3265
```bash
33-
bdk quorum explorer create -i
66+
# 從第一台機器輸入指令,選擇 remote、validator,填入要加入節點的 enodeInfo、IP Address。
67+
bdk quorum network add -i
68+
69+
# 選擇 network,取得 genesis.json、static-nodes.json 保留下來。
70+
bdk quorum network get -i
71+
```
72+
73+
### Step 3:加入網路
74+
75+
```bash
76+
# 從要加入的機器輸入指令,選擇要加入的節點,並依序輸入以下資訊,填入要加入網路的 IP Address、genesis.json、static-nodes.json。
77+
bdk quorum network join -i
3478
```
3579

36-
輸入 port ,並稍待片刻,即可使用區塊鏈瀏覽器
80+
> 欲加入第三台機器的節點,則需在第一台及第二台機器完成前述 `Step 2:新增節點` 的動作,再於第三台機器完成 `Step 3:加入網路`,第三個節點便可順利加入網路。
81+
82+
### Step 4:確認節點狀態
83+
84+
```bash
85+
# 輸入指令,可確認以下節點狀態
86+
bdk quorum network check -i
87+
```
88+
- `isValidator`: 確認節點是否為 Validator,此處三個節點都應回傳 `true`
89+
- `getValidator`: 獲取 Validator 清單,此處應回傳包含三個 Validator 的地址。
90+
- `peerCount`: 確認節點連接數,此處每個節點應回傳 `2`
91+
- `chainId`:鏈 ID,此處預設應回傳 `81712`
3792

3893
## 備份還原 Node
3994

4095
Quorum 網路各節點啟動後,即可做備份的動作,BDK 備份工具可根據使用者的需求備份個別或全部節點,並將備份壓縮檔存入 `~/.bdk/quorum/backup` 資料夾中,達成多台機器還原環境的功能
4196

42-
### 備份現有的 Node (擇一備份)
97+
### 備份 Node
4398

4499
```bash
100+
# 備份現有的 Node (擇一備份)
45101
bdk quorum backup export --interactive
46102
```
47103

48-
### 備份所有的 Node
49-
50104
```bash
105+
# 備份所有的 Node
51106
bdk quorum backup export --all
52107
```
53108

54109
### 還原 Node
55110

56-
透過 `bdk backup` 指令還原節點,可在清單中選擇需要還原的備份檔
57-
58111
```bash
112+
# 透過指令還原節點,可在清單中選擇需要還原的備份檔
59113
bdk quorum backup import -i
60114
```
61115

62-
還原後需透過以下指令,來啟動該備份的節點
63-
64116
```bash
117+
# 還原後需透過以下指令,來啟動該備份的節點
65118
bdk quorum network up --all
66119
```

0 commit comments

Comments
 (0)