From efae61b2f9ae9ff8c852b8768eab75b6ddb29808 Mon Sep 17 00:00:00 2001 From: juligasa <11684004+juligasa@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:20:44 +0200 Subject: [PATCH] wip(daemon): lower dht concurrency --- backend/ipfs/libp2p.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/ipfs/libp2p.go b/backend/ipfs/libp2p.go index 534c7fb3..2ca1fd72 100644 --- a/backend/ipfs/libp2p.go +++ b/backend/ipfs/libp2p.go @@ -100,7 +100,7 @@ func NewLibp2pNode(key crypto.PrivKey, ds datastore.Batching, protocolID protoco clean.Add(provStore) r, err := dht.New(ctx, h, - dht.Concurrency(10), + dht.Concurrency(1), // Forcing DHT client mode. // This libp2p node is not meant to be a DHT server. dht.Mode(dht.ModeClient), @@ -112,7 +112,7 @@ func NewLibp2pNode(key crypto.PrivKey, ds datastore.Batching, protocolID protoco dht.RoutingTableFilter(dht.PublicRoutingTableFilter), // Not sure what those magic numbers are. Copied from dualdht package. // We don't use it because we don't need the LAN DHT. - dht.RoutingTablePeerDiversityFilter(dht.NewRTPeerDiversityFilter(h, 2, 3)), + dht.RoutingTablePeerDiversityFilter(dht.NewRTPeerDiversityFilter(h, 1, 1)), // Filter out all private addresses dht.AddressFilter(func(addrs []multiaddr.Multiaddr) []multiaddr.Multiaddr { return multiaddr.FilterAddrs(addrs, manet.IsPublicAddr)