Node Databases
This page will describe the databases used by the Node. These are simple key-value storage units that will hold different types of data, as described below.
Databasesβ
Nodes use simple Key-Value type databases.
Nodes use Serial LevelDB databases to persist processed blocks, transactions, and so on.
Data retention can be controlled in config.toml
using pruning flags. There are two flags for the latest versions:
ValidatorCleanOldEpochsData
ObserverCleanOldEpochsData
For older configurations, the single flag is:
CleanOldEpochsData
Setting these flags to false prevents the deletion of old databases.
By default, validators only keep the last 4 epochs and delete older ones for freeing disk space.
The default databases directory is <node-working-directory>/db
and it's content should match the following structure:
During startup, nodes check for an existing database and sync any missing data from the network to match the current network height.
Starting a Node with Existing Databases
When both the configuration and the database shard match, the node inherits the full database state and needs to sync only the remaining items. For example, if a node starts with a database at epoch 255 and the current epoch is 256, it will sync only the missing epoch data.
The configuration of the new node should mirror that of the predecessor, with the exception of the BLS key, which does not depend on the database.
To expedite synchronization, it's possible to copy the fully synced database from another node. This process involves transferring the entire db/
directory from the source to the target node.
Last updated