GossNet.Discovery.Etcd 0.10.0

dotnet add package GossNet.Discovery.Etcd --version 0.10.0
                    
NuGet\Install-Package GossNet.Discovery.Etcd -Version 0.10.0
                    
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="GossNet.Discovery.Etcd" Version="0.10.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GossNet.Discovery.Etcd" Version="0.10.0" />
                    
Directory.Packages.props
<PackageReference Include="GossNet.Discovery.Etcd" />
                    
Project file
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 GossNet.Discovery.Etcd --version 0.10.0
                    
#r "nuget: GossNet.Discovery.Etcd, 0.10.0"
                    
#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 GossNet.Discovery.Etcd@0.10.0
                    
#: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=GossNet.Discovery.Etcd&version=0.10.0
                    
Install as a Cake Addin
#tool nuget:?package=GossNet.Discovery.Etcd&version=0.10.0
                    
Install as a Cake Tool

GossNet.Discovery.Etcd

etcd-based node discovery for GossNet.Protocol, with watch support.

Nodes register themselves under a key prefix, holding their key with a lease. A node that crashes stops renewing, etcd expires the lease and deletes the key — so departures need nothing to detect them.

Supported frameworks

net8.0 and net10.0 only — not netstandard2.0, unlike most packages in this repo. The dotnet-etcd client ships no netstandard2.0 asset, so there is no way to support .NET Framework without dropping the client or pinning an ancient version of it.

Installation

dotnet add package GossNet.Discovery.Etcd

Usage

using GossNet.Discovery.Etcd;
using GossNet.Protocol;

var etcdOptions = new EtcdDiscoveryOptions
{
    ConnectionString = "http://localhost:2379",
    Prefix = "/gossnet/members/"
};

var configuration = new GossNetConfiguration
{
    Hostname = "10.0.0.4",
    Port = 9055,
    DiscoveryProviderFactory = cfg => new EtcdNodeDiscovery(cfg, etcdOptions)
};

await using var node = new GossNetNode<MyMessage>(configuration);
node.Start();

Hostname and Port are what this node registers, so they must be reachable by the others.

Watching

This is the only provider that implements IWatchableNodeDiscovery. When a node starts, it subscribes to the prefix and membership changes arrive as they happen rather than after the cache expires — cutting failover from CacheDuration to roughly a round trip.

Nothing needs enabling. GossNetNode checks for the interface on Start() and subscribes if present. If the watch fails, the node logs it and falls back to the cached poll: a broken change feed makes discovery slower, never broken.

How membership is stored

One key per node under the prefix, value host:port, held by a lease:

PUT /gossnet/members/10.0.0.4:9055  "10.0.0.4:9055"  --lease=<id>

The lease is renewed in the background for the life of the provider. Disposing the provider stops renewal, so the key expires and peers stop seeing this node.

Options

Option Default Description
ConnectionString required¹ etcd endpoint, e.g. http://localhost:2379
Prefix /gossnet/members/ Key prefix members register under
LeaseTtl 15 seconds Lease TTL for this node's registration
CacheDuration 5 seconds Reuse window, only used when the watch is not running
Username none For authenticated clusters
Password none For authenticated clusters

¹ Not required when you pass your own IEtcdRegistry.

Use a different Prefix per cluster sharing an etcd instance, the way you would a different Consul service name.

Registration happens on first use rather than in the constructor, so constructing a provider never performs network I/O. A failed read or registration throws NodeDiscoveryException rather than returning an empty list, so an unreachable etcd is never mistaken for a cluster of one.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.10.0 90 8/20/2026
0.9.0 109 8/20/2026
0.8.2 123 8/20/2026
0.8.1 81 8/20/2026
0.8.0 98 8/20/2026
0.7.0 83 8/20/2026
0.6.0 90 8/20/2026