![]() |
VOOZH | about |
dotnet add package Tricksfor.DistributedNonce --version 10.1.1
NuGet\Install-Package Tricksfor.DistributedNonce -Version 10.1.1
<PackageReference Include="Tricksfor.DistributedNonce" Version="10.1.1" />
<PackageVersion Include="Tricksfor.DistributedNonce" Version="10.1.1" />Directory.Packages.props
<PackageReference Include="Tricksfor.DistributedNonce" />Project file
paket add Tricksfor.DistributedNonce --version 10.1.1
#r "nuget: Tricksfor.DistributedNonce, 10.1.1"
#:package Tricksfor.DistributedNonce@10.1.1
#addin nuget:?package=Tricksfor.DistributedNonce&version=10.1.1Install as a Cake Addin
#tool nuget:?package=Tricksfor.DistributedNonce&version=10.1.1Install as a Cake Tool
Redis-backed, distributed nonce service for Ethereum-like blockchains. Ensures concurrent calls across processes/instances never return duplicate nonces.
GetNextNonceAsync with no duplicatesAddDistributedNonce extensionusing 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();
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 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. |
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. |
This package is not used by any popular GitHub repositories.