Welcome to CosVM
  • πŸ•§What is CosVM?
  • 🚧Technical structure
  • ⛓️User Guide
    • CVM Wallet Configuration
    • CVM Wallet App
    • MetaMask Configuration
    • Keplr Wallet Configuration
    • Trust Wallet
  • πŸ”―Developer Docs
    • πŸ‰‘Concepts
      • Accounts
      • Chain ID
      • Overview of Gas and Fees on CosVM Blockchain
      • Tokenomics of CosVM Blockchain
      • Token
      • Transactions
      • Tokens Transfer
      • Gas and Fees
    • Getting Started
    • Smart Contracts
      • Evm Extension
        • Authorization
        • Types
        • Staking
        • Distribution
        • IBC Transfer
    • πŸ”CosVM Block Explorer
    • Mainnet
    • Wallet Integration
    • Other Tools
      • Contract Verification
      • Smart Contract Development Tools:
    • API
      • Network
      • Ethereum JSON-RPC
        • API Method
      • Cosmos gRPC & REST
      • Tendermint RPC
    • Cosvm using Docker
    • DAPPS
      • Getting Started
      • πŸ«‚CVM dApps
  • 🈳Validator Docs
    • Validator Overview
    • Installation Reqirement
    • Run a Validator
    • Launch a CVM Node
    • Launch Multi CVM Node
    • Disk Optimization
    • State Sync
    • Mempool
    • ❄️IBC
      • IBC
      • IBC Relaying Guide
  • ❓Why Use CosVM
  • πŸ”Safety & Security
  • ⁉️FAQs
Powered by GitBook
On this page
  • CosVM Node Configuration for Disk Usage Optimization
  • Indexing Optimization
  • State-Sync Snapshots
  • Configure Pruning
  • Logging Optimization
  • Results Comparison
  • Default Configuration:
  • Optimized Configuration:
  1. Validator Docs

Disk Optimization

PreviousLaunch Multi CVM NodeNextState Sync

Last updated 1 year ago

CosVM Node Configuration for Disk Usage Optimization

When setting up a validator node for , it's crucial to optimize configuration settings to reduce disk space requirements while maintaining essential functionalities. The blockchain database tends to expand over time due to factors like block speed and transaction volume. However, by customizing certain settings, you can significantly lower the disk usage without compromising the node's performance.

Indexing Optimization

If your node doesn’t require transaction querying, disabling indexing can save substantial disk space. To achieve this, modify the config.toml file:

indexer = "null"

Note: If you disable indexing on a synced node, manually delete the index located at data/tx_index.db/ under the database directory.

State-Sync Snapshots

Ensure that state-sync snapshots are disabled to prevent unnecessary data accumulation. In the app.toml file, set:

snapshot-interval = 0 

Note: Enabling state-sync could facilitate rapid syncing for new nodes but sacrifices historical data.

Configure Pruning

Customize pruning settings to optimize disk usage over time. Adjust the pruning configurations in config.toml:

pruning = "custom"
pruning-keep-recent = "100"
pruning-keep-every = "0"
pruning-interval = "10"

Caution: Avoid setting pruning-keep-recent = "0" to prevent potential database corruption if the CosVM node is unexpectedly terminated.

Logging Optimization

Reduce unnecessary log data by adjusting the log level. Initially set to info, switch it to a lower level after confirming successful node syncing in config.toml:

log_level = "warn" 

Ensure proper log rotation settings for efficient log management.

Results Comparison

Default Configuration:

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     .

Optimized Configuration:

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

Implementing these customized configurations reduces disk usage significantly from 90GB to 17GB while ensuring essential data is retained for optimal CosVM node performance. Adjustments like disabling unnecessary features, optimizing pruning, and minimizing logs can effectively manage disk space without compromising the node's functionality.

Here's a comparison of disk usage after two weeks on the mainnet:

🈳
CosVM
CosVM