Adding config options for V2 Circuit Relay server

This commit is contained in:
Chris Troutner
2024-01-27 13:17:34 -08:00
parent eb9fce73eb
commit adc6500aed
+13 -1
View File
@@ -117,7 +117,19 @@ class IpfsAdapter {
} }
if (this.config.isCircuitRelay) { if (this.config.isCircuitRelay) {
console.log('Helia (IPFS) node IS configured as Circuit Relay') 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 { } else {
console.log('Helia (IPFS) node IS NOT configured as Circuit Relay') console.log('Helia (IPFS) node IS NOT configured as Circuit Relay')
} }