Tricksfor.DistributedNonce
10.0.1
dotnet add package Tricksfor.DistributedNonce --version 10.0.1
NuGet\Install-Package Tricksfor.DistributedNonce -Version 10.0.1
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="Tricksfor.DistributedNonce" Version="10.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tricksfor.DistributedNonce" Version="10.0.1" />
<PackageReference Include="Tricksfor.DistributedNonce" />
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 Tricksfor.DistributedNonce --version 10.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Tricksfor.DistributedNonce, 10.0.1"
#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 Tricksfor.DistributedNonce@10.0.1
#: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=Tricksfor.DistributedNonce&version=10.0.1
#tool nuget:?package=Tricksfor.DistributedNonce&version=10.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DistributedNonce
Redis-backed, distributed nonce service for Ethereum-like blockchains. Ensures concurrent calls across processes/instances never return duplicate nonces.
Features
- Distributed locking via Redis (Tricksfor.DistributedLockManager)
- Safe concurrent
GetNextNonceAsyncwith no duplicates - Nethereum integration (IClient)
- DI-friendly with
AddDistributedNonceextension
Quick Start
using DistributedLockManager;
using DistributedNonce;
using DistributedNonce.Services;
using Microsoft.Extensions.DependencyInjection;
using StackExchange.Redis;
var services = new ServiceCollection();
// Register lock manager, Redis, and nonce service
services.AddDistributedLockManager();
services.AddSingleton<IConnectionMultiplexer>(
await ConnectionMultiplexer.ConnectAsync("localhost:6379,abortConnect=false"));
services.AddDistributedNonce();
var provider = services.BuildServiceProvider();
var nonceFactory = provider.GetRequiredService<DistributedNonceService>();
// Create per-account nonce service
var nonceService = nonceFactory.GetInstance("0xYourAddress", yourRpcClient);
var next = await nonceService.GetNextNonceAsync();
Requirements
- .NET 9+
- Redis server/cluster
Scalable Environments
Use a shared Redis instance across all app instances. The distributed lock is keyed by account address, ensuring nonce uniqueness even under high concurrency.
For more details, see the GitHub repository.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Nethereum.BlockchainProcessing (>= 5.0.0)
- Nethereum.Signer (>= 5.0.0)
- Newtonsoft.Json (>= 13.0.4)
- Tricksfor.DistributedLockManager (>= 10.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Tricksfor.DistributedNonce:
| Package | Downloads |
|---|---|
|
Tricksfor.BlockChainTools
BlockChainTools provides a set of tools for working with blockchain technology. |
GitHub repositories
This package is not used by any popular GitHub repositories.