Skip to content

Commit

Permalink
Update: Quorum backup and run (#67)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
kidneyweakx and Pianochicken authored Dec 1, 2022
1 parent e005d26 commit 4751732
Show file tree
Hide file tree
Showing 27 changed files with 725 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @SecondDim @yujugrace @kth-tw @RuiSiang @rc56
* @kth-tw @Pianochicken @kidneyweakx
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ All notable changes to BDK project will be documented here.

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

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

## [2.0.1][2.0.1] - 2022-12-

### new

- New Command: `bdk quorum network up`
- New Command: `bdk quorum network down`
- New Command: `bdk quorum backup import`
- New Command: `bdk quorum backup export`
- New Commands API Docs
- Fix remove files and network issues

### changed
- Refactor: `bdk quorum network create` ask to delete exist files before creating
- Refactor: `bdk quorum network delete` delete node files

## [2.0.0][2.0.0] - 2022-10-

### new
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ bdk fabric network create -i

| Latest | Stable |
| ---------------- | ---------------- |
| [v2.0.0][v2.0.0] | [v1.0.4][v1.0.4] |
| [v2.0.1][v2.0.1] | [v1.0.4][v1.0.4] |

[v1.0.4]: https://github.com/cathayddt/bdk/releases/tag/v1.0.4
[v2.0.1]: https://github.com/cathayddt/bdk/releases/tag/v2.0.1

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

Expand Down
52 changes: 48 additions & 4 deletions docs/quorum/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [Network](#network)
- [Explorer](#explorer)
- [Backup](#backup)

## Network

Expand All @@ -17,9 +18,7 @@ Description: 產生 Quorum network 所需的相關設定檔案
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
| --help | boolean | Show help | | |
| --version | boolean | Show version number | | |
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |

## Explorer
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |

### `bdk quorum network delete`

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

### `bdk quorum network up`

Description: 啟動現有的 Quorum Network.

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

### `bdk quorum network down`

Description: 停止現有的 Quorum Network.

| Options | Type | Description | Required | Default |
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
| --help | boolean | Show help | | |
| --version | boolean | Show version number | | |

## Explorer

### `bdk quorum explorer create`

Description: 產生 Quorum Explorer 所需的相關設定檔案
Expand All @@ -47,4 +68,27 @@ Description: 刪除現有的 Quorum Explorer.
| Options | Type | Description | Required | Default |
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
| --help | boolean | Show help | | |
| --version | boolean | Show version number | | |
| --version | boolean | Show version number | | |

## Backup

### `bdk quorum backup export`

Description: 匯出現有的 Quorum Network.

| Options | Type | Description | Required | Default |
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
| --help | boolean | Show help | | |
| --version | boolean | Show version number | | |
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
| -a, --all | boolean | 是否備份所有資料 | | |

### `bdk quorum backup import`

Description: 匯入現有的 Quorum Network.

| Options | Type | Description | Required | Default |
| --------------------- | :-----: | ------------------------------ | :------: | ------- |
| --help | boolean | Show help | | |
| --version | boolean | Show version number | | |
| -i, --interactive | boolean | 是否使用 Cathay BDK 互動式問答 | | |
38 changes: 34 additions & 4 deletions docs/quorum/EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

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

## 建立 Blockchain network

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

```bash
bdk hello
Expand All @@ -23,7 +23,7 @@ bdk hello
bdk quorum network create -i
```

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

### 建立 Blockscout Explorer

Expand All @@ -33,4 +33,34 @@ bdk quorum network create -i
bdk quorum explorer create -i
```

輸入 port ,並稍待片刻,即可使用區塊鏈瀏覽器
輸入 port ,並稍待片刻,即可使用區塊鏈瀏覽器

## 備份還原 Node

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

### 備份現有的 Node (擇一備份)

```bash
bdk quorum backup export --interactive
```

### 備份所有的 Node

```bash
bdk quorum backup export --all
```

### 還原 Node

透過 `bdk backup` 指令還原節點,可在清單中選擇需要還原的備份檔

```bash
bdk quorum backup import -i
```

還原後需透過以下指令,來啟動該備份的節點

```bash
bdk quorum network up --all
```
Loading

0 comments on commit 4751732

Please sign in to comment.