Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 88a0032

Browse files
authored
node-template README persistent db (#10558)
1 parent f57c644 commit 88a0032

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

bin/node-template/README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ node.
5555

5656
### Single-Node Development Chain
5757

58-
This command will start the single-node development chain with persistent state:
58+
This command will start the single-node development chain with non-persistent state:
5959

6060
```bash
6161
./target/release/node-template --dev
@@ -72,6 +72,36 @@ Start the development chain with detailed logging:
7272
```bash
7373
RUST_BACKTRACE=1 ./target/release/node-template -ldebug --dev
7474
```
75+
> Development chain means that the state of our chain will be in a tmp folder while the nodes are
76+
> running. Also, **alice** account will be authority and sudo account as declared in the [genesis
77+
> state](https://github.com/substrate-developer-hub/substrate-node-template/blob/main/node/src/chain_spec.rs#L49).
78+
> At the same time the following accounts will be prefunded:
79+
> - Alice
80+
> - Bob
81+
> - Alice//stash
82+
> - Bob//stash
83+
84+
In case of being interested in maintaining the chain' state futher in time a base path other than
85+
a temporary directory must be added so the db can be stored in the provided folder. We could use
86+
this folder to store different chain databases, as a different folder will be created per different
87+
chain that is ran. The following commands shows how to use a newly created folder as our db base
88+
path.
89+
90+
```bash
91+
// Create a folder to use as the db base path
92+
$ mkdir my-chain-state
93+
94+
// Use of that folder to store the chain state
95+
$ ./target/release/node-template --dev --base-path ./my-chain-state/
96+
97+
// Check the folder structure created inside the base path after running the chain
98+
$ ls ./my-chain-state
99+
chains
100+
$ ls ./my-chain-state/chains/
101+
dev
102+
$ ls ./my-chain-state/chains/dev
103+
db keystore network
104+
```
75105

76106
### Connect with Polkadot-JS Apps Front-end
77107

0 commit comments

Comments
 (0)