From b8a62e18d658e250cd0fe259ef929c4d28073709 Mon Sep 17 00:00:00 2001 From: Siggi Date: Tue, 4 Nov 2025 13:55:31 +0100 Subject: [PATCH 01/10] Added option to set DHT to client mode only and configure the cleanup interval --- client.go | 48 +++++- config.go | 18 ++ dht_config_test.go | 415 +++++++++++++++++++++++++++++++++++++++++++++ types.go | 3 + 4 files changed, 481 insertions(+), 3 deletions(-) create mode 100644 dht_config_test.go diff --git a/client.go b/client.go index f9127ab..9d8dfe4 100644 --- a/client.go +++ b/client.go @@ -19,6 +19,7 @@ import ( "github.com/libp2p/go-libp2p" dht "github.com/libp2p/go-libp2p-kad-dht" + "github.com/libp2p/go-libp2p-kad-dht/records" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/core/host" @@ -27,6 +28,9 @@ import ( "github.com/libp2p/go-libp2p/p2p/discovery/mdns" drouting "github.com/libp2p/go-libp2p/p2p/discovery/routing" "github.com/multiformats/go-multiaddr" + + ds "github.com/ipfs/go-datastore" + dssync "github.com/ipfs/go-datastore/sync" ) var ( @@ -92,7 +96,7 @@ func NewClient(config Config) (Client, error) { } // Set up DHT - kadDHT, err := setupDHT(ctx, h, bootstrapPeers, clientLogger, cancel) + kadDHT, err := setupDHT(ctx, h, config, bootstrapPeers, clientLogger, cancel) if err != nil { return nil, err } @@ -204,8 +208,46 @@ func createHost(_ context.Context, hostOpts []libp2p.Option, config Config, rela return h, nil } -func setupDHT(ctx context.Context, h host.Host, bootstrapPeers []peer.AddrInfo, _ logger, cancel context.CancelFunc) (*dht.IpfsDHT, error) { - kadDHT, err := dht.New(ctx, h, dht.Mode(dht.ModeServer), dht.BootstrapPeers(bootstrapPeers...)) +func setupDHT(ctx context.Context, h host.Host, config Config, bootstrapPeers []peer.AddrInfo, log logger, cancel context.CancelFunc) (*dht.IpfsDHT, error) { + // Determine DHT mode (default to server) + mode := dht.ModeServer + if config.DHTMode == "client" { + mode = dht.ModeClient + log.Infof("DHT mode: client (query-only, no provider storage)") + } else { + log.Infof("DHT mode: server (will advertise and store provider records)") + } + + // Build DHT options + dhtOpts := []dht.Option{ + dht.Mode(mode), + dht.BootstrapPeers(bootstrapPeers...), + } + + // If server mode and custom cleanup interval specified, configure ProviderManager + if mode == dht.ModeServer && config.DHTCleanupInterval > 0 { + log.Infof("Configuring DHT cleanup interval: %v", config.DHTCleanupInterval) + + // Create an in-memory datastore for the provider manager + // Same as default DHT datastore creation + datastore := dssync.MutexWrap(ds.NewMapDatastore()) + + providerManager, err := records.NewProviderManager( + ctx, + h.ID(), + h.Peerstore(), + datastore, + records.CleanupInterval(config.DHTCleanupInterval), + ) + if err != nil { + _ = h.Close() + cancel() + return nil, fmt.Errorf("failed to create provider manager: %w", err) + } + dhtOpts = append(dhtOpts, dht.ProviderStore(providerManager)) + } + + kadDHT, err := dht.New(ctx, h, dhtOpts...) if err != nil { _ = h.Close() cancel() diff --git a/config.go b/config.go index 0c9eab2..ffa338c 100644 --- a/config.go +++ b/config.go @@ -79,4 +79,22 @@ type Config struct { // If not provided, bootstrap peers will be used as relays. // Example: []string{"/ip4/1.2.3.4/tcp/4001/p2p/QmPeerID"} RelayPeers []string + + // DHTMode specifies whether this node runs the DHT in client or server mode. + // Valid values: "client", "server" + // - "client": Can query DHT but doesn't advertise itself or store provider records. + // No ProviderManager cleanup overhead. + // - "server": Participates fully in DHT, advertises itself, stores provider records. + // Has periodic cleanup overhead. Default mode for proper P2P networks. + // If not provided or empty, defaults to "server" mode. + DHTMode string + + // DHTCleanupInterval is the interval at which the DHT's ProviderManager performs + // garbage collection of expired provider records. The cleanup involves querying all + // provider records and removing expired entries. + // Only applies when DHTMode is "server". + // If not provided or zero, uses the DHT default (1 hour). + // Recommended: 6-24 hours for production to reduce CPU overhead. + // The cleanup frequency trades off between memory usage (stale records) and CPU usage. + DHTCleanupInterval time.Duration } diff --git a/dht_config_test.go b/dht_config_test.go new file mode 100644 index 0000000..956c96f --- /dev/null +++ b/dht_config_test.go @@ -0,0 +1,415 @@ +package p2p + +import ( + "bytes" + "log" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// TestDHTModeDefault verifies that the default DHT mode is server +func TestDHTModeDefault(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + // Capture log output to verify mode selection + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-dht-default", + PrivateKey: privKey, + // DHTMode not specified - should default to server + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify server mode was selected + output := buf.String() + assert.Contains(t, output, "DHT mode: server") + assert.Contains(t, output, "will advertise and store provider records") +} + +// TestDHTModeServer verifies explicit server mode configuration +func TestDHTModeServer(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-dht-server", + PrivateKey: privKey, + DHTMode: "server", + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify server mode was selected + output := buf.String() + assert.Contains(t, output, "DHT mode: server") +} + +// TestDHTModeClient verifies client mode configuration +func TestDHTModeClient(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-dht-client", + PrivateKey: privKey, + DHTMode: "client", + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify client mode was selected + output := buf.String() + assert.Contains(t, output, "DHT mode: client") + assert.Contains(t, output, "query-only, no provider storage") +} + +// TestDHTCleanupIntervalDefault verifies default cleanup interval is not logged when not specified +func TestDHTCleanupIntervalDefault(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-cleanup-default", + PrivateKey: privKey, + DHTMode: "server", + // DHTCleanupInterval not specified - should use libp2p default + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify cleanup interval configuration is NOT logged (uses libp2p default) + output := buf.String() + assert.NotContains(t, output, "Configuring DHT cleanup interval") +} + +// TestDHTCleanupIntervalCustom verifies custom cleanup interval configuration +func TestDHTCleanupIntervalCustom(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + customInterval := 6 * time.Hour + config := Config{ + Name: "test-cleanup-custom", + PrivateKey: privKey, + DHTMode: "server", + DHTCleanupInterval: customInterval, + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify cleanup interval configuration was logged + output := buf.String() + assert.Contains(t, output, "Configuring DHT cleanup interval: 6h0m0s") +} + +// TestDHTCleanupIntervalIgnoredInClientMode verifies cleanup interval is ignored in client mode +func TestDHTCleanupIntervalIgnoredInClientMode(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-cleanup-client-mode", + PrivateKey: privKey, + DHTMode: "client", + DHTCleanupInterval: 24 * time.Hour, // Should be ignored + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify client mode was selected + output := buf.String() + assert.Contains(t, output, "DHT mode: client") + + // Verify cleanup interval was NOT configured (client mode doesn't need it) + assert.NotContains(t, output, "Configuring DHT cleanup interval") +} + +// TestDHTModeServerWithVariousCleanupIntervals tests server mode with different intervals +func TestDHTModeServerWithVariousCleanupIntervals(t *testing.T) { + tests := []struct { + name string + interval time.Duration + expected string + }{ + { + name: "1 hour cleanup", + interval: 1 * time.Hour, + expected: "1h0m0s", + }, + { + name: "24 hour cleanup (default recommended)", + interval: 24 * time.Hour, + expected: "24h0m0s", + }, + { + name: "72 hour cleanup", + interval: 72 * time.Hour, + expected: "72h0m0s", + }, + { + name: "30 minute cleanup", + interval: 30 * time.Minute, + expected: "30m0s", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-" + tt.name, + PrivateKey: privKey, + DHTMode: "server", + DHTCleanupInterval: tt.interval, + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify cleanup interval was configured correctly + output := buf.String() + assert.Contains(t, output, "Configuring DHT cleanup interval: "+tt.expected) + }) + } +} + +// TestDHTConfigurationCombinations tests various DHT configuration combinations +func TestDHTConfigurationCombinations(t *testing.T) { + tests := []struct { + name string + dhtMode string + cleanupInterval time.Duration + expectServerMode bool + expectCleanupConfig bool + expectedLogServerMessage string + expectedLogClientMessage string + expectedCleanupIntervalMsg string + }{ + { + name: "default configuration (empty mode)", + dhtMode: "", + cleanupInterval: 0, + expectServerMode: true, + expectCleanupConfig: false, + expectedLogServerMessage: "DHT mode: server", + }, + { + name: "server mode with custom cleanup", + dhtMode: "server", + cleanupInterval: 48 * time.Hour, + expectServerMode: true, + expectCleanupConfig: true, + expectedLogServerMessage: "DHT mode: server", + expectedCleanupIntervalMsg: "48h0m0s", + }, + { + name: "client mode with cleanup specified (ignored)", + dhtMode: "client", + cleanupInterval: 24 * time.Hour, + expectServerMode: false, + expectCleanupConfig: false, + expectedLogClientMessage: "DHT mode: client", + }, + { + name: "server mode without cleanup (uses default)", + dhtMode: "server", + cleanupInterval: 0, + expectServerMode: true, + expectCleanupConfig: false, + expectedLogServerMessage: "DHT mode: server", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-combo-" + tt.name, + PrivateKey: privKey, + DHTMode: tt.dhtMode, + DHTCleanupInterval: tt.cleanupInterval, + } + + client, err := NewClient(config) + require.NoError(t, err, "client creation should succeed") + require.NotNil(t, client, "client should not be nil") + defer client.Close() + + output := buf.String() + + // Verify mode logging + if tt.expectServerMode { + assert.Contains(t, output, tt.expectedLogServerMessage) + } else { + assert.Contains(t, output, tt.expectedLogClientMessage) + } + + // Verify cleanup interval logging + if tt.expectCleanupConfig { + assert.Contains(t, output, "Configuring DHT cleanup interval") + if tt.expectedCleanupIntervalMsg != "" { + assert.Contains(t, output, tt.expectedCleanupIntervalMsg) + } + } else { + assert.NotContains(t, output, "Configuring DHT cleanup interval") + } + }) + } +} + +// TestDHTClientCanQuery verifies that client mode client can be created +func TestDHTClientCanQuery(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + var buf bytes.Buffer + oldOutput := log.Writer() + log.SetOutput(&buf) + defer log.SetOutput(oldOutput) + + config := Config{ + Name: "test-client-query", + PrivateKey: privKey, + DHTMode: "client", + } + + client, err := NewClient(config) + require.NoError(t, err) + require.NotNil(t, client) + defer client.Close() + + // Verify client mode was selected (basic functional check) + output := buf.String() + assert.Contains(t, output, "DHT mode: client") + + // Verify client has basic functionality + peerID := client.GetID() + assert.NotEmpty(t, peerID, "Client should have a peer ID") +} + +// TestP2PClientTypeAlias verifies backward compatibility type alias +func TestP2PClientTypeAlias(t *testing.T) { + privKey, err := GeneratePrivateKey() + require.NoError(t, err) + + config := Config{ + Name: "test-type-alias", + PrivateKey: privKey, + } + + // This should compile due to type alias + var p2pClient P2PClient + p2pClient, err = NewClient(config) + require.NoError(t, err) + require.NotNil(t, p2pClient) + defer p2pClient.Close() + + // Verify it's also a Client + var client Client = p2pClient + assert.NotNil(t, client) +} + +// BenchmarkDHTServerMode benchmarks client creation with server mode +func BenchmarkDHTServerMode(b *testing.B) { + privKey, _ := GeneratePrivateKey() + config := Config{ + Name: "bench-server", + PrivateKey: privKey, + DHTMode: "server", + DHTCleanupInterval: 24 * time.Hour, + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + client, _ := NewClient(config) + if client != nil { + client.Close() + } + } +} + +// BenchmarkDHTClientMode benchmarks client creation with client mode +func BenchmarkDHTClientMode(b *testing.B) { + privKey, _ := GeneratePrivateKey() + config := Config{ + Name: "bench-client", + PrivateKey: privKey, + DHTMode: "client", + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + client, _ := NewClient(config) + if client != nil { + client.Close() + } + } +} diff --git a/types.go b/types.go index 338bd07..85eea5f 100644 --- a/types.go +++ b/types.go @@ -27,6 +27,9 @@ type Client interface { Close() error } +// P2PClient is a type alias for Client, maintained for backward compatibility. +type P2PClient = Client + // Message represents a received message from a peer. type Message struct { Topic string // The topic this message was received on From 275523568c548d3a5c452f5ba7a9d7c6db9f0a2a Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:01:15 -0500 Subject: [PATCH 02/10] test(dht): standardize struct field alignment in configuration tests --- dht_config_test.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dht_config_test.go b/dht_config_test.go index 956c96f..ad60eea 100644 --- a/dht_config_test.go +++ b/dht_config_test.go @@ -237,14 +237,14 @@ func TestDHTModeServerWithVariousCleanupIntervals(t *testing.T) { // TestDHTConfigurationCombinations tests various DHT configuration combinations func TestDHTConfigurationCombinations(t *testing.T) { tests := []struct { - name string - dhtMode string - cleanupInterval time.Duration - expectServerMode bool - expectCleanupConfig bool - expectedLogServerMessage string - expectedLogClientMessage string - expectedCleanupIntervalMsg string + name string + dhtMode string + cleanupInterval time.Duration + expectServerMode bool + expectCleanupConfig bool + expectedLogServerMessage string + expectedLogClientMessage string + expectedCleanupIntervalMsg string }{ { name: "default configuration (empty mode)", @@ -255,12 +255,12 @@ func TestDHTConfigurationCombinations(t *testing.T) { expectedLogServerMessage: "DHT mode: server", }, { - name: "server mode with custom cleanup", - dhtMode: "server", - cleanupInterval: 48 * time.Hour, - expectServerMode: true, - expectCleanupConfig: true, - expectedLogServerMessage: "DHT mode: server", + name: "server mode with custom cleanup", + dhtMode: "server", + cleanupInterval: 48 * time.Hour, + expectServerMode: true, + expectCleanupConfig: true, + expectedLogServerMessage: "DHT mode: server", expectedCleanupIntervalMsg: "48h0m0s", }, { From bb01e1a4ca98e1653b684cea954b10cf5780a812 Mon Sep 17 00:00:00 2001 From: Siggi Date: Tue, 4 Nov 2025 14:01:19 +0100 Subject: [PATCH 03/10] Refactor DHT configuration tests to eliminate code duplication - Extract common test setup into createTestClient helper function - Consolidate overlapping tests (TestDHTModeDefault, TestDHTModeServer, TestDHTModeClient) into TestDHTModeSelection - Merge TestDHTModeServerWithVariousCleanupIntervals into TestDHTCleanupIntervalConfiguration - Reduce test count from 11 to 5 while maintaining full coverage - Use t.Helper() and t.Cleanup() for better test organization - Add descriptive assertion messages for clearer failures - Improve benchmark error handling Changes: - Lines of code reduced: 416 -> 312 (25% reduction) - Tests consolidated: 11 -> 5 (same coverage, better organization) - Code duplication eliminated: 9 repeated log setups, 11 repeated client creations now use 1 helper - All tests still pass with identical coverage --- dht_config_test.go | 456 +++++++++++++++++---------------------------- 1 file changed, 176 insertions(+), 280 deletions(-) diff --git a/dht_config_test.go b/dht_config_test.go index 956c96f..96eeb92 100644 --- a/dht_config_test.go +++ b/dht_config_test.go @@ -10,349 +10,231 @@ import ( "github.com/stretchr/testify/require" ) -// TestDHTModeDefault verifies that the default DHT mode is server -func TestDHTModeDefault(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) - - // Capture log output to verify mode selection - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - config := Config{ - Name: "test-dht-default", - PrivateKey: privKey, - // DHTMode not specified - should default to server - } - - client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() - - // Verify server mode was selected - output := buf.String() - assert.Contains(t, output, "DHT mode: server") - assert.Contains(t, output, "will advertise and store provider records") +// testClientConfig is a helper to create a test client with log capture +type testClientConfig struct { + name string + dhtMode string + cleanupInterval time.Duration } -// TestDHTModeServer verifies explicit server mode configuration -func TestDHTModeServer(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) +// createTestClient is a helper function that reduces duplication in client creation and log setup +func createTestClient(t *testing.T, cfg testClientConfig) (Client, string) { + t.Helper() - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - config := Config{ - Name: "test-dht-server", - PrivateKey: privKey, - DHTMode: "server", - } - - client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() - - // Verify server mode was selected - output := buf.String() - assert.Contains(t, output, "DHT mode: server") -} - -// TestDHTModeClient verifies client mode configuration -func TestDHTModeClient(t *testing.T) { privKey, err := GeneratePrivateKey() - require.NoError(t, err) + require.NoError(t, err, "failed to generate private key") + // Capture log output var buf bytes.Buffer oldOutput := log.Writer() log.SetOutput(&buf) - defer log.SetOutput(oldOutput) + t.Cleanup(func() { log.SetOutput(oldOutput) }) config := Config{ - Name: "test-dht-client", - PrivateKey: privKey, - DHTMode: "client", - } - - client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() - - // Verify client mode was selected - output := buf.String() - assert.Contains(t, output, "DHT mode: client") - assert.Contains(t, output, "query-only, no provider storage") -} - -// TestDHTCleanupIntervalDefault verifies default cleanup interval is not logged when not specified -func TestDHTCleanupIntervalDefault(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) - - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - config := Config{ - Name: "test-cleanup-default", - PrivateKey: privKey, - DHTMode: "server", - // DHTCleanupInterval not specified - should use libp2p default - } - - client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() - - // Verify cleanup interval configuration is NOT logged (uses libp2p default) - output := buf.String() - assert.NotContains(t, output, "Configuring DHT cleanup interval") -} - -// TestDHTCleanupIntervalCustom verifies custom cleanup interval configuration -func TestDHTCleanupIntervalCustom(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) - - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - customInterval := 6 * time.Hour - config := Config{ - Name: "test-cleanup-custom", + Name: cfg.name, PrivateKey: privKey, - DHTMode: "server", - DHTCleanupInterval: customInterval, + DHTMode: cfg.dhtMode, + DHTCleanupInterval: cfg.cleanupInterval, } client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() + require.NoError(t, err, "failed to create client") + require.NotNil(t, client, "client should not be nil") + t.Cleanup(func() { client.Close() }) - // Verify cleanup interval configuration was logged - output := buf.String() - assert.Contains(t, output, "Configuring DHT cleanup interval: 6h0m0s") + return client, buf.String() } -// TestDHTCleanupIntervalIgnoredInClientMode verifies cleanup interval is ignored in client mode -func TestDHTCleanupIntervalIgnoredInClientMode(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) - - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - config := Config{ - Name: "test-cleanup-client-mode", - PrivateKey: privKey, - DHTMode: "client", - DHTCleanupInterval: 24 * time.Hour, // Should be ignored +// TestDHTModeSelection tests DHT mode configuration (server/client/default) +func TestDHTModeSelection(t *testing.T) { + tests := []struct { + name string + dhtMode string + expectedLogMsg string + additionalMsgOpt string // optional additional message to check + }{ + { + name: "default mode (empty string defaults to server)", + dhtMode: "", + expectedLogMsg: "DHT mode: server", + additionalMsgOpt: "will advertise and store provider records", + }, + { + name: "explicit server mode", + dhtMode: "server", + expectedLogMsg: "DHT mode: server", + additionalMsgOpt: "will advertise and store provider records", + }, + { + name: "client mode", + dhtMode: "client", + expectedLogMsg: "DHT mode: client", + additionalMsgOpt: "query-only, no provider storage", + }, } - client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() - - // Verify client mode was selected - output := buf.String() - assert.Contains(t, output, "DHT mode: client") - - // Verify cleanup interval was NOT configured (client mode doesn't need it) - assert.NotContains(t, output, "Configuring DHT cleanup interval") + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, output := createTestClient(t, testClientConfig{ + name: "test-mode-" + tt.name, + dhtMode: tt.dhtMode, + }) + + assert.Contains(t, output, tt.expectedLogMsg) + if tt.additionalMsgOpt != "" { + assert.Contains(t, output, tt.additionalMsgOpt) + } + }) + } } -// TestDHTModeServerWithVariousCleanupIntervals tests server mode with different intervals -func TestDHTModeServerWithVariousCleanupIntervals(t *testing.T) { +// TestDHTCleanupIntervalConfiguration tests cleanup interval settings +func TestDHTCleanupIntervalConfiguration(t *testing.T) { tests := []struct { - name string - interval time.Duration - expected string + name string + dhtMode string + cleanupInterval time.Duration + expectCleanupConfigLog bool + expectedIntervalString string }{ { - name: "1 hour cleanup", - interval: 1 * time.Hour, - expected: "1h0m0s", + name: "server mode without cleanup interval (uses libp2p default)", + dhtMode: "server", + cleanupInterval: 0, + expectCleanupConfigLog: false, }, { - name: "24 hour cleanup (default recommended)", - interval: 24 * time.Hour, - expected: "24h0m0s", + name: "server mode with 6 hour cleanup", + dhtMode: "server", + cleanupInterval: 6 * time.Hour, + expectCleanupConfigLog: true, + expectedIntervalString: "6h0m0s", }, { - name: "72 hour cleanup", - interval: 72 * time.Hour, - expected: "72h0m0s", + name: "server mode with 24 hour cleanup", + dhtMode: "server", + cleanupInterval: 24 * time.Hour, + expectCleanupConfigLog: true, + expectedIntervalString: "24h0m0s", }, { - name: "30 minute cleanup", - interval: 30 * time.Minute, - expected: "30m0s", + name: "server mode with 72 hour cleanup", + dhtMode: "server", + cleanupInterval: 72 * time.Hour, + expectCleanupConfigLog: true, + expectedIntervalString: "72h0m0s", + }, + { + name: "server mode with 30 minute cleanup", + dhtMode: "server", + cleanupInterval: 30 * time.Minute, + expectCleanupConfigLog: true, + expectedIntervalString: "30m0s", + }, + { + name: "client mode ignores cleanup interval", + dhtMode: "client", + cleanupInterval: 24 * time.Hour, + expectCleanupConfigLog: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) - - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - config := Config{ - Name: "test-" + tt.name, - PrivateKey: privKey, - DHTMode: "server", - DHTCleanupInterval: tt.interval, - } + _, output := createTestClient(t, testClientConfig{ + name: "test-cleanup-" + tt.name, + dhtMode: tt.dhtMode, + cleanupInterval: tt.cleanupInterval, + }) - client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() - - // Verify cleanup interval was configured correctly - output := buf.String() - assert.Contains(t, output, "Configuring DHT cleanup interval: "+tt.expected) + if tt.expectCleanupConfigLog { + assert.Contains(t, output, "Configuring DHT cleanup interval") + if tt.expectedIntervalString != "" { + assert.Contains(t, output, tt.expectedIntervalString) + } + } else { + assert.NotContains(t, output, "Configuring DHT cleanup interval") + } }) } } -// TestDHTConfigurationCombinations tests various DHT configuration combinations +// TestDHTConfigurationCombinations tests various configuration combinations func TestDHTConfigurationCombinations(t *testing.T) { tests := []struct { - name string - dhtMode string - cleanupInterval time.Duration - expectServerMode bool - expectCleanupConfig bool - expectedLogServerMessage string - expectedLogClientMessage string - expectedCleanupIntervalMsg string + name string + dhtMode string + cleanupInterval time.Duration + expectedModeLog string + expectCleanupConfigLog bool + expectedIntervalString string }{ { - name: "default configuration (empty mode)", - dhtMode: "", - cleanupInterval: 0, - expectServerMode: true, - expectCleanupConfig: false, - expectedLogServerMessage: "DHT mode: server", + name: "default configuration (empty mode, no interval)", + dhtMode: "", + cleanupInterval: 0, + expectedModeLog: "DHT mode: server", + expectCleanupConfigLog: false, }, { - name: "server mode with custom cleanup", - dhtMode: "server", - cleanupInterval: 48 * time.Hour, - expectServerMode: true, - expectCleanupConfig: true, - expectedLogServerMessage: "DHT mode: server", - expectedCleanupIntervalMsg: "48h0m0s", + name: "server mode with 48h cleanup", + dhtMode: "server", + cleanupInterval: 48 * time.Hour, + expectedModeLog: "DHT mode: server", + expectCleanupConfigLog: true, + expectedIntervalString: "48h0m0s", }, { - name: "client mode with cleanup specified (ignored)", - dhtMode: "client", - cleanupInterval: 24 * time.Hour, - expectServerMode: false, - expectCleanupConfig: false, - expectedLogClientMessage: "DHT mode: client", + name: "client mode with cleanup specified (ignored)", + dhtMode: "client", + cleanupInterval: 24 * time.Hour, + expectedModeLog: "DHT mode: client", + expectCleanupConfigLog: false, }, { - name: "server mode without cleanup (uses default)", - dhtMode: "server", - cleanupInterval: 0, - expectServerMode: true, - expectCleanupConfig: false, - expectedLogServerMessage: "DHT mode: server", + name: "server mode without cleanup", + dhtMode: "server", + cleanupInterval: 0, + expectedModeLog: "DHT mode: server", + expectCleanupConfigLog: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) - - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - config := Config{ - Name: "test-combo-" + tt.name, - PrivateKey: privKey, - DHTMode: tt.dhtMode, - DHTCleanupInterval: tt.cleanupInterval, - } - - client, err := NewClient(config) - require.NoError(t, err, "client creation should succeed") - require.NotNil(t, client, "client should not be nil") - defer client.Close() - - output := buf.String() - - // Verify mode logging - if tt.expectServerMode { - assert.Contains(t, output, tt.expectedLogServerMessage) - } else { - assert.Contains(t, output, tt.expectedLogClientMessage) - } - - // Verify cleanup interval logging - if tt.expectCleanupConfig { - assert.Contains(t, output, "Configuring DHT cleanup interval") - if tt.expectedCleanupIntervalMsg != "" { - assert.Contains(t, output, tt.expectedCleanupIntervalMsg) + _, output := createTestClient(t, testClientConfig{ + name: "test-combo-" + tt.name, + dhtMode: tt.dhtMode, + cleanupInterval: tt.cleanupInterval, + }) + + assert.Contains(t, output, tt.expectedModeLog, "mode log should be present") + + if tt.expectCleanupConfigLog { + assert.Contains(t, output, "Configuring DHT cleanup interval", "cleanup config should be logged") + if tt.expectedIntervalString != "" { + assert.Contains(t, output, tt.expectedIntervalString, "interval string should match") } } else { - assert.NotContains(t, output, "Configuring DHT cleanup interval") + assert.NotContains(t, output, "Configuring DHT cleanup interval", "cleanup config should not be logged") } }) } } -// TestDHTClientCanQuery verifies that client mode client can be created -func TestDHTClientCanQuery(t *testing.T) { - privKey, err := GeneratePrivateKey() - require.NoError(t, err) - - var buf bytes.Buffer - oldOutput := log.Writer() - log.SetOutput(&buf) - defer log.SetOutput(oldOutput) - - config := Config{ - Name: "test-client-query", - PrivateKey: privKey, - DHTMode: "client", - } +// TestDHTClientBasicFunctionality verifies client mode basic operations +func TestDHTClientBasicFunctionality(t *testing.T) { + client, output := createTestClient(t, testClientConfig{ + name: "test-client-functionality", + dhtMode: "client", + }) - client, err := NewClient(config) - require.NoError(t, err) - require.NotNil(t, client) - defer client.Close() - - // Verify client mode was selected (basic functional check) - output := buf.String() + // Verify client mode was selected assert.Contains(t, output, "DHT mode: client") // Verify client has basic functionality peerID := client.GetID() - assert.NotEmpty(t, peerID, "Client should have a peer ID") + assert.NotEmpty(t, peerID, "client should have a peer ID") } // TestP2PClientTypeAlias verifies backward compatibility type alias @@ -379,7 +261,11 @@ func TestP2PClientTypeAlias(t *testing.T) { // BenchmarkDHTServerMode benchmarks client creation with server mode func BenchmarkDHTServerMode(b *testing.B) { - privKey, _ := GeneratePrivateKey() + privKey, err := GeneratePrivateKey() + if err != nil { + b.Fatal(err) + } + config := Config{ Name: "bench-server", PrivateKey: privKey, @@ -389,7 +275,10 @@ func BenchmarkDHTServerMode(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - client, _ := NewClient(config) + client, err := NewClient(config) + if err != nil { + b.Fatal(err) + } if client != nil { client.Close() } @@ -398,7 +287,11 @@ func BenchmarkDHTServerMode(b *testing.B) { // BenchmarkDHTClientMode benchmarks client creation with client mode func BenchmarkDHTClientMode(b *testing.B) { - privKey, _ := GeneratePrivateKey() + privKey, err := GeneratePrivateKey() + if err != nil { + b.Fatal(err) + } + config := Config{ Name: "bench-client", PrivateKey: privKey, @@ -407,7 +300,10 @@ func BenchmarkDHTClientMode(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - client, _ := NewClient(config) + client, err := NewClient(config) + if err != nil { + b.Fatal(err) + } if client != nil { client.Close() } From 97574331ce71e9ef57a204bb1418d7746c8b401c Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:09:16 -0500 Subject: [PATCH 04/10] refactor(tests): improve client closure handling in DHT tests --- dht_config_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dht_config_test.go b/dht_config_test.go index ad60eea..5933941 100644 --- a/dht_config_test.go +++ b/dht_config_test.go @@ -30,7 +30,7 @@ func TestDHTModeDefault(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify server mode was selected output := buf.String() @@ -57,7 +57,7 @@ func TestDHTModeServer(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify server mode was selected output := buf.String() @@ -83,7 +83,7 @@ func TestDHTModeClient(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify client mode was selected output := buf.String() @@ -111,7 +111,7 @@ func TestDHTCleanupIntervalDefault(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify cleanup interval configuration is NOT logged (uses libp2p default) output := buf.String() @@ -139,7 +139,7 @@ func TestDHTCleanupIntervalCustom(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify cleanup interval configuration was logged output := buf.String() @@ -166,7 +166,7 @@ func TestDHTCleanupIntervalIgnoredInClientMode(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify client mode was selected output := buf.String() @@ -225,7 +225,7 @@ func TestDHTModeServerWithVariousCleanupIntervals(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify cleanup interval was configured correctly output := buf.String() @@ -301,7 +301,7 @@ func TestDHTConfigurationCombinations(t *testing.T) { client, err := NewClient(config) require.NoError(t, err, "client creation should succeed") require.NotNil(t, client, "client should not be nil") - defer client.Close() + defer func() { _ = client.Close() }() output := buf.String() @@ -344,7 +344,7 @@ func TestDHTClientCanQuery(t *testing.T) { client, err := NewClient(config) require.NoError(t, err) require.NotNil(t, client) - defer client.Close() + defer func() { _ = client.Close() }() // Verify client mode was selected (basic functional check) output := buf.String() @@ -370,10 +370,10 @@ func TestP2PClientTypeAlias(t *testing.T) { p2pClient, err = NewClient(config) require.NoError(t, err) require.NotNil(t, p2pClient) - defer p2pClient.Close() + defer func() { _ = p2pClient.Close() }() // Verify it's also a Client - var client Client = p2pClient + client := p2pClient assert.NotNil(t, client) } @@ -391,7 +391,7 @@ func BenchmarkDHTServerMode(b *testing.B) { for i := 0; i < b.N; i++ { client, _ := NewClient(config) if client != nil { - client.Close() + _ = client.Close() } } } @@ -409,7 +409,7 @@ func BenchmarkDHTClientMode(b *testing.B) { for i := 0; i < b.N; i++ { client, _ := NewClient(config) if client != nil { - client.Close() + _ = client.Close() } } } From 4db7c627b4da5c30ba11b28f9fb31683cff0d3a1 Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:09:21 -0500 Subject: [PATCH 05/10] refactor(types): clarify P2PClient alias for backward compatibility --- types.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types.go b/types.go index 85eea5f..ae5b36e 100644 --- a/types.go +++ b/types.go @@ -28,6 +28,8 @@ type Client interface { } // P2PClient is a type alias for Client, maintained for backward compatibility. +// +//nolint:revive // P2PClient is intentionally named for backward compatibility, stuttering is acceptable type P2PClient = Client // Message represents a received message from a peer. From 9e2b19e34e50f50bef9667e1a36795275771af35 Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:13:27 -0500 Subject: [PATCH 06/10] refactor(tests): handle client closure errors in DHT tests --- dht_config_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dht_config_test.go b/dht_config_test.go index 96eeb92..27966fa 100644 --- a/dht_config_test.go +++ b/dht_config_test.go @@ -40,7 +40,7 @@ func createTestClient(t *testing.T, cfg testClientConfig) (Client, string) { client, err := NewClient(config) require.NoError(t, err, "failed to create client") require.NotNil(t, client, "client should not be nil") - t.Cleanup(func() { client.Close() }) + t.Cleanup(func() { _ = client.Close() }) return client, buf.String() } @@ -48,10 +48,10 @@ func createTestClient(t *testing.T, cfg testClientConfig) (Client, string) { // TestDHTModeSelection tests DHT mode configuration (server/client/default) func TestDHTModeSelection(t *testing.T) { tests := []struct { - name string - dhtMode string - expectedLogMsg string - additionalMsgOpt string // optional additional message to check + name string + dhtMode string + expectedLogMsg string + additionalMsgOpt string // optional additional message to check }{ { name: "default mode (empty string defaults to server)", @@ -252,10 +252,10 @@ func TestP2PClientTypeAlias(t *testing.T) { p2pClient, err = NewClient(config) require.NoError(t, err) require.NotNil(t, p2pClient) - defer p2pClient.Close() + defer func() { _ = p2pClient.Close() }() // Verify it's also a Client - var client Client = p2pClient + client := p2pClient assert.NotNil(t, client) } @@ -280,7 +280,7 @@ func BenchmarkDHTServerMode(b *testing.B) { b.Fatal(err) } if client != nil { - client.Close() + _ = client.Close() } } } @@ -305,7 +305,7 @@ func BenchmarkDHTClientMode(b *testing.B) { b.Fatal(err) } if client != nil { - client.Close() + _ = client.Close() } } } From 20861fe0b6278ae21554532f7274347fb0905e77 Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:15:34 -0500 Subject: [PATCH 07/10] refactor(tests): replace hardcoded log messages with constants --- dht_config_test.go | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/dht_config_test.go b/dht_config_test.go index 27966fa..6ad0977 100644 --- a/dht_config_test.go +++ b/dht_config_test.go @@ -10,6 +10,13 @@ import ( "github.com/stretchr/testify/require" ) +// Test log message constants to avoid duplication +const ( + logMsgDHTModeServer = "DHT mode: server" + logMsgDHTModeClient = "DHT mode: client" + logMsgConfiguringCleanupInterval = "Configuring DHT cleanup interval" +) + // testClientConfig is a helper to create a test client with log capture type testClientConfig struct { name string @@ -56,19 +63,19 @@ func TestDHTModeSelection(t *testing.T) { { name: "default mode (empty string defaults to server)", dhtMode: "", - expectedLogMsg: "DHT mode: server", + expectedLogMsg: logMsgDHTModeServer, additionalMsgOpt: "will advertise and store provider records", }, { name: "explicit server mode", dhtMode: "server", - expectedLogMsg: "DHT mode: server", + expectedLogMsg: logMsgDHTModeServer, additionalMsgOpt: "will advertise and store provider records", }, { name: "client mode", dhtMode: "client", - expectedLogMsg: "DHT mode: client", + expectedLogMsg: logMsgDHTModeClient, additionalMsgOpt: "query-only, no provider storage", }, } @@ -148,12 +155,12 @@ func TestDHTCleanupIntervalConfiguration(t *testing.T) { }) if tt.expectCleanupConfigLog { - assert.Contains(t, output, "Configuring DHT cleanup interval") + assert.Contains(t, output, logMsgConfiguringCleanupInterval) if tt.expectedIntervalString != "" { assert.Contains(t, output, tt.expectedIntervalString) } } else { - assert.NotContains(t, output, "Configuring DHT cleanup interval") + assert.NotContains(t, output, logMsgConfiguringCleanupInterval) } }) } @@ -173,14 +180,14 @@ func TestDHTConfigurationCombinations(t *testing.T) { name: "default configuration (empty mode, no interval)", dhtMode: "", cleanupInterval: 0, - expectedModeLog: "DHT mode: server", + expectedModeLog: logMsgDHTModeServer, expectCleanupConfigLog: false, }, { name: "server mode with 48h cleanup", dhtMode: "server", cleanupInterval: 48 * time.Hour, - expectedModeLog: "DHT mode: server", + expectedModeLog: logMsgDHTModeServer, expectCleanupConfigLog: true, expectedIntervalString: "48h0m0s", }, @@ -188,14 +195,14 @@ func TestDHTConfigurationCombinations(t *testing.T) { name: "client mode with cleanup specified (ignored)", dhtMode: "client", cleanupInterval: 24 * time.Hour, - expectedModeLog: "DHT mode: client", + expectedModeLog: logMsgDHTModeClient, expectCleanupConfigLog: false, }, { name: "server mode without cleanup", dhtMode: "server", cleanupInterval: 0, - expectedModeLog: "DHT mode: server", + expectedModeLog: logMsgDHTModeServer, expectCleanupConfigLog: false, }, } @@ -211,12 +218,12 @@ func TestDHTConfigurationCombinations(t *testing.T) { assert.Contains(t, output, tt.expectedModeLog, "mode log should be present") if tt.expectCleanupConfigLog { - assert.Contains(t, output, "Configuring DHT cleanup interval", "cleanup config should be logged") + assert.Contains(t, output, logMsgConfiguringCleanupInterval, "cleanup config should be logged") if tt.expectedIntervalString != "" { assert.Contains(t, output, tt.expectedIntervalString, "interval string should match") } } else { - assert.NotContains(t, output, "Configuring DHT cleanup interval", "cleanup config should not be logged") + assert.NotContains(t, output, logMsgConfiguringCleanupInterval, "cleanup config should not be logged") } }) } @@ -230,7 +237,7 @@ func TestDHTClientBasicFunctionality(t *testing.T) { }) // Verify client mode was selected - assert.Contains(t, output, "DHT mode: client") + assert.Contains(t, output, logMsgDHTModeClient) // Verify client has basic functionality peerID := client.GetID() From 54c97452aeebd30addc5cd98c6c2a564e58f75db Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:21:10 -0500 Subject: [PATCH 08/10] chore(deps): update dependabot configuration for Go modules Added Go modules configuration for the /example/ directory to ensure weekly updates for direct dependencies, including security patterns and commit message prefixing. --- .github/dependabot.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a27372e..6b67054 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -56,7 +56,36 @@ updates: include: "scope" # ────────────────────────────────────────────────────────────── - # 2. GitHub Actions Workflows + # 2. Go Modules (go.mod / go.sum) + # ────────────────────────────────────────────────────────────── + - package-ecosystem: "gomod" + directory: "/example/" + target-branch: "master" + schedule: + interval: "weekly" + day: "monday" + time: "09:00" + timezone: "America/New_York" + allow: + - dependency-type: "direct" + groups: + security-deps: + patterns: + - "*crypto*" + - "*security*" + - "*auth*" + - "*jwt*" + - "*oauth*" + update-types: ["minor", "patch"] + open-pull-requests-limit: 10 + assignees: ["mrz1836"] + labels: ["chore", "dependencies", "gomod"] + commit-message: + prefix: "chore" + include: "scope" + + # ────────────────────────────────────────────────────────────── + # 3. GitHub Actions Workflows # ────────────────────────────────────────────────────────────── - package-ecosystem: "github-actions" directory: "/" @@ -79,7 +108,7 @@ updates: include: "scope" # ────────────────────────────────────────────────────────────── - # 3. DevContainer (devcontainer.json : base image + features) + # 4. DevContainer (devcontainer.json : base image + features) # ────────────────────────────────────────────────────────────── - package-ecosystem: "devcontainers" directory: "/" From 19a2b8cd3a9f362c3150a4517ffd17d6e5b5f3e7 Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:21:20 -0500 Subject: [PATCH 09/10] chore(deps): update module versions in go.mod and go.sum Updated dependencies to their latest versions for improved stability and performance. --- example/go.mod | 22 +++++++++++----------- example/go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/example/go.mod b/example/go.mod index 69ededb..d3f2713 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,9 +1,9 @@ -module github.com/ordishs/p2p_poc/example +module github.com/bsv-blockchain/go-p2p-message-bus/example go 1.24.6 require ( - github.com/bsv-blockchain/go-p2p-message-bus v0.0.8 + github.com/bsv-blockchain/go-p2p-message-bus v0.1.0 github.com/libp2p/go-libp2p v0.44.0 ) @@ -25,8 +25,8 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/huin/goupnp v1.3.0 // indirect - github.com/ipfs/boxo v0.35.0 // indirect - github.com/ipfs/go-cid v0.5.0 // indirect + github.com/ipfs/boxo v0.35.1 // indirect + github.com/ipfs/go-cid v0.6.0 // indirect github.com/ipfs/go-datastore v0.9.0 // indirect github.com/ipfs/go-log/v2 v2.8.2 // indirect github.com/ipld/go-ipld-prime v0.21.0 // indirect @@ -45,7 +45,7 @@ require ( github.com/libp2p/go-libp2p-record v0.3.1 // indirect github.com/libp2p/go-libp2p-routing-helpers v0.7.5 // indirect github.com/libp2p/go-msgio v0.3.0 // indirect - github.com/libp2p/go-netroute v0.3.0 // indirect + github.com/libp2p/go-netroute v0.4.0 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v5 v5.1.0 // indirect github.com/libp2p/zeroconf/v2 v2.2.0 // indirect @@ -77,21 +77,21 @@ require ( github.com/pion/mdns/v2 v2.0.7 // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/rtcp v1.2.16 // indirect - github.com/pion/rtp v1.8.24 // indirect + github.com/pion/rtp v1.8.25 // indirect github.com/pion/sctp v1.8.40 // indirect github.com/pion/sdp/v3 v3.0.16 // indirect github.com/pion/srtp/v3 v3.0.8 // indirect github.com/pion/stun v0.6.1 // indirect - github.com/pion/stun/v3 v3.0.0 // indirect + github.com/pion/stun/v3 v3.0.1 // indirect github.com/pion/transport/v2 v2.2.10 // indirect github.com/pion/transport/v3 v3.0.8 // indirect - github.com/pion/turn/v4 v4.1.1 // indirect + github.com/pion/turn/v4 v4.1.2 // indirect github.com/pion/webrtc/v4 v4.1.6 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect - github.com/prometheus/common v0.67.1 // indirect - github.com/prometheus/procfs v0.18.0 // indirect + github.com/prometheus/common v0.67.2 // indirect + github.com/prometheus/procfs v0.19.2 // indirect github.com/quic-go/qpack v0.5.1 // indirect github.com/quic-go/quic-go v0.55.0 // indirect github.com/quic-go/webtransport-go v0.9.0 // indirect @@ -114,7 +114,7 @@ require ( golang.org/x/net v0.46.0 // indirect golang.org/x/sync v0.17.0 // indirect golang.org/x/sys v0.37.0 // indirect - golang.org/x/telemetry v0.0.0-20251022145735-5be28d707443 // indirect + golang.org/x/telemetry v0.0.0-20251028164327-d7a2859f34e8 // indirect golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.38.0 // indirect diff --git a/example/go.sum b/example/go.sum index 900eafc..1d9633a 100644 --- a/example/go.sum +++ b/example/go.sum @@ -86,12 +86,12 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/ipfs/boxo v0.35.0 h1:3Mku5arSbAZz0dvb4goXRsQuZkFkPrGr5yYdu0YM1pY= -github.com/ipfs/boxo v0.35.0/go.mod h1:uhaF0DGnbgEiXDTmD249jCGbxVkMm6+Ew85q6Uub7lo= +github.com/ipfs/boxo v0.35.1 h1:MGL3aaaxnu/h9KKq+X/6FxapI/qlDmnRNk33U7tz/fQ= +github.com/ipfs/boxo v0.35.1/go.mod h1:/p1XZVp+Yzv78RuKjb3BESBYEQglRgDrWvmN5mFrsus= github.com/ipfs/go-block-format v0.2.3 h1:mpCuDaNXJ4wrBJLrtEaGFGXkferrw5eqVvzaHhtFKQk= github.com/ipfs/go-block-format v0.2.3/go.mod h1:WJaQmPAKhD3LspLixqlqNFxiZ3BZ3xgqxxoSR/76pnA= -github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= -github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= +github.com/ipfs/go-cid v0.6.0 h1:DlOReBV1xhHBhhfy/gBNNTSyfOM6rLiIx9J7A4DGf30= +github.com/ipfs/go-cid v0.6.0/go.mod h1:NC4kS1LZjzfhK40UGmpXv5/qD2kcMzACYJNntCUiDhQ= github.com/ipfs/go-datastore v0.9.0 h1:WocriPOayqalEsueHv6SdD4nPVl4rYMfYGLD4bqCZ+w= github.com/ipfs/go-datastore v0.9.0/go.mod h1:uT77w/XEGrvJWwHgdrMr8bqCN6ZTW9gzmi+3uK+ouHg= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= @@ -152,8 +152,8 @@ github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUI github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= -github.com/libp2p/go-netroute v0.3.0 h1:nqPCXHmeNmgTJnktosJ/sIef9hvwYCrsLxXmfNks/oc= -github.com/libp2p/go-netroute v0.3.0/go.mod h1:Nkd5ShYgSMS5MUKy/MU2T57xFoOKvvLR92Lic48LEyA= +github.com/libp2p/go-netroute v0.4.0 h1:sZZx9hyANYUx9PZyqcgE/E1GUG3iEtTZHUEvdtXT7/Q= +github.com/libp2p/go-netroute v0.4.0/go.mod h1:Nkd5ShYgSMS5MUKy/MU2T57xFoOKvvLR92Lic48LEyA= github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= github.com/libp2p/go-yamux/v5 v5.1.0 h1:8Qlxj4E9JGJAQVW6+uj2o7mqkqsIVlSUGmTWhlXzoHE= @@ -237,8 +237,8 @@ github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= github.com/pion/rtcp v1.2.16 h1:fk1B1dNW4hsI78XUCljZJlC4kZOPk67mNRuQ0fcEkSo= github.com/pion/rtcp v1.2.16/go.mod h1:/as7VKfYbs5NIb4h6muQ35kQF/J0ZVNz2Z3xKoCBYOo= -github.com/pion/rtp v1.8.24 h1:+ICyZXUQDv95EsHN70RrA4XKJf5MGWyC6QQc1u6/ynI= -github.com/pion/rtp v1.8.24/go.mod h1:rF5nS1GqbR7H/TCpKwylzeq6yDM+MM6k+On5EgeThEM= +github.com/pion/rtp v1.8.25 h1:b8+y44GNbwOJTYWuVan7SglX/hMlicVCAtL50ztyZHw= +github.com/pion/rtp v1.8.25/go.mod h1:rF5nS1GqbR7H/TCpKwylzeq6yDM+MM6k+On5EgeThEM= github.com/pion/sctp v1.8.40 h1:bqbgWYOrUhsYItEnRObUYZuzvOMsVplS3oNgzedBlG8= github.com/pion/sctp v1.8.40/go.mod h1:SPBBUENXE6ThkEksN5ZavfAhFYll+h+66ZiG6IZQuzo= github.com/pion/sdp/v3 v3.0.16 h1:0dKzYO6gTAvuLaAKQkC02eCPjMIi4NuAr/ibAwrGDCo= @@ -247,16 +247,16 @@ github.com/pion/srtp/v3 v3.0.8 h1:RjRrjcIeQsilPzxvdaElN0CpuQZdMvcl9VZ5UY9suUM= github.com/pion/srtp/v3 v3.0.8/go.mod h1:2Sq6YnDH7/UDCvkSoHSDNDeyBcFgWL0sAVycVbAsXFg= github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= -github.com/pion/stun/v3 v3.0.0 h1:4h1gwhWLWuZWOJIJR9s2ferRO+W3zA/b6ijOI6mKzUw= -github.com/pion/stun/v3 v3.0.0/go.mod h1:HvCN8txt8mwi4FBvS3EmDghW6aQJ24T+y+1TKjB5jyU= +github.com/pion/stun/v3 v3.0.1 h1:jx1uUq6BdPihF0yF33Jj2mh+C9p0atY94IkdnW174kA= +github.com/pion/stun/v3 v3.0.1/go.mod h1:RHnvlKFg+qHgoKIqtQWMOJF52wsImCAf/Jh5GjX+4Tw= github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g= github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q= github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E= github.com/pion/transport/v3 v3.0.8 h1:oI3myyYnTKUSTthu/NZZ8eu2I5sHbxbUNNFW62olaYc= github.com/pion/transport/v3 v3.0.8/go.mod h1:+c2eewC5WJQHiAA46fkMMzoYZSuGzA/7E2FPrOYHctQ= -github.com/pion/turn/v4 v4.1.1 h1:9UnY2HB99tpDyz3cVVZguSxcqkJ1DsTSZ+8TGruh4fc= -github.com/pion/turn/v4 v4.1.1/go.mod h1:2123tHk1O++vmjI5VSD0awT50NywDAq5A2NNNU4Jjs8= +github.com/pion/turn/v4 v4.1.2 h1:Em2svpl6aBFa88dLhxypMUzaLjC79kWZWx8FIov01cc= +github.com/pion/turn/v4 v4.1.2/go.mod h1:ISYWfZYy0Z3tXzRpyYZHTL+U23yFQIspfxogdQ8pn9Y= github.com/pion/webrtc/v4 v4.1.6 h1:srHH2HwvCGwPba25EYJgUzgLqCQoXl1VCUnrGQMSzUw= github.com/pion/webrtc/v4 v4.1.6/go.mod h1:wKecGRlkl3ox/As/MYghJL+b/cVXMEhoPMJWPuGQFhU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -271,11 +271,11 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.67.1 h1:OTSON1P4DNxzTg4hmKCc37o4ZAZDv0cfXLkOt0oEowI= -github.com/prometheus/common v0.67.1/go.mod h1:RpmT9v35q2Y+lsieQsdOh5sXZ6ajUGC8NjZAmr8vb0Q= +github.com/prometheus/common v0.67.2 h1:PcBAckGFTIHt2+L3I33uNRTlKTplNzFctXcWhPyAEN8= +github.com/prometheus/common v0.67.2/go.mod h1:63W3KZb1JOKgcjlIr64WW/LvFGAqKPj0atm+knVGEko= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.18.0 h1:2QTA9cKdznfYJz7EDaa7IiJobHuV7E1WzeBwcrhk0ao= -github.com/prometheus/procfs v0.18.0/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= +github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk= @@ -460,8 +460,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251022145735-5be28d707443 h1:eE5IhBiTMPgrcTS6Mlh7IG4MdydRrXr2y60Jn/JC6kM= -golang.org/x/telemetry v0.0.0-20251022145735-5be28d707443/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= +golang.org/x/telemetry v0.0.0-20251028164327-d7a2859f34e8 h1:DwMAzqwLj2rVin75cRFh1kfhwQY3hyHrU1oCEDZXPmQ= +golang.org/x/telemetry v0.0.0-20251028164327-d7a2859f34e8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= From 9c18fcc72c6f1961d9d4db403c70ce7313b347f8 Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Tue, 4 Nov 2025 08:21:25 -0500 Subject: [PATCH 10/10] chore(deps): update indirect dependencies in go.mod and go.sum --- go.mod | 20 ++++++++++---------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 2920ed8..9f34518 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/bsv-blockchain/go-p2p-message-bus go 1.24.6 require ( + github.com/ipfs/go-datastore v0.9.0 github.com/libp2p/go-libp2p v0.44.0 github.com/libp2p/go-libp2p-kad-dht v0.35.1 github.com/libp2p/go-libp2p-pubsub v0.15.0 @@ -29,9 +30,8 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/huin/goupnp v1.3.0 // indirect - github.com/ipfs/boxo v0.35.0 // indirect - github.com/ipfs/go-cid v0.5.0 // indirect - github.com/ipfs/go-datastore v0.9.0 // indirect + github.com/ipfs/boxo v0.35.1 // indirect + github.com/ipfs/go-cid v0.6.0 // indirect github.com/ipfs/go-log/v2 v2.8.2 // indirect github.com/ipld/go-ipld-prime v0.21.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect @@ -47,7 +47,7 @@ require ( github.com/libp2p/go-libp2p-record v0.3.1 // indirect github.com/libp2p/go-libp2p-routing-helpers v0.7.5 // indirect github.com/libp2p/go-msgio v0.3.0 // indirect - github.com/libp2p/go-netroute v0.3.0 // indirect + github.com/libp2p/go-netroute v0.4.0 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v5 v5.1.0 // indirect github.com/libp2p/zeroconf/v2 v2.2.0 // indirect @@ -78,22 +78,22 @@ require ( github.com/pion/mdns/v2 v2.0.7 // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/rtcp v1.2.16 // indirect - github.com/pion/rtp v1.8.24 // indirect + github.com/pion/rtp v1.8.25 // indirect github.com/pion/sctp v1.8.40 // indirect github.com/pion/sdp/v3 v3.0.16 // indirect github.com/pion/srtp/v3 v3.0.8 // indirect github.com/pion/stun v0.6.1 // indirect - github.com/pion/stun/v3 v3.0.0 // indirect + github.com/pion/stun/v3 v3.0.1 // indirect github.com/pion/transport/v2 v2.2.10 // indirect github.com/pion/transport/v3 v3.0.8 // indirect - github.com/pion/turn/v4 v4.1.1 // indirect + github.com/pion/turn/v4 v4.1.2 // indirect github.com/pion/webrtc/v4 v4.1.6 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect - github.com/prometheus/common v0.67.1 // indirect - github.com/prometheus/procfs v0.18.0 // indirect + github.com/prometheus/common v0.67.2 // indirect + github.com/prometheus/procfs v0.19.2 // indirect github.com/quic-go/qpack v0.5.1 // indirect github.com/quic-go/quic-go v0.55.0 // indirect github.com/quic-go/webtransport-go v0.9.0 // indirect @@ -116,7 +116,7 @@ require ( golang.org/x/net v0.46.0 // indirect golang.org/x/sync v0.17.0 // indirect golang.org/x/sys v0.37.0 // indirect - golang.org/x/telemetry v0.0.0-20251022145735-5be28d707443 // indirect + golang.org/x/telemetry v0.0.0-20251028164327-d7a2859f34e8 // indirect golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.38.0 // indirect diff --git a/go.sum b/go.sum index 900eafc..1d9633a 100644 --- a/go.sum +++ b/go.sum @@ -86,12 +86,12 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/ipfs/boxo v0.35.0 h1:3Mku5arSbAZz0dvb4goXRsQuZkFkPrGr5yYdu0YM1pY= -github.com/ipfs/boxo v0.35.0/go.mod h1:uhaF0DGnbgEiXDTmD249jCGbxVkMm6+Ew85q6Uub7lo= +github.com/ipfs/boxo v0.35.1 h1:MGL3aaaxnu/h9KKq+X/6FxapI/qlDmnRNk33U7tz/fQ= +github.com/ipfs/boxo v0.35.1/go.mod h1:/p1XZVp+Yzv78RuKjb3BESBYEQglRgDrWvmN5mFrsus= github.com/ipfs/go-block-format v0.2.3 h1:mpCuDaNXJ4wrBJLrtEaGFGXkferrw5eqVvzaHhtFKQk= github.com/ipfs/go-block-format v0.2.3/go.mod h1:WJaQmPAKhD3LspLixqlqNFxiZ3BZ3xgqxxoSR/76pnA= -github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= -github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= +github.com/ipfs/go-cid v0.6.0 h1:DlOReBV1xhHBhhfy/gBNNTSyfOM6rLiIx9J7A4DGf30= +github.com/ipfs/go-cid v0.6.0/go.mod h1:NC4kS1LZjzfhK40UGmpXv5/qD2kcMzACYJNntCUiDhQ= github.com/ipfs/go-datastore v0.9.0 h1:WocriPOayqalEsueHv6SdD4nPVl4rYMfYGLD4bqCZ+w= github.com/ipfs/go-datastore v0.9.0/go.mod h1:uT77w/XEGrvJWwHgdrMr8bqCN6ZTW9gzmi+3uK+ouHg= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= @@ -152,8 +152,8 @@ github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUI github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= -github.com/libp2p/go-netroute v0.3.0 h1:nqPCXHmeNmgTJnktosJ/sIef9hvwYCrsLxXmfNks/oc= -github.com/libp2p/go-netroute v0.3.0/go.mod h1:Nkd5ShYgSMS5MUKy/MU2T57xFoOKvvLR92Lic48LEyA= +github.com/libp2p/go-netroute v0.4.0 h1:sZZx9hyANYUx9PZyqcgE/E1GUG3iEtTZHUEvdtXT7/Q= +github.com/libp2p/go-netroute v0.4.0/go.mod h1:Nkd5ShYgSMS5MUKy/MU2T57xFoOKvvLR92Lic48LEyA= github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= github.com/libp2p/go-yamux/v5 v5.1.0 h1:8Qlxj4E9JGJAQVW6+uj2o7mqkqsIVlSUGmTWhlXzoHE= @@ -237,8 +237,8 @@ github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= github.com/pion/rtcp v1.2.16 h1:fk1B1dNW4hsI78XUCljZJlC4kZOPk67mNRuQ0fcEkSo= github.com/pion/rtcp v1.2.16/go.mod h1:/as7VKfYbs5NIb4h6muQ35kQF/J0ZVNz2Z3xKoCBYOo= -github.com/pion/rtp v1.8.24 h1:+ICyZXUQDv95EsHN70RrA4XKJf5MGWyC6QQc1u6/ynI= -github.com/pion/rtp v1.8.24/go.mod h1:rF5nS1GqbR7H/TCpKwylzeq6yDM+MM6k+On5EgeThEM= +github.com/pion/rtp v1.8.25 h1:b8+y44GNbwOJTYWuVan7SglX/hMlicVCAtL50ztyZHw= +github.com/pion/rtp v1.8.25/go.mod h1:rF5nS1GqbR7H/TCpKwylzeq6yDM+MM6k+On5EgeThEM= github.com/pion/sctp v1.8.40 h1:bqbgWYOrUhsYItEnRObUYZuzvOMsVplS3oNgzedBlG8= github.com/pion/sctp v1.8.40/go.mod h1:SPBBUENXE6ThkEksN5ZavfAhFYll+h+66ZiG6IZQuzo= github.com/pion/sdp/v3 v3.0.16 h1:0dKzYO6gTAvuLaAKQkC02eCPjMIi4NuAr/ibAwrGDCo= @@ -247,16 +247,16 @@ github.com/pion/srtp/v3 v3.0.8 h1:RjRrjcIeQsilPzxvdaElN0CpuQZdMvcl9VZ5UY9suUM= github.com/pion/srtp/v3 v3.0.8/go.mod h1:2Sq6YnDH7/UDCvkSoHSDNDeyBcFgWL0sAVycVbAsXFg= github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= -github.com/pion/stun/v3 v3.0.0 h1:4h1gwhWLWuZWOJIJR9s2ferRO+W3zA/b6ijOI6mKzUw= -github.com/pion/stun/v3 v3.0.0/go.mod h1:HvCN8txt8mwi4FBvS3EmDghW6aQJ24T+y+1TKjB5jyU= +github.com/pion/stun/v3 v3.0.1 h1:jx1uUq6BdPihF0yF33Jj2mh+C9p0atY94IkdnW174kA= +github.com/pion/stun/v3 v3.0.1/go.mod h1:RHnvlKFg+qHgoKIqtQWMOJF52wsImCAf/Jh5GjX+4Tw= github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g= github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q= github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E= github.com/pion/transport/v3 v3.0.8 h1:oI3myyYnTKUSTthu/NZZ8eu2I5sHbxbUNNFW62olaYc= github.com/pion/transport/v3 v3.0.8/go.mod h1:+c2eewC5WJQHiAA46fkMMzoYZSuGzA/7E2FPrOYHctQ= -github.com/pion/turn/v4 v4.1.1 h1:9UnY2HB99tpDyz3cVVZguSxcqkJ1DsTSZ+8TGruh4fc= -github.com/pion/turn/v4 v4.1.1/go.mod h1:2123tHk1O++vmjI5VSD0awT50NywDAq5A2NNNU4Jjs8= +github.com/pion/turn/v4 v4.1.2 h1:Em2svpl6aBFa88dLhxypMUzaLjC79kWZWx8FIov01cc= +github.com/pion/turn/v4 v4.1.2/go.mod h1:ISYWfZYy0Z3tXzRpyYZHTL+U23yFQIspfxogdQ8pn9Y= github.com/pion/webrtc/v4 v4.1.6 h1:srHH2HwvCGwPba25EYJgUzgLqCQoXl1VCUnrGQMSzUw= github.com/pion/webrtc/v4 v4.1.6/go.mod h1:wKecGRlkl3ox/As/MYghJL+b/cVXMEhoPMJWPuGQFhU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -271,11 +271,11 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.67.1 h1:OTSON1P4DNxzTg4hmKCc37o4ZAZDv0cfXLkOt0oEowI= -github.com/prometheus/common v0.67.1/go.mod h1:RpmT9v35q2Y+lsieQsdOh5sXZ6ajUGC8NjZAmr8vb0Q= +github.com/prometheus/common v0.67.2 h1:PcBAckGFTIHt2+L3I33uNRTlKTplNzFctXcWhPyAEN8= +github.com/prometheus/common v0.67.2/go.mod h1:63W3KZb1JOKgcjlIr64WW/LvFGAqKPj0atm+knVGEko= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.18.0 h1:2QTA9cKdznfYJz7EDaa7IiJobHuV7E1WzeBwcrhk0ao= -github.com/prometheus/procfs v0.18.0/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= +github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk= @@ -460,8 +460,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251022145735-5be28d707443 h1:eE5IhBiTMPgrcTS6Mlh7IG4MdydRrXr2y60Jn/JC6kM= -golang.org/x/telemetry v0.0.0-20251022145735-5be28d707443/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= +golang.org/x/telemetry v0.0.0-20251028164327-d7a2859f34e8 h1:DwMAzqwLj2rVin75cRFh1kfhwQY3hyHrU1oCEDZXPmQ= +golang.org/x/telemetry v0.0.0-20251028164327-d7a2859f34e8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=