♾️
OneFinity Docs
πŸŽ“ LearnπŸ›  BuildπŸ’Ύ Testnet πŸ‘” ProtocolπŸ”„ Bridge
  • Welcome to OneFinity
  • OneFinity
    • What is OneFinity
    • OneFinity approach
    • What is a Sovereign Shard?
  • Technology
    • Basic concepts
      • Nodes and Wallets
      • Epoch and Rounds
      • Secure Proof of Stake
      • Glossary
    • Sovereign Shard
    • WASM Virtual Machine
    • Ethereum Virtual Machine (EVM)
    • ESDT vs ERC-20
    • Run a OneFinity node
      • System Requirements
      • Configuration
      • Installation
      • Updates
      • Management
      • Nodes
        • Rating
        • Redundancy Setup
        • Configuration files
        • Operation modes
        • Node Databases
        • Import Database
        • Node CLI
      • Staking
      • Unstaking
      • Jail/Unjail
      • Staking Smart Contract
      • Keys
        • Validator Keys
        • Wallet Keys
        • Multikey nodes
  • Validators
    • Overview
    • Git repo
    • Binaries
    • Go
    • General setup
    • How to generate a Validator pem
    • Node start
    • Interact with the blockchain
    • Unjail
  • OneFinity Protocol
    • Overview
    • Governance
    • Protocol Rewards
      • Validators
      • Delegators
      • Staking Agencies
    • ONE Token
    • OG Validators: NFT Staking
  • Technical documentation
    • Overview
    • Integration of the Ethereum Virtual Machine (EVM)
    • Integration of the Ethereum Remote Procedure Call (RPC)
    • Interoperability between Ethereum and MultiversX ecosystems
    • Tools and SDKs for developers
    • Environments
  • Bridges
  • Ecosystem
  • Grants
  • FAQs
  • Social Media
  • Roadmap & Tokenomics
  • Team
Powered by GitBook
On this page
  • Databases​
  • Starting a Node with Existing Databases
  1. Technology
  2. Run a OneFinity node
  3. Nodes

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.

PreviousOperation modesNextImport Database

Last updated 1 year ago

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:

/db
└── <chain id>
    β”œβ”€β”€ Epoch_X
    β”‚  └── Shard_X -------->
    β”‚        β”œβ”€β”€ BlockHeaders
    β”‚        β”‚    β”œβ”€β”€ 000001.log
    β”‚        β”‚    β”œβ”€β”€ CURRENT
    β”‚        β”‚    β”œβ”€β”€ LOCK
    β”‚        β”‚    β”œβ”€β”€ LOG
    β”‚        β”‚    └── MANIFEST-000000
    β”‚        β”œβ”€β”€ BootstrapData
    β”‚        β”‚    β”œβ”€β”€ 000001.log
    |     .............
    └── Static
        └── Shard_X -------->
            β”œβ”€β”€ AccountsTrie
            β”‚     └── MainDB
            β”‚           β”œβ”€β”€ 000001.log
         .............

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.

​