Nethereum.BlockchainStorage.Processors
6.0.1
Prefix Reserved
See the version list below for details.
dotnet add package Nethereum.BlockchainStorage.Processors --version 6.0.1
NuGet\Install-Package Nethereum.BlockchainStorage.Processors -Version 6.0.1
<PackageReference Include="Nethereum.BlockchainStorage.Processors" Version="6.0.1" />
<PackageVersion Include="Nethereum.BlockchainStorage.Processors" Version="6.0.1" />
<PackageReference Include="Nethereum.BlockchainStorage.Processors" />
paket add Nethereum.BlockchainStorage.Processors --version 6.0.1
#r "nuget: Nethereum.BlockchainStorage.Processors, 6.0.1"
#:package Nethereum.BlockchainStorage.Processors@6.0.1
#addin nuget:?package=Nethereum.BlockchainStorage.Processors&version=6.0.1
#tool nuget:?package=Nethereum.BlockchainStorage.Processors&version=6.0.1
Nethereum.BlockchainStorage.Processors
Database-agnostic background hosted services for indexing Ethereum blockchain data with automatic retry, reorg handling, and internal transaction tracing.
Overview
Nethereum.BlockchainStorage.Processors provides ready-to-use BackgroundService implementations that wire together the Nethereum.BlockchainProcessing pipeline with any EF Core-based blockchain storage provider. This package contains the processing logic; pair it with a provider-specific package for DI registration.
Two processors are included:
- Block processor - Crawls blocks, transactions, receipts, logs, and contract creations. Handles reorgs by marking non-canonical records and re-indexing.
- Internal transaction processor - Traces transactions via
debug_traceTransaction(call tracer) and stores internal calls. Runs behind the block processor, capped to the main processor's progress.
Key Features
BlockchainProcessingHostedServiceruns the block processing pipeline as aBackgroundServiceInternalTransactionProcessingHostedServicetraces internal transactions as a separateBackgroundService- Exponential backoff retry via
RetryRunner.RunWithExponentialBackoffAsync() - Chain ID validation on startup via
ChainStateValidationService.EnsureChainIdMatchesAsync() - Reorg detection and handling: marks blocks, transactions, logs, and token transfers as non-canonical
- Batch receipt fetching (
UseBatchReceiptsoption, enabled by default) - Contract code retrieval on deployment
- Configurable via
BlockchainProcessingOptionsfromIConfiguration
Installation
Use the provider-specific package instead of referencing this package directly:
dotnet add package Nethereum.BlockchainStorage.Processors.Postgres
dotnet add package Nethereum.BlockchainStorage.Processors.SqlServer
dotnet add package Nethereum.BlockchainStorage.Processors.Sqlite
Configuration
Options are bound from IConfiguration. The extension method checks for a "BlockchainProcessing" section first; if absent, it reads from the root configuration.
{
"BlockchainUrl": "http://localhost:8545",
"BlockchainProcessing": {
"BlockchainUrl": "http://localhost:8545",
"MinimumBlockConfirmations": 12,
"FromBlock": 0,
"ReorgBuffer": 10,
"UseBatchReceipts": true
}
}
BlockchainProcessingOptions
| Property | Type | Default | Description |
|---|---|---|---|
BlockchainUrl |
string |
required | JSON-RPC endpoint URL |
Name |
string |
null |
Optional chain name for logging |
MinimumBlockConfirmations |
uint? |
12 |
Blocks behind chain head to wait before processing |
FromBlock |
BigInteger? |
null |
Starting block if no progress exists |
ToBlock |
BigInteger? |
null |
Stop at this block (null = continuous) |
ReorgBuffer |
int |
0 |
Number of blocks to re-check for reorgs |
UseBatchReceipts |
bool |
true |
Use eth_getBlockReceipts instead of individual receipt calls |
NumberOfBlocksToProcessPerRequest |
int |
1000 |
Batch size for log retrieval |
RetryWeight |
int |
50 |
Reduce batch size on retry failures |
ProcessBlockTransactionsInParallel |
bool |
true |
Parallel transaction processing within a block |
PostVm |
bool |
false |
Include VM stack traces |
Related Packages
Provider-Specific Packages
- Nethereum.BlockchainStorage.Processors.Postgres - PostgreSQL DI registration
- Nethereum.BlockchainStorage.Processors.SqlServer - SQL Server DI registration
- Nethereum.BlockchainStorage.Processors.Sqlite - SQLite DI registration
See Also
- Nethereum.BlockchainProcessing - Core processing framework
- Nethereum.BlockchainStore.EFCore - Base EF Core storage layer
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.2)
- Microsoft.Extensions.Configuration.Json (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Logging (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Nethereum.BlockchainStore.EFCore (>= 6.0.1)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Nethereum.BlockchainStorage.Processors:
| Package | Downloads |
|---|---|
|
Nethereum.BlockchainStorage.Processors.SqlServer
SQL Server-specific DI registration for the Nethereum blockchain indexer hosted services. |
|
|
Nethereum.BlockchainStorage.Processors.Sqlite
SQLite-specific DI registration for the Nethereum blockchain indexer hosted services. |
|
|
Nethereum.BlockchainStorage.Processors.Postgres
PostgreSQL-specific DI registration for the Nethereum blockchain indexer hosted services. |
GitHub repositories
This package is not used by any popular GitHub repositories.