-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc about app state reset and export
- Loading branch information
1 parent
bd16089
commit 909da75
Showing
5 changed files
with
78 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Export Blockchain State | ||
|
||
## Description | ||
|
||
IRISnet can export blockchain state and output json format string. Save the out json string to a json file and the json file can be used as genesis file of a new blockchain. This can be accomplished by command `iris export`. | ||
If you want to export the state of the historical block height, you need to [reset](app-state-reset.md) the app state to the specified height. | ||
|
||
## Usage | ||
``` | ||
iris export <flags> | ||
``` | ||
### Flags | ||
|
||
| Name,shorthand | type | Required | Default | Description | | ||
| ------------------- | ----- | -------- | -------- | -------------- | | ||
| --for-zero-height | bool | false | false | Do some clean up work before exporting state. If you want use the exported state to start a new blockchain, please add this flag. Otherwise, just leave out it | | ||
| --home | string | false | $HOME/.iris | Specify the directory which stores node config and blockchain data | | ||
| --output-file | string | false | genesis.json | Target file to save exported state | | ||
|
||
|
||
1. Export the current blockchain state | ||
|
||
``` | ||
iris export --home=<path_to_your_home> | ||
``` | ||
|
||
2. If you want to export the the current blockchain state and use the exported state as genesis state of another blockchain | ||
``` | ||
iris export --for-zero-height --home=<path_to_your_home> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Reset Blockchain State | ||
|
||
## Description | ||
|
||
IRISnet can reset blockchain state at any height. This can be accomplished by command `iris reset`. | ||
|
||
## Usage | ||
``` | ||
iris reset <flags> | ||
``` | ||
### Flags | ||
|
||
| Name,shorthand | type | Required | Default | Description | | ||
| ------------------- | ----- | -------- | -------- | -------------- | | ||
| --height | int | false | 0 | Specify the height, default value is 0 which means to export the latest state | | ||
| --home | string | false | $HOME/.iris | Specify the directory which stores node config and blockchain data | | ||
|
||
1. Reset the blockchain state to block 100: | ||
``` | ||
iris reset --height 100 --home=<path_to_your_home> | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Reset Blockchain State | ||
|
||
## Description | ||
|
||
IRISnet支持重置区块链状态到任意高度,这里介绍重置区块链状态所用的命令为`iris reset`。 | ||
|
||
## Usage | ||
``` | ||
iris reset <flags> | ||
``` | ||
### Flags | ||
|
||
| Name,shorthand | type | Required | Default | Description | | ||
| ------------------- | ----- | -------- | -------- | -------------- | | ||
| --height | int | false | 0 | Specify the height, default value is 0 which means to export the latest state | | ||
| --home | string | false | $HOME/.iris | Specify the directory which stores node config and blockchain data | | ||
|
||
1. 重置区块链状态到区块100: | ||
``` | ||
iris reset --height 100 --home=<path_to_your_home> | ||
``` |