chore(kad_dht): centralize shared values in common.py

This commit is contained in:
Luca Vivona
2025-06-19 21:24:39 -04:00
parent 09b4c846a4
commit dfc0bb4ec8
5 changed files with 32 additions and 17 deletions

10
libp2p/kad_dht/common.py Normal file
View File

@ -0,0 +1,10 @@
from libp2p.custom_types import (
TProtocol,
)
# Constants for the Kademlia algorithm
ALPHA = 3 # Concurrency parameter
PROTOCOL_ID = TProtocol("/ipfs/kad/1.0.0")
QUERY_TIMEOUT = 10
TTL = DEFAULT_TTL = 24 * 60 * 60 # 24 hours in seconds