A Python port of the Invisible Internet Project (I2P)
1"""Low-bandwidth router configuration for integration testing.
2
3Configures the router as a minimal, low-share-ratio participant:
4- Few tunnels, short tunnel length
5- Low bandwidth caps
6- No floodfill participation
7- Reseed from default I2P HTTPS servers
8"""
9
10from i2p_router.config import RouterConfig
11
12
13def create_test_config(
14 listen_host: str = "0.0.0.0",
15 listen_port: int = 9000,
16 data_dir: str = "/data/i2p",
17) -> RouterConfig:
18 """Create a low-share-ratio config for integration testing."""
19 return RouterConfig(
20 router_name="i2p-python-integration-test",
21 listen_host=listen_host,
22 listen_port=listen_port,
23 # Minimal tunnel participation
24 inbound_tunnel_count=2,
25 outbound_tunnel_count=2,
26 tunnel_length=2,
27 tunnel_lifetime_seconds=600,
28 # Low bandwidth (50 Kbps cap)
29 bandwidth_limit_kbps=50,
30 # No floodfill
31 floodfill=False,
32 # Timeouts
33 handshake_timeout_seconds=30,
34 idle_timeout_seconds=300,
35 # Data directory
36 data_dir=data_dir,
37 )