- Fix bidirectional stream handling: responder uses accept_bi() instead of open_bi() so both sides communicate on the same stream - Add live_receive_loop to accept incoming bi-streams during ongoing sync (peer's push loop opens new streams per batch) - Split live_sync_loop into live_push_loop + live_receive_loop running concurrently via tokio::select in new run_live_sync() - Update handle_incoming to run live sync after initial reconciliation - Add direct peer connection via ticket files (EndpointAddr JSON exchange) for local testing without gossip bootstrap - Add CAN_PORT env var override for running multiple CAN instances - Add integration test binary (sync_test.rs): starts 2 CAN services + 2 sync agents, ingests files on each side, verifies bidirectional sync with 4 test cases (A→B, B→A, batch, count match) - Add PowerShell script (run-integration-test.ps1) for one-command test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
1002 B
TOML
50 lines
1002 B
TOML
[package]
|
|
name = "can-sync"
|
|
version = "0.2.0"
|
|
edition = "2021"
|
|
description = "P2P sync agent for CAN service — full mirror replication via iroh"
|
|
|
|
[[bin]]
|
|
name = "can-sync"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "sync-test"
|
|
path = "tests/sync_test.rs"
|
|
|
|
[dependencies]
|
|
# P2P networking (iroh for transport + gossip for discovery — NO iroh-docs)
|
|
iroh = "0.96"
|
|
iroh-gossip = "0.96"
|
|
|
|
# Protobuf (same message types as CAN service sync API)
|
|
prost = "0.13"
|
|
|
|
# HTTP client for CAN service sync API
|
|
reqwest = { version = "0.12", features = ["json", "multipart", "blocking"] }
|
|
|
|
# Serialization
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_yaml = "0.9"
|
|
|
|
# Crypto
|
|
blake3 = "1"
|
|
|
|
# Async runtime
|
|
tokio = { version = "1", features = ["full"] }
|
|
|
|
# Logging
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
# Stream utilities (needed for gossip event stream)
|
|
n0-future = "0.1"
|
|
|
|
# Utilities
|
|
anyhow = "1"
|
|
bytes = "1"
|
|
hex = "0.4"
|
|
serde_json = "1"
|
|
tempfile = "3"
|
|
rand = "0.9"
|