feat: add public I2P network mode to router daemon
check / check (ubuntu-latest) (push) Failing after 26s
check / check (macos-latest) (push) Failing after 28s
check / check (windows-latest) (push) Failing after 29s

- Add `--public`, `--hops`, `--hosts`, and `--debug` router flags; `--public` auto-reseeds from the live network and keeps a status loop running.
- Route NetDB lookups through tunnels with Noise_N garlic wrapping, fan out to two floodfills, and fetch unknown RouterInfos in the background.
- Back off failed NTCP2 peers and fall back to IPv6 addresses when no IPv4 NTCP2 address is available.
- Size session LeaseSet2 expiry from lease end dates and use the destination's X25519 key when present.
- Add canonical Ed25519 Destination KeyCertificate constructors with round-trip tests.
- Fix DatabaseStore gzip handling to honor the length prefix, and send `Wget/1.11.4` as the reseed User-Agent.
This commit is contained in:
nandi committed 2026-11-28 00:11:28 -08:00
1 parent ae72b00323
commit 54cfb2faa9
25 files changed
+2033 -191

No files matched your search

+57
View File
@@ -299,3 +299,60 @@ test "Three-router live Proposal 157 multi-hop tunnel build and fragmented 2500B
bob_acc.shutdown_write()
assert_eq(pump_read_until_eof(alice_data, rs), b"tunneled-ok")
}
///|
test "Proposal 157 Outbound tunnel replying via Inbound tunnel with OBEP ECIES Garlic" {
let router_b = @router.Router::start({
sam_host: "127.0.0.1",
sam_port: 0,
ntcp2_host: "127.0.0.1",
ntcp2_port: 0,
})
defer router_b.close()
let router_c = @router.Router::start({
sam_host: "127.0.0.1",
sam_port: 0,
ntcp2_host: "127.0.0.1",
ntcp2_port: 0,
})
defer router_c.close()
let router_a = @router.Router::start({
sam_host: "127.0.0.1",
sam_port: 0,
ntcp2_host: "127.0.0.1",
ntcp2_port: 0,
})
defer router_a.close()
for r in [router_a, router_b, router_c] {
let _ = r.netdb.store_router_info(router_a.router_info)
let _ = r.netdb.store_router_info(router_b.router_info)
let _ = r.netdb.store_router_info(router_c.router_info)
}
let rs = [router_a, router_b, router_c]
let in_tid = router_a.build_tunnel([router_b.router_hash()], Inbound)
for _i = 0; _i < 500; _i = _i + 1 {
step_routers(rs, 1)
if router_a.has_tunnel(in_tid) {
break
}
}
assert_true(router_a.has_tunnel(in_tid))
let reply_in = router_a.tunnels.inbound[0]
let out_tid = router_a.build_tunnel(
[router_c.router_hash()],
Outbound,
reply_tunnel=Some(reply_in),
)
let mut built_out = false
for _i = 0; _i < 800; _i = _i + 1 {
step_routers(rs, 1)
if router_a.has_tunnel(out_tid) {
built_out = true
break
}
}
assert_true(built_out)
}