upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/mod.rs')
-rw-r--r--src/sync/mod.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sync/mod.rs b/src/sync/mod.rs
new file mode 100644
index 0000000..279471b
--- /dev/null
+++ b/src/sync/mod.rs
@@ -0,0 +1,22 @@
1//! Proactive Sync Module for GRASP-02
2//!
3//! This module implements proactive synchronization of kind 30617 (repository state)
4//! events from configured relay(s). Events are validated through the same write policy
5//! as directly-submitted events.
6
7mod connection;
8mod manager;
9
10pub use manager::SyncManager;
11
12use std::net::SocketAddr;
13
14/// Synthetic source address used for synced events
15///
16/// This distinguishes synced events from directly-submitted events in logs and metrics.
17/// Uses 127.0.0.2:0 as a recognizable "synced event" marker.
18pub const SYNC_SOURCE_ADDR: SocketAddr =
19 SocketAddr::new(std::net::IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 2)), 0);
20
21/// Kind for repository state events (NIP-34)
22pub const KIND_REPOSITORY_STATE: u16 = 30617; \ No newline at end of file