forked from Consensys/doc.teku
-
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.
Add instructions to migrate a database. (Consensys#287)
* Add CLI option to disable built-in slashing protection for external signers. Signed-off-by: Byron Gravenorst <[email protected]> * Add instructions to connect to mainnet. Signed-off-by: Byron Gravenorst <[email protected]> * updating submodule to latest * Add instructions to connect to mainnet. Signed-off-by: Byron Gravenorst <[email protected]> * Fix markdown issue. Signed-off-by: Byron Gravenorst <[email protected]> * Add instructions to migrate a database. Signed-off-by: bgravenorst <[email protected]> * Add instructions to migrate a database. Signed-off-by: bgravenorst <[email protected]> * Fix markdown issues. Signed-off-by: bgravenorst <[email protected]> * update submodule * Address reviewer feedback. Signed-off-by: bgravenorst <[email protected]> Co-authored-by: Nicolas MASSART <[email protected]>
- Loading branch information
1 parent
bdaac18
commit 96cf286
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
Submodule common
updated
7 files
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,51 @@ | ||
--- | ||
description: How to migrate a RocksDB database to a LevelDB2 database. | ||
--- | ||
|
||
# Migrate the database | ||
|
||
As of v21.5.0, new Teku installations use a LevelDB2 database. Previous Teku versions use | ||
RocksDB which continue to be supported. | ||
|
||
LevelDB2 databases use less memory and are proven to be more stable with Teku. Users can migrate | ||
Teku nodes running a RocksDB database to a LevelDB2 database if the Teku node runs in [pruning mode]. | ||
|
||
!!! warning | ||
|
||
Teku nodes running in [archive mode] have to resync from genesis to migrate. Tools to migrate | ||
existing databases will be provided in future releases. | ||
|
||
To migrate a RocksDB database in [pruning mode] to a LevelDB2 database: | ||
|
||
1. [Download the latest finalized state] from a beacon chain node: | ||
|
||
```bash | ||
curl -o state.ssz -H 'Accept: application/octet-stream' http://other-node:5051/eth/v1/debug/beacon/states/finalized | ||
``` | ||
|
||
!!! note | ||
|
||
This step is optional, you can also [supply the finalized checkpoint state] via URL from a beacon | ||
chain node or Infura when restarting Teku in the step below. | ||
|
||
1. Stop the Teku node you intend to migrate. | ||
|
||
1. Delete the `beacon` directory in your | ||
[data path](../Reference/CLI/CLI-Syntax.md#data-base-path-data-path). | ||
|
||
!!! warning | ||
|
||
Ensure not to delete the `validator` directory if one is present as this contains your | ||
slashing protection data. | ||
|
||
1. Restart Teku and specify the downloaded finalized state using the | ||
[`--initial-state`](../Reference/CLI/CLI-Syntax.md#initial-state) command. | ||
|
||
Teku creates a LevelDB2 database, and starts from the specified recent state. Teku should be in | ||
sync and validating within minutes. | ||
|
||
<!-- links --> | ||
[Download the latest finalized state]: https://consensys.github.io/teku/#operation/getEthV1DebugBeaconStatesWithState_id | ||
[pruning mode]: ../Reference/CLI/CLI-Syntax.md#data-storage-mode | ||
[archive mode]: ../Reference/CLI/CLI-Syntax.md#data-storage-mode | ||
[supply the finalized checkpoint state]: Get-Started/Checkpoint-Start.md |
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