From adc6500aeda112d509e0fb220b0f66cc7686c054 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 27 Jan 2024 13:17:34 -0800 Subject: [PATCH] Adding config options for V2 Circuit Relay server --- src/adapters/ipfs/ipfs.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/adapters/ipfs/ipfs.js b/src/adapters/ipfs/ipfs.js index 626b274..c9891c2 100644 --- a/src/adapters/ipfs/ipfs.js +++ b/src/adapters/ipfs/ipfs.js @@ -117,7 +117,19 @@ class IpfsAdapter { } if (this.config.isCircuitRelay) { console.log('Helia (IPFS) node IS configured as Circuit Relay') - services.relay = circuitRelayServer() + services.relay = circuitRelayServer({ // makes the node function as a relay server + hopTimeout: 30 * 1000, // incoming relay requests must be resolved within this time limit + advertise: true, + reservations: { + maxReservations: 15, // how many peers are allowed to reserve relay slots on this server + reservationClearInterval: 300 * 1000, // how often to reclaim stale reservations + applyDefaultLimit: true, // whether to apply default data/duration limits to each relayed connection + defaultDurationLimit: 2 * 60 * 1000, // the default maximum amount of time a relayed connection can be open for + defaultDataLimit: BigInt(2 << 7), // the default maximum number of bytes that can be transferred over a relayed connection + maxInboundHopStreams: 32, // how many inbound HOP streams are allow simultaneously + maxOutboundHopStreams: 64, // how many outbound HOP streams are allow simultaneously + } + }) } else { console.log('Helia (IPFS) node IS NOT configured as Circuit Relay') }