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

View File

@ -23,14 +23,14 @@ from .pb.kademlia_pb2 import (
Message,
)
from .common import (
PROTOCOL_ID,
DEFAULT_TTL
)
# logger = logging.getLogger("libp2p.kademlia.value_store")
logger = logging.getLogger("kademlia-example.value_store")
# Default time to live for values in seconds (24 hours)
DEFAULT_TTL = 24 * 60 * 60
PROTOCOL_ID = TProtocol("/ipfs/kad/1.0.0")
class ValueStore:
"""
Store for key-value pairs in a Kademlia DHT.