Updated config & minor changes

This commit is contained in:
parth-soni07
2025-09-11 14:18:40 +05:30
parent 4a36d6efeb
commit 8793667503
5 changed files with 16 additions and 28 deletions

View File

@ -39,12 +39,6 @@ from libp2p.tools.async_service import (
Service,
)
from .config import (
DIAL_TIMEOUT,
STREAM_READ_TIMEOUT,
STREAM_WRITE_TIMEOUT,
)
logger = logging.getLogger(__name__)
# Protocol ID for DCUtR
@ -53,6 +47,11 @@ PROTOCOL_ID = TProtocol("/libp2p/dcutr")
# Maximum message size for DCUtR (4KiB as per spec)
MAX_MESSAGE_SIZE = 4 * 1024
# Timeouts
STREAM_READ_TIMEOUT = 30 # seconds
STREAM_WRITE_TIMEOUT = 30 # seconds
DIAL_TIMEOUT = 10 # seconds
# Maximum number of hole punch attempts per peer
MAX_HOLE_PUNCH_ATTEMPTS = 5