Skip to content

net: I2P SAM v3 (--i2p-sam, --only-net=i2p) - #647

Merged
reardencode merged 9 commits into
net/tor-control-hsfrom
net/i2p-sam
Sep 21, 2026
Merged

reardencode merged 9 commits into
net/tor-control-hsfrom
net/i2p-sam

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Plan 04 (docs/personal-node-plans/04-i2p.md). Stacked on #646 (net/tor-control-hs).

  • NetAddr::I2p round-trips BIP155 AddrV2::I2p as {52}.b32.i2p:port; AddrMan / peers v2 keep I2P rows.
  • SAM v3 HELLO / SESSION CREATE / STREAM CONNECT against a fake router (no live i2pd). Direct still refuses I2P dials.
  • --i2p-sam [HOST:PORT] (omit ADDR → 127.0.0.1:7656). --only-net=i2p without SAM is a Config error.
  • --i2p-accept-incoming persists {datadir}/i2p/p2p.priv and STREAM FORWARDs to the P2P bind. --listen=0 is a Config error naming --listen.
  • NixOS: i2p.sam, i2p.acceptIncoming; After/Wants i2pd.service when SAM is set. Runtime dummy unit only — CI does not start i2pd.

IBD spawn_peer / follow_dial_targets remain SocketAddr; onion/I2P --connect parse and filter but do not yet drive IBD dials (same leftover as 02).

Test plan

  • cargo test -p rbitcoin-net --lib i2p_
  • cargo test -p rbitcoin-node --lib i2p_
  • nix build .#checks.x86_64-linux.nixos-module-eval --no-link
  • cargo clippy --workspace --all-targets -- -D warnings
  • required CI + nixos-module-runtime

Do not merge unless asked.

Made with Cursor

rearden-grok Bot and others added 9 commits September 20, 2026 19:41
Display is Core-shaped {52}.b32.i2p:port. SOCKS still refuses I2P
until SAM exists; Direct onion path is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
HELLO + SESSION CREATE once per process; each STREAM CONNECT is a new
SAM socket with the session id. Bad HELLO is an error. No live i2pd.

Co-authored-by: Cursor <cursoragent@cursor.com>
learn_addrv2 already mapped AddrV2::I2p. Persist the .b32.i2p token so
a restart still has the destination when SAM is configured later.

Co-authored-by: Cursor <cursoragent@cursor.com>
Omitted SAM ADDR is 127.0.0.1:7656. only-net=i2p without --i2p-sam is a
start error. Start opens one SAM session; Direct still refuses I2P dial.

Co-authored-by: Cursor <cursoragent@cursor.com>
Persist {datadir}/i2p/p2p.priv from SESSION CREATE DESTINATION. --listen=0
is a Config error: overlay incoming still needs a loopback P2P listener.

Co-authored-by: Cursor <cursoragent@cursor.com>
NixOS i2p.sam / i2p.acceptIncoming are first-class. Eval pins argv.
Runtime dummy i2pd.service only for After/Wants; CI does not start i2pd.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
OnceLock kept a dead session id forever. Store DESTINATION, keep the
control socket on reconnect, and retry STREAM CONNECT once on INVALID_ID.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode
reardencode added this pull request to stack #669 September 21, 2026 03:40
@reardencode
reardencode merged commit 1c5cc90 into master Sep 21, 2026
18 of 19 checks passed
@rearden-grok
rearden-grok Bot deleted the net/i2p-sam branch September 21, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nixos-module-runtime Run NixOS module VM test (nixos-module-runtime), not just eval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant