mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
- Add src/sync/ module with SyncManager - Add NGIT_SYNC_RELAY_URL config option - Subscribe to kind 30617 on configured relay - Validate synced events through Nip34WritePolicy - Integration test with two TestRelay instances
22 lines
765 B
Rust
22 lines
765 B
Rust
//! Proactive Sync Module for GRASP-02
|
|
//!
|
|
//! This module implements proactive synchronization of kind 30617 (repository state)
|
|
//! events from configured relay(s). Events are validated through the same write policy
|
|
//! as directly-submitted events.
|
|
|
|
mod connection;
|
|
mod manager;
|
|
|
|
pub use manager::SyncManager;
|
|
|
|
use std::net::SocketAddr;
|
|
|
|
/// Synthetic source address used for synced events
|
|
///
|
|
/// This distinguishes synced events from directly-submitted events in logs and metrics.
|
|
/// Uses 127.0.0.2:0 as a recognizable "synced event" marker.
|
|
pub const SYNC_SOURCE_ADDR: SocketAddr =
|
|
SocketAddr::new(std::net::IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 2)), 0);
|
|
|
|
/// Kind for repository state events (NIP-34)
|
|
pub const KIND_REPOSITORY_STATE: u16 = 30617; |