![]() |
VOOZH | about |
dotnet add package Nethereum.Explorer --version 6.1.0
NuGet\Install-Package Nethereum.Explorer -Version 6.1.0
<PackageReference Include="Nethereum.Explorer" Version="6.1.0" />
<PackageVersion Include="Nethereum.Explorer" Version="6.1.0" />Directory.Packages.props
<PackageReference Include="Nethereum.Explorer" />Project file
paket add Nethereum.Explorer --version 6.1.0
#r "nuget: Nethereum.Explorer, 6.1.0"
#:package Nethereum.Explorer@6.1.0
#addin nuget:?package=Nethereum.Explorer&version=6.1.0Install as a Cake Addin
#tool nuget:?package=Nethereum.Explorer&version=6.1.0Install as a Cake Tool
Blazor Server blockchain explorer Razor Class Library for Ethereum-compatible chains with indexed storage, ABI decoding, EVM debugging, and wallet interaction.
Nethereum.Explorer is a Razor Class Library (RCL) that provides a complete blockchain explorer UI as embeddable Blazor Server components. It reads from an indexed PostgreSQL database populated by a separate blockchain processor, and optionally connects to a live RPC endpoint for balance queries and contract interaction.
The Explorer is designed for progressive integration: at minimum it requires a blockchain storage database, and optionally adds token indexing, MUD World browsing, EVM debugging, and live RPC features as additional dependencies are registered.
dotnet add package Nethereum.Explorer
Requires net10.0. Uses EF Core 10 and MapStaticAssets().
IBlockchainDbContextFactory for indexed block/transaction/log/contract queriesEthereumAuthenticationStateProviderRequires Nethereum.BlockchainStore.Postgres to provide IBlockchainDbContextFactory. This enables block, transaction, account, contract, and log browsing from indexed data.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddPostgresBlockchainStorage(connectionString);
builder.Services.AddExplorerServices(builder.Configuration);
var app = builder.Build();
app.UseRateLimiter();
app.UseAntiforgery();
app.MapStaticAssets();
app.MapRazorComponents<Nethereum.Explorer.Components.App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(
typeof(Nethereum.Blazor.EIP6963WalletInterop.EIP6963WalletBlazorInterop).Assembly);
app.MapTokenApiEndpoints();
app.MapContractApiEndpoints();
app.Run();
The database must be populated by a separate blockchain processor/indexer. Without indexed data, pages will be empty.
Register Nethereum.BlockchainStorage.Token.Postgres to enable token balances, NFT inventory, and transfer history pages. The Explorer checks at runtime for ITokenBalanceRepository, INFTInventoryRepository, ITokenTransferLogRepository, and ITokenMetadataRepository. If all four are present, TokenExplorerService is used. If any are missing, NullTokenExplorerService is registered instead (returns empty results, IsAvailable = false).
builder.Services.AddPostgresBlockchainStorage(connectionString);
builder.Services.AddTokenPostgresRepositories(connectionString);
builder.Services.AddExplorerServices(builder.Configuration);
Register Nethereum.Mud.Repositories.Postgres to enable MUD World record browsing. The MudExplorerService checks for IMudStoreRecordsDbSets at runtime; if null, IsAvailable returns false and MUD pages show empty state.
builder.Services.AddDbContext<MudPostgresStoreRecordsDbContext>(options =>
options.UseNpgsql(connectionString).UseLowerCaseNamingConvention());
builder.Services.AddScoped<IMudStoreRecordsDbSets>(sp =>
sp.GetRequiredService<MudPostgresStoreRecordsDbContext>());
builder.Services.AddTransient<INormalisedTableQueryService>(sp =>
{
var conn = new NpgsqlConnection(connectionString);
var logger = sp.GetService<ILogger<NormalisedTableQueryService>>();
return new NormalisedTableQueryService(conn, logger);
});
Configure an RPC endpoint to enable live balance/nonce queries, contract interaction, state diffs, and pending transactions.
The ExplorerWeb3Factory resolves the RPC URL in this order:
ExplorerOptions.RpcUrl (from Explorer:RpcUrl in configuration)ConnectionStrings:devchain{
"Explorer": {
"RpcUrl": "http://localhost:8545"
}
}
Without RPC, account pages show only database-stored state and contract write functions are unavailable.
| Route | Page | Description |
|---|---|---|
/ |
Home | Latest blocks and transactions, chain stats (block height, chain ID), add-chain-to-wallet button, 5-second auto-refresh |
/blocks |
Blocks | Paginated block list with gas usage percentage, validator, age. CSV export |
/block/{BlockNumberOrHash} |
Block Detail | Block header fields, state/receipts roots, prev/next navigation, JSON toggle, transaction list |
/transactions |
Transactions | Paginated transaction list. CSV export |
/transaction/{TxHash} |
Transaction Detail | Status, gas metrics, decoded input, event logs, token transfers, internal transactions (from indexed DB), blob data (type 3), EIP-7702 authorizations (type 4), state diffs via PrestateTracer (if EnableTracing and RPC available) |
/transaction/{TxHash}/debug |
EVM Debugger | Opcode-level step-through execution with Solidity source mapping, memory/stack/storage inspection, call graph, and revert analysis. Requires EnableEvmDebugger and RPC |
/pending |
Pending Transactions | Pending and queued transactions from txpool_content (requires EnablePendingTransactions and RPC) |
/accounts |
Accounts | Paginated address list with transaction counts, EOA/contract badges |
/account/{Address} |
Account Detail | Balance, nonce, QR code, transaction history with direction filter (all/in/out/self), internal transactions tab, token balances (if indexed), NFT inventory |
/account/{Address}/tokens |
Account Tokens | Tabbed view: token balances, NFT inventory, token transfer history |
/contracts |
Contracts | Paginated contract list with creator address and creation transaction |
/contract/{Address} |
Contract Detail | ABI-decoded read/write functions, event log history, bytecode, source code (if available from ABI source) |
/mud |
MUD Worlds | World address cards with table and record counts |
/mud/tables/{Address?} |
MUD Tables | Table cards with key/value field lists, resource type badges, normalised SQL indicator |
/mud/records/{Address?}/{TableId?} |
MUD Records | Three view modes: raw hex, decoded (schema-aware), normalised SQL. Query builder with filters and ordering |
The search bar in the navbar resolves multiple input types:
.eth domain names are resolved via ENS registry when RPC is availableRecent searches are tracked per session and shown in a dropdown for quick access.
A dark/light theme toggle is available in the navbar. The selected theme persists to localStorage under the key explorer-theme. All components including the Monaco editor (used by the EVM debugger) adapt to the selected theme.
The Explorer supports English (en) and Spanish (es) via the ExplorerLocalizer service. A language selector dropdown in the navbar allows switching at runtime. All page titles, labels, table headers, error messages, and empty states are localised.
The transaction detail page includes a "Debug" button (when EnableEvmDebugger is true and RPC is available) that navigates to a full EVM debugger:
debug_traceTransaction with an opcode tracerAbiSources.SourceBasePath)The Explorer uses EIP-6963 for browser wallet discovery. When a wallet is connected:
wallet_addEthereumChainEthereumAuthenticationStateProviderBound from IConfiguration section "Explorer" into ExplorerOptions:
| Property | Type | Default | Description |
|---|---|---|---|
RpcUrl |
string? |
null |
RPC endpoint. Falls back to ConnectionStrings:devchain |
ChainName |
string |
"DevChain" |
Chain display name |
ChainId |
long |
31337 |
Network chain ID |
CurrencySymbol |
string |
"ETH" |
Native currency symbol |
CurrencyName |
string |
"Ether" |
Native currency name |
CurrencyDecimals |
uint |
18 |
Native currency decimals |
BlockExplorerUrl |
string? |
null |
External block explorer link |
ExplorerTitle |
string |
"Nethereum Explorer" |
Browser page title |
ExplorerBrandName |
string |
"Nethereum" |
Navbar brand name |
ExplorerBrandSuffix |
string |
"Explorer" |
Navbar brand suffix |
LogoUrl |
string? |
null |
Logo image URL |
FaviconUrl |
string? |
null |
Favicon URL |
ApiKey |
string? |
null |
Optional dev-time guard for ABI upload POST endpoints (X-Api-Key header). If null, POST endpoints are open |
EnableMud |
bool |
true |
Show MUD World browser pages |
EnableTokens |
bool |
true |
Show token sections on account pages |
EnableTracing |
bool |
true |
Show state diff card on transaction detail (requires RPC with debug namespace) |
EnableInternalTransactions |
bool |
true |
Show internal transaction views |
EnablePendingTransactions |
bool |
false |
Show pending transaction page |
EnableEvmDebugger |
bool |
true |
Show EVM debugger button on transaction detail (requires RPC with debug namespace) |
RpcRequestTimeoutSeconds |
int |
30 |
RPC call timeout |
Pagination uses a fixed page size of 25 items, clamped to a maximum of 100 for API requests (defined in ExplorerConstants).
AbiSources sub-section)ABI resolution uses a composite chain. Sources are checked in order; results are cached in a singleton in-memory cache shared across all Blazor circuits.
| Property | Type | Default | Description |
|---|---|---|---|
SourcifyEnabled |
bool |
true |
Query Sourcify for verified contract metadata |
FourByteEnabled |
bool |
false |
Query 4Byte Directory for function signatures |
EtherscanEnabled |
bool |
false |
Query Etherscan for contract ABI |
EtherscanApiKey |
string? |
null |
Required when EtherscanEnabled is true |
LocalStorageEnabled |
bool |
false |
Read/write ABIs from local filesystem |
LocalStoragePath |
string? |
null |
Directory path for local ABI storage |
SourceBasePath |
string? |
null |
Base path for Solidity source files used by the EVM debugger for source mapping |
Resolution order: in-memory cache, local filesystem (if enabled, highest priority), Sourcify, Etherscan, 4Byte. Falls back to local-only if no sources are configured.
All endpoints are rate-limited: 100 requests per minute, fixed window, 429 on rejection.
/api/tokens)| Method | Route | Parameters | Description |
|---|---|---|---|
| GET | /{address}/balances |
- | Token balances for address |
| GET | /{address}/nfts |
- | NFT inventory for address |
| GET | /{address}/transfers |
page, pageSize |
Token transfer history for address |
| GET | /contract/{contractAddress}/transfers |
page, pageSize |
Transfers for a token contract |
| GET | /contract/{contractAddress}/metadata |
- | Token name, symbol, decimals, type |
Returns 503 { error: "Token indexing not configured" } if ITokenExplorerService.IsAvailable is false.
/api/contracts)| Method | Route | Description |
|---|---|---|
| GET | /{address}/abi |
Retrieve stored ABI for a contract |
| POST | /{address}/abi |
Upload ABI for a contract. Body: { "abi": "...", "name": "..." } |
| POST | /batch |
Batch upload (max 50). Body: { "contracts": [{ "address": "...", "abi": "...", "name": "..." }] } |
POST endpoints validate ABI JSON via ABIDeserialiserFactory.DeserialiseContractABI(). If ExplorerOptions.ApiKey is set, POST requests must include a matching X-Api-Key header (simple ordinal string check, intended as a dev-time guard — not a production auth mechanism). If ApiKey is null (the default), POST endpoints are open.
The Aspire Explorer host resolves RPC URL via service discovery (services:devchain:http:0 or services:devchain:https:0) and connection strings from Aspire resources:
// AppHost
var postgres = builder.AddPostgres("postgres").AddDatabase("nethereumdb");
var devchain = builder.AddProject<Projects.DevChainServer>("devchain");
builder.AddProject<Projects.ExplorerHost>("explorer")
.WithReference(postgres)
.WithReference(devchain)
.WithExternalHttpEndpoints();
// Explorer host
builder.AddServiceDefaults();
var connectionString = builder.Configuration.GetConnectionString("nethereumdb");
builder.Services.AddPostgresBlockchainStorage(connectionString);
builder.Services.AddTokenPostgresRepositories(connectionString);
builder.Services.AddExplorerServices(builder.Configuration);
IBlockchainDbContextFactory via AddPostgresBlockchainStorage()AddTokenPostgresRepositories()| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.