diff options
Diffstat (limited to 'src/sync/mod.rs')
| -rw-r--r-- | src/sync/mod.rs | 22 |
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 | |||
| 7 | mod connection; | ||
| 8 | mod manager; | ||
| 9 | |||
| 10 | pub use manager::SyncManager; | ||
| 11 | |||
| 12 | use 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. | ||
| 18 | pub 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) | ||
| 22 | pub const KIND_REPOSITORY_STATE: u16 = 30617; \ No newline at end of file | ||