![]() |
VOOZH | about |
dotnet add package Nethereum.Geth --version 6.1.0
NuGet\Install-Package Nethereum.Geth -Version 6.1.0
<PackageReference Include="Nethereum.Geth" Version="6.1.0" />
<PackageVersion Include="Nethereum.Geth" Version="6.1.0" />Directory.Packages.props
<PackageReference Include="Nethereum.Geth" />Project file
paket add Nethereum.Geth --version 6.1.0
#r "nuget: Nethereum.Geth, 6.1.0"
#:package Nethereum.Geth@6.1.0
#addin nuget:?package=Nethereum.Geth&version=6.1.0Install as a Cake Addin
#tool nuget:?package=Nethereum.Geth&version=6.1.0Install as a Cake Tool
Extended Web3 library for Go Ethereum (Geth) client. Provides RPC client methods for Admin, Debug, Miner, TxnPool, and Geth-specific Eth APIs.
Nethereum.Geth extends Nethereum.Web3 with Geth-specific JSON-RPC methods. Use Web3Geth instead of Web3 to access additional APIs for node administration, transaction tracing, mining control, and mempool inspection.
API Services:
dotnet add package Nethereum.Geth
Or via Package Manager Console:
Install-Package Nethereum.Geth
Package References:
Replace Web3 with Web3Geth:
using Nethereum.Geth;
var web3 = new Web3Geth("http://localhost:8545");
With account:
using Nethereum.Geth;
using Nethereum.Web3.Accounts;
var account = new Account("PRIVATE_KEY");
var web3 = new Web3Geth(account, "http://localhost:8545");
From: src/Nethereum.Geth/Web3Geth.cs:10
Manage node peers, RPC/HTTP/WS servers, and chain data.
var peers = await web3.Admin.Peers.SendRequestAsync();
Console.WriteLine($"Connected peers: {peers.Count}");
From: tests/Nethereum.Geth.IntegrationTests/Testers/AdminPeersTester.cs:18
var enode = "enode://pubkey@ip:port";
var result = await web3.Admin.AddPeer.SendRequestAsync(enode);
From: src/Nethereum.Geth/RPC/Admin/AdminAddPeer.cs
var nodeInfo = await web3.Admin.NodeInfo.SendRequestAsync();
From: src/Nethereum.Geth/IAdminApiService.cs:16
// Start RPC server
var started = await web3.Admin.StartRPC.SendRequestAsync("localhost", 8545, "*", "web3,eth,net");
// Stop RPC server
var stopped = await web3.Admin.StopRPC.SendRequestAsync();
From: src/Nethereum.Geth/IAdminApiService.cs:17-19
// Export chain to file
var exported = await web3.Admin.ExportChain.SendRequestAsync("/path/to/export.rlp");
// Import chain from file
var imported = await web3.Admin.ImportChain.SendRequestAsync("/path/to/chain.rlp");
From: src/Nethereum.Geth/IAdminApiService.cs:13-14
Transaction and block tracing, profiling, memory statistics.
using Nethereum.Geth.RPC.Debug.DTOs;
using Newtonsoft.Json.Linq;
var txHash = "0x...";
var tracingOptions = new TracingOptions();
var trace = await web3.GethDebug.TraceTransaction.SendRequestAsync<JToken>(txHash, tracingOptions);
From: tests/Nethereum.Geth.IntegrationTests/Testers/DebugTraceTransactionTester.cs:36
Geth supports built-in tracers for structured transaction analysis.
Call Tracer:
using Nethereum.Geth.RPC.Debug.Tracers;
var trace = await web3.GethDebug.TraceTransaction.SendRequestAsync<CallTracerResponse>(
txHash,
new TracingOptions
{
Timeout = "1m",
Reexec = 128,
TracerInfo = new CallTracerInfo(onlyTopCalls: false, withLogs: true)
});
From: tests/Nethereum.Geth.IntegrationTests/Testers/DebugTraceTransactionTester.cs:75
4Byte Tracer (function selector frequency):
var trace = await web3.GethDebug.TraceTransaction.SendRequestAsync<FourByteTracerResponse>(
txHash,
new TracingOptions
{
Timeout = "1m",
Reexec = 128,
TracerInfo = new FourByteTracerInfo()
});
From: tests/Nethereum.Geth.IntegrationTests/Testers/DebugTraceTransactionTester.cs:89
Opcode Tracer (EVM opcode execution):
var trace = await web3.GethDebug.TraceTransaction.SendRequestAsync<OpcodeTracerResponse>(
txHash,
new TracingOptions
{
Timeout = "1m",
Reexec = 128,
TracerInfo = new OpcodeTracerInfo(
enableMemory: true,
disableStack: false,
disableStorage: false,
enableReturnData: true,
debug: false,
limit: 10)
});
From: tests/Nethereum.Geth.IntegrationTests/Testers/DebugTraceTransactionTester.cs:166
Prestate Tracer (account state before execution):
// Prestate mode
var prestateTrace = await web3.GethDebug.TraceTransaction.SendRequestAsync<PrestateTracerResponsePrestateMode>(
txHash,
new TracingOptions
{
Timeout = "1m",
Reexec = 128,
TracerInfo = new PrestateTracerInfo(diffMode: false)
});
// Diff mode
var diffTrace = await web3.GethDebug.TraceTransaction.SendRequestAsync<PrestateTracerResponseDiffMode>(
txHash,
new TracingOptions
{
Timeout = "1m",
Reexec = 128,
TracerInfo = new PrestateTracerInfo(diffMode: true)
});
From: tests/Nethereum.Geth.IntegrationTests/Testers/DebugTraceTransactionTester.cs:180
Additional Tracers:
UnigramTracerInfo - Opcode frequency (single opcodes)BigramTracerInfo - Opcode pairs frequencyTrigramTracerInfo - Opcode triples frequencyOpcountTracerInfo - Total opcode countFrom: tests/Nethereum.Geth.IntegrationTests/Testers/DebugTraceTransactionTester.cs:115-140
var blockNumber = new Nethereum.Hex.HexTypes.HexBigInteger(12345);
var blockTrace = await web3.GethDebug.TraceBlockByNumber.SendRequestAsync(blockNumber, tracingOptions);
From: src/Nethereum.Geth/IDebugApiService.cs:25
var customTracerCode = @"{
data: [],
fault: function(log) {},
step: function(log) { this.data.push(log.op.toString()); },
result: function() { return this.data; }
}";
var trace = await web3.GethDebug.TraceTransaction.SendRequestAsync<JToken>(
txHash,
new TracingOptions
{
Timeout = "1m",
Reexec = 128,
TracerInfo = new CustomTracerInfo(customTracerCode)
});
From: tests/Nethereum.Geth.IntegrationTests/Testers/DebugTraceTransactionTester.cs:205
var memStats = await web3.GethDebug.MemStats.SendRequestAsync();
From: src/Nethereum.Geth/IDebugApiService.cs:14
var blockNumber = new Nethereum.Hex.HexTypes.HexBigInteger(100);
var rlp = await web3.GethDebug.GetBlockRlp.SendRequestAsync(blockNumber);
From: src/Nethereum.Geth/IDebugApiService.cs:12
// Start CPU profiling
await web3.GethDebug.StartCPUProfile.SendRequestAsync("/path/to/profile.prof");
// Stop profiling
await web3.GethDebug.StopCPUProfile.SendRequestAsync();
From: src/Nethereum.Geth/IDebugApiService.cs:19-21
Control mining operations.
// Start with 1 thread (argument is optional, default is 1)
var result = await web3.Miner.Start.SendRequestAsync();
From: tests/Nethereum.Geth.IntegrationTests/Testers/MinerStartTester.cs:16
var result = await web3.Miner.Stop.SendRequestAsync();
From: src/Nethereum.Geth/RPC/Miner/MinerStop.cs
using Nethereum.Hex.HexTypes;
var gasPrice = new HexBigInteger(1000000000); // 1 gwei
var result = await web3.Miner.SetGasPrice.SendRequestAsync(gasPrice);
From: src/Nethereum.Geth/RPC/Miner/MinerSetGasPrice.cs
Inspect transaction pool (mempool).
var status = await web3.TxnPool.PoolStatus.SendRequestAsync();
From: src/Nethereum.Geth/ITxnPoolApiService.cs:9
var content = await web3.TxnPool.PoolContent.SendRequestAsync();
From: src/Nethereum.Geth/ITxnPoolApiService.cs:7
var inspect = await web3.TxnPool.PoolInspect.SendRequestAsync();
From: src/Nethereum.Geth/ITxnPoolApiService.cs:8
Geth-specific eth methods.
var pendingTxs = await web3.GethEth.PendingTransactions.SendRequestAsync();
From: src/Nethereum.Geth/IGethEthApiService.cs:7
Execute contract call with temporary state modifications (e.g., replace contract code, override balances).
using Nethereum.RPC.Eth.DTOs;
using System.Collections.Generic;
var stateChanges = new Dictionary<string, StateChange>
{
["0xContractAddress"] = new StateChange
{
Code = "0x6080604052..." // Override contract code
}
};
var result = await web3.GethEth.Call.SendRequestAsync(
new CallInput
{
To = "0xContractAddress",
Data = "0x893d20e8" // Function selector
},
BlockParameter.CreateLatest(),
stateChanges);
From: tests/Nethereum.Contracts.IntegrationTests/SmartContracts/GethCallTest.cs:39
Analyze VM execution traces for errors.
var stackErrorChecker = web3.GethDebug.StackErrorChecker;
// Use with trace results to detect stack errors
From: src/Nethereum.Geth/IDebugApiService.cs:17
Interface: IAdminApiService (src/Nethereum.Geth/IAdminApiService.cs:5)
| Method | RPC Method | Description |
|---|---|---|
| AddPeer | admin_addPeer | Add peer by enode URL |
| RemovePeer | admin_removePeer | Remove peer |
| AddTrustedPeer | admin_addTrustedPeer | Add trusted peer |
| RemoveTrustedPeer | admin_removeTrustedPeer | Remove trusted peer |
| Peers | admin_peers | List connected peers |
| NodeInfo | admin_nodeInfo | Get node information |
| Datadir | admin_datadir | Get data directory path |
| StartRPC | admin_startRPC | Start RPC server |
| StopRPC | admin_stopRPC | Stop RPC server |
| StartHTTP | admin_startHTTP | Start HTTP server |
| StopHTTP | admin_stopHTTP | Stop HTTP server |
| StartWS | admin_startWS | Start WebSocket server |
| StopWS | admin_stopWS | Stop WebSocket server |
| ExportChain | admin_exportChain | Export blockchain to file |
| ImportChain | admin_importChain | Import blockchain from file |
Interface: IDebugApiService (src/Nethereum.Geth/IDebugApiService.cs:5)
| Method | RPC Method | Description |
|---|---|---|
| TraceTransaction | debug_traceTransaction | Trace transaction execution |
| TraceBlock | debug_traceBlock | Trace all transactions in block |
| TraceBlockByNumber | debug_traceBlockByNumber | Trace block by number |
| TraceBlockByHash | debug_traceBlockByHash | Trace block by hash |
| TraceBlockFromFile | debug_traceBlockFromFile | Trace block from RLP file |
| TraceCall | debug_traceCall | Trace eth_call execution |
| GetBlockRlp | debug_getBlockRlp | Get RLP-encoded block |
| DumpBlock | debug_dumpBlock | Dump block state |
| SeedHash | debug_seedHash | Get PoW seed hash |
| BacktraceAt | debug_backtraceAt | Set logging backtrace location |
| Verbosity | debug_verbosity | Set logging verbosity |
| Vmodule | debug_vmodule | Set per-module verbosity |
| Stacks | debug_stacks | Get goroutine stack traces |
| MemStats | debug_memStats | Get memory allocation statistics |
| GcStats | debug_gcStats | Get garbage collection statistics |
| CpuProfile | debug_cpuProfile | Write CPU profile |
| StartCPUProfile | debug_startCPUProfile | Start CPU profiling |
| StopCPUProfile | debug_stopCPUProfile | Stop CPU profiling |
| StartGoTrace | debug_startGoTrace | Start Go execution trace |
| StopGoTrace | debug_stopGoTrace | Stop Go execution trace |
| BlockProfile | debug_blockProfile | Write goroutine blocking profile |
| SetBlockProfileRate | debug_setBlockProfileRate | Set blocking profile rate |
| GoTrace | debug_goTrace | Write Go execution trace |
Interface: IMinerApiService (src/Nethereum.Geth/IMinerApiService.cs:5)
| Method | RPC Method | Description |
|---|---|---|
| Start | miner_start | Start mining |
| Stop | miner_stop | Stop mining |
| SetGasPrice | miner_setGasPrice | Set minimum gas price |
Interface: ITxnPoolApiService (src/Nethereum.Geth/ITxnPoolApiService.cs:5)
| Method | RPC Method | Description |
|---|---|---|
| PoolStatus | txpool_status | Get transaction pool status (pending/queued counts) |
| PoolContent | txpool_content | Get full transaction pool content |
| PoolInspect | txpool_inspect | Get transaction pool summary |
Interface: IGethEthApiService (src/Nethereum.Geth/IGethEthApiService.cs:5)
| Method | RPC Method | Description |
|---|---|---|
| PendingTransactions | eth_pendingTransactions | Get pending transactions |
| Call | eth_call | Execute call with state overrides |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net451 net451 is compatible. net452 net452 was computed. net46 net46 was computed. net461 net461 is compatible. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 3 NuGet packages that depend on Nethereum.Geth:
| Package | Downloads |
|---|---|
|
Nethereum.Quorum
Nethereum.Quorum. Extension to interact with Quorum, the permissioned implementation of Ethereum supporting data privacy created by JP Morgan |
|
|
ChainBroker
Package Description |
|
|
Wonka.Eth
Relying heavily on the Nethereum project, this library contains classes that interact with the Ethereum foundation and that extend the Wonka engine, particulary the base class WonkaBizRulesEngine in the Wonka.BizRulesEngine library. With the funtionality provided here, Wonka becomes a business rules engine for both the .NET platform and the Ethereum platform, one that is inherently metadata-driven and serves as a reference implementation for EIP-2746. Once the rules are written into a markup language and are parsed/deserialized by the .NET form of the engine, these rules can then be serialized onto the blockchain using Nethereum, and stored within a smart contract (i.e., the Ethereum version of the engine) built using the Solidity language. The Ethereum version of this engine can also be deployed as a contract by this library. After providing a number of rules and populating a record, a user can submit the populated record for validation by the rules engine, whether it exists in .NET or the blockchain. |
Showing the top 1 popular GitHub repositories that depend on Nethereum.Geth:
| Repository | Stars |
|---|---|
|
bizanc/Bizanc.io.Core
Bizanc Blockchain
|
| Version | Downloads | Last Updated |
|---|---|---|
| 6.1.0 | 3,148 | 3/25/2026 |
| 6.0.4 | 404 | 3/18/2026 |
| 6.0.3 | 157 | 3/18/2026 |
| 6.0.1 | 202 | 3/17/2026 |
| 6.0.0 | 228 | 3/16/2026 |
| 5.8.0 | 1,512 | 1/6/2026 |
| 5.0.0 | 8,621 | 5/28/2025 |
| 4.29.0 | 7,564 | 2/10/2025 |
| 4.28.0 | 376 | 1/7/2025 |
| 4.27.1 | 345 | 12/24/2024 |
| 4.27.0 | 307 | 12/24/2024 |
| 4.26.0 | 704 | 10/1/2024 |
| 4.25.0 | 590 | 9/19/2024 |
| 4.21.4 | 529 | 8/9/2024 |
| 4.21.3 | 374 | 7/22/2024 |
| 4.21.2 | 2,123 | 6/26/2024 |
| 4.21.1 | 350 | 6/26/2024 |
| 4.21.0 | 383 | 6/18/2024 |
| 4.20.0 | 4,436 | 3/28/2024 |
| 4.19.0 | 671 | 2/16/2024 |