forked from oracleNetworkProtocol/plugchain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v1.0-docs-update' into main
- Loading branch information
Showing
57 changed files
with
2,017 additions
and
1,190 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
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
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
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,105 @@ | ||
--- | ||
order: 8 | ||
--- | ||
|
||
|
||
|
||
# Disk Usage Optimization | ||
|
||
Customize the configuration settings to lower the disk requirements for your validator node | ||
|
||
Blockchain database tends to grow over time, depending e.g. on block | ||
speed and transaction amount. For Plugchain, we are talking about close to | ||
100GB of disk usage in first two weeks. | ||
|
||
There are few configurations that can be done to reduce the required | ||
disk usage quite significantly. Some of these changes take full effect | ||
only when you do the configuration and start syncing from start with | ||
them in use. | ||
|
||
## Indexing | ||
|
||
If you do not need to query transactions from the specific node, you can | ||
disable indexing. On `config.toml` set | ||
|
||
```toml | ||
indexer = "null" | ||
``` | ||
|
||
If you do this on already synced node, the collected index is not purged | ||
automatically, you need to delete it manually. The index is located | ||
under the database directory with name `data/tx_index.db/`. | ||
|
||
## State-sync snapshots | ||
|
||
I believe this was disabled by default on Plugchain, but listing it in any | ||
case here. On `app.toml` set | ||
|
||
```toml | ||
snapshot-interval = 0 | ||
``` | ||
|
||
Note that if state-sync was enabled on the network and working properly, | ||
it would allow one to sync a new node in few minutes. But this node | ||
would not have the history. | ||
|
||
## Configure pruning | ||
|
||
By default every 500th state, and the last 100 states are kept. This | ||
consumes a lot of disk space on long run, and can be optimized with | ||
following custom configuration: | ||
|
||
```toml | ||
pruning = "custom" | ||
pruning-keep-recent = "100" | ||
pruning-keep-every = "0" | ||
pruning-interval = "10" | ||
``` | ||
|
||
Configuring `pruning-keep-recent = "0"` might sound tempting, but this | ||
will risk database corruption if the `plugchaind` is killed for any reason. | ||
Thus, it is recommended to keep the few latest states. | ||
|
||
## Logging | ||
|
||
By default the logging level is set to `info`, and this produces a lot of | ||
logs. This log level might be good when starting up to see that the | ||
node starts syncing properly. However, after you see the syncing is | ||
going smoothly, you can lower the log level to `warn` (or `error`). On | ||
`config.toml` set the following | ||
|
||
```toml | ||
log_level = "warn" | ||
``` | ||
|
||
Also ensure your log rotation is configured properly. | ||
|
||
## Results | ||
|
||
Below is the disk usage after two weeks of Plugchain Arsia Mons testnet. The default | ||
configuration results in disk usage of 90GB. | ||
|
||
```bash | ||
5.3G ./state.db | ||
70G ./application.db | ||
20K ./snapshots/metadata.db | ||
24K ./snapshots | ||
9.0G ./blockstore.db | ||
20K ./evidence.db | ||
1018M ./cs.wal | ||
4.7G ./tx_index.db | ||
90G . | ||
``` | ||
|
||
This optimized configuration has reduced the disk usage to 17 GB. | ||
|
||
```bash | ||
17G . | ||
1.1G ./cs.wal | ||
946M ./application.db | ||
20K ./evidence.db | ||
9.1G ./blockstore.db | ||
24K ./snapshots | ||
20K ./snapshots/metadata.db | ||
5.3G ./state.db | ||
``` |
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
order: 7 | ||
--- | ||
# Key | ||
|
||
## A note on HD wallet | ||
|
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
Oops, something went wrong.