Skip to content

Commit 4751732

Browse files
Update: Quorum backup and run (#67)
* Add backup commands * Fix remove files and network issues * Uppercase to lowercase * DockerCompose up and down * Add 2.0.1 new features docs * Modify codeowner Co-authored-by: Brian Huang <pianochicken1996@gmail.com>
1 parent e005d26 commit 4751732

27 files changed

Lines changed: 725 additions & 113 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @SecondDim @yujugrace @kth-tw @RuiSiang @rc56
1+
* @kth-tw @Pianochicken @kidneyweakx

CHANGELOG.md

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

1717
[2.0.0]: https://github.com/cathayddt/bdk/releases/tag/v2.0.0
1818

19+
[2.0.1]: https://github.com/cathayddt/bdk/releases/tag/v2.0.1
20+
21+
## [2.0.1][2.0.1] - 2022-12-
22+
23+
### new
24+
25+
- New Command: `bdk quorum network up`
26+
- New Command: `bdk quorum network down`
27+
- New Command: `bdk quorum backup import`
28+
- New Command: `bdk quorum backup export`
29+
- New Commands API Docs
30+
- Fix remove files and network issues
31+
32+
### changed
33+
- Refactor: `bdk quorum network create` ask to delete exist files before creating
34+
- Refactor: `bdk quorum network delete` delete node files
35+
1936
## [2.0.0][2.0.0] - 2022-10-
2037

2138
### new

README.md

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

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

2626
[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
2728

2829
[更新內容 (Changelog)](CHANGELOG.md)
2930

docs/quorum/COMMANDS.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- [Network](#network)
88
- [Explorer](#explorer)
9+
- [Backup](#backup)
910

1011
## Network
1112

@@ -17,9 +18,7 @@ Description: 產生 Quorum network 所需的相關設定檔案
1718
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
1819
| --help | boolean | Show help | | |
1920
| --version | boolean | Show version number | | |
20-
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
21-
22-
## Explorer
21+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
2322

2423
### `bdk quorum network delete`
2524

@@ -30,6 +29,28 @@ Description: 刪除現有的 Quorum Network.
3029
| --help | boolean | Show help | | |
3130
| --version | boolean | Show version number | | |
3231

32+
### `bdk quorum network up`
33+
34+
Description: 啟動現有的 Quorum Network.
35+
36+
| Options | Type | Description | Required | Default |
37+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
38+
| --help | boolean | Show help | | |
39+
| --version | boolean | Show version number | | |
40+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
41+
| -a, --all | boolean | 是否啟動所有節點 | | |
42+
43+
### `bdk quorum network down`
44+
45+
Description: 停止現有的 Quorum Network.
46+
47+
| Options | Type | Description | Required | Default |
48+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
49+
| --help | boolean | Show help | | |
50+
| --version | boolean | Show version number | | |
51+
52+
## Explorer
53+
3354
### `bdk quorum explorer create`
3455

3556
Description: 產生 Quorum Explorer 所需的相關設定檔案
@@ -47,4 +68,27 @@ Description: 刪除現有的 Quorum Explorer.
4768
| Options | Type | Description | Required | Default |
4869
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
4970
| --help | boolean | Show help | | |
50-
| --version | boolean | Show version number | | |
71+
| --version | boolean | Show version number | | |
72+
73+
## Backup
74+
75+
### `bdk quorum backup export`
76+
77+
Description: 匯出現有的 Quorum Network.
78+
79+
| Options | Type | Description | Required | Default |
80+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
81+
| --help | boolean | Show help | | |
82+
| --version | boolean | Show version number | | |
83+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
84+
| -a, --all | boolean | 是否備份所有資料 | | |
85+
86+
### `bdk quorum backup import`
87+
88+
Description: 匯入現有的 Quorum Network.
89+
90+
| Options | Type | Description | Required | Default |
91+
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
92+
| --help | boolean | Show help | | |
93+
| --version | boolean | Show version number | | |
94+
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |

docs/quorum/EXAMPLE.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
## 目錄
55
- [建立 Blockchain network](#建立-blockchain-network)
6-
- [部署 Chaincode](#部署-chaincode)
6+
- [備份還原 Node](#備份還原-node)
77

88
## 建立 Blockchain network
99

10-
Quorum 無須做過多的前置設定,只需確認 bdk 套件是否安裝完成即可
10+
Quorum 無須做過多的前置設定,只需確認 BDK 套件是否安裝完成即可
1111

1212
```bash
1313
bdk hello
@@ -23,7 +23,7 @@ bdk hello
2323
bdk quorum network create -i
2424
```
2525

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

2828
### 建立 Blockscout Explorer
2929

@@ -33,4 +33,34 @@ bdk quorum network create -i
3333
bdk quorum explorer create -i
3434
```
3535

36-
輸入 port ,並稍待片刻,即可使用區塊鏈瀏覽器
36+
輸入 port ,並稍待片刻,即可使用區塊鏈瀏覽器
37+
38+
## 備份還原 Node
39+
40+
Quorum 網路各節點啟動後,即可做備份的動作,BDK 備份工具可根據使用者的需求備份個別或全部節點,並將備份壓縮檔存入 `~/.bdk/quorum/backup` 資料夾中,達成多台機器還原環境的功能
41+
42+
### 備份現有的 Node (擇一備份)
43+
44+
```bash
45+
bdk quorum backup export --interactive
46+
```
47+
48+
### 備份所有的 Node
49+
50+
```bash
51+
bdk quorum backup export --all
52+
```
53+
54+
### 還原 Node
55+
56+
透過 `bdk backup` 指令還原節點,可在清單中選擇需要還原的備份檔
57+
58+
```bash
59+
bdk quorum backup import -i
60+
```
61+
62+
還原後需透過以下指令,來啟動該備份的節點
63+
64+
```bash
65+
bdk quorum network up --all
66+
```

0 commit comments

Comments
 (0)