Nethereum.CoreChain.RocksDB 6.0.4

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Nethereum.CoreChain.RocksDB --version 6.0.4
                    
NuGet\Install-Package Nethereum.CoreChain.RocksDB -Version 6.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nethereum.CoreChain.RocksDB" Version="6.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nethereum.CoreChain.RocksDB" Version="6.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Nethereum.CoreChain.RocksDB" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nethereum.CoreChain.RocksDB --version 6.0.4
                    
#r "nuget: Nethereum.CoreChain.RocksDB, 6.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nethereum.CoreChain.RocksDB@6.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nethereum.CoreChain.RocksDB&version=6.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Nethereum.CoreChain.RocksDB&version=6.0.4
                    
Install as a Cake Tool

Nethereum.CoreChain.RocksDB

High-performance persistent storage for Nethereum CoreChain using RocksDB.

Overview

This package provides RocksDB-backed implementations of all CoreChain storage interfaces, enabling persistent blockchain data storage with excellent read/write performance.

Features

  • Persistent Storage: Data survives application restarts
  • High Performance: Optimized for blockchain workloads with column families
  • Atomic Writes: WriteBatch support for transactional consistency
  • Bloom Filters: Fast key existence checks
  • LZ4 Compression: Reduced disk usage
  • Snapshot Support: Efficient state snapshots for EVM execution

Installation

dotnet add package Nethereum.CoreChain.RocksDB

Quick Start

Using Dependency Injection

using Nethereum.CoreChain.RocksDB;

services.AddRocksDbStorage("./chaindata");

// Or with options
services.AddRocksDbStorage(new RocksDbStorageOptions
{
    DatabasePath = "./chaindata",
    BlockCacheSize = 256 * 1024 * 1024, // 256MB
    EnableStatistics = true
});

Direct Usage

using Nethereum.CoreChain.RocksDB;
using Nethereum.CoreChain.RocksDB.Stores;

var options = new RocksDbStorageOptions
{
    DatabasePath = "./chaindata"
};

using var manager = new RocksDbManager(options);

var blockStore = new RocksDbBlockStore(manager);
var stateStore = new RocksDbStateStore(manager);
var trieStore = new RocksDbTrieNodeStore(manager);

Storage Interfaces Implemented

Interface Implementation Description
IBlockStore RocksDbBlockStore Block headers by hash/number
ITransactionStore RocksDbTransactionStore Transactions with location metadata
IReceiptStore RocksDbReceiptStore Transaction receipts
IStateStore RocksDbStateStore Account state, storage, code
ILogStore RocksDbLogStore Event logs with filtering
ITrieNodeStore RocksDbTrieNodeStore Patricia Merkle Trie nodes
IFilterStore RocksDbFilterStore Active log/block filters

Column Families

Data is organized into column families for optimal performance:

Column Family Data Type
blocks Block headers
block_numbers Block number to hash index
transactions Signed transactions
tx_by_block Block to transaction index
receipts Transaction receipts
logs Event logs
log_by_block Block to log index
log_by_address Address to log index
state_accounts Account data
state_storage Contract storage
state_code Contract bytecode
trie_nodes Patricia trie nodes
filters Active filters
metadata Chain metadata

Configuration Options

var options = new RocksDbStorageOptions
{
    // Database location
    DatabasePath = "./chaindata",

    // Read performance (default: 128MB)
    BlockCacheSize = 128 * 1024 * 1024,

    // Write buffer size (default: 64MB)
    WriteBufferSize = 64 * 1024 * 1024,

    // Number of write buffers (default: 3)
    MaxWriteBufferNumber = 3,

    // Background compaction threads (default: 4)
    MaxBackgroundCompactions = 4,

    // Background flush threads (default: 2)
    MaxBackgroundFlushes = 2,

    // Bloom filter bits per key (default: 10)
    BloomFilterBitsPerKey = 10,

    // Enable statistics (default: false)
    EnableStatistics = false
};

State Snapshots

The state store supports snapshots for EVM execution rollback:

var stateStore = new RocksDbStateStore(manager);

// Create snapshot before execution
var snapshot = await stateStore.CreateSnapshotAsync();

try
{
    // Modify state
    snapshot.SetAccount(address, account);
    snapshot.SetStorage(address, slot, value);

    // Commit on success
    await stateStore.CommitSnapshotAsync(snapshot);
}
catch
{
    // Revert on failure (changes are discarded)
    await stateStore.RevertSnapshotAsync(snapshot);
}
finally
{
    snapshot.Dispose();
}

Performance Tips

  1. Block Cache: Increase BlockCacheSize for read-heavy workloads
  2. Write Buffer: Increase WriteBufferSize for write-heavy workloads
  3. Compaction: Tune MaxBackgroundCompactions based on CPU cores
  4. Bloom Filters: Enabled by default for fast key lookups

Integration with DevChain

Use with Nethereum.DevChain.Server for persistent development chains:

nethereum-devchain --datadir ./chaindata
  • Nethereum.CoreChain - Core blockchain infrastructure
  • Nethereum.DevChain - Development chain handlers
  • Nethereum.DevChain.Server - HTTP RPC server

Requirements

  • .NET 8.0 or .NET 9.0
  • RocksDB native libraries (included via NuGet)
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Nethereum.CoreChain.RocksDB:

Package Downloads
Nethereum.AppChain

Nethereum AppChain - Application-specific blockchain with RocksDB storage, MUD World integration, and genesis configuration

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.1.0 74 3/25/2026
6.0.4 92 3/18/2026
6.0.3 81 3/18/2026
6.0.1 89 3/17/2026
6.0.0 96 3/16/2026