nexus-watcher

Crates.ionexus-watcher
lib.rsnexus-watcher
version0.4.1
created_at2025-07-01 08:08:02.537325+00
updated_at2025-07-01 11:40:39.678014+00
descriptionNexus Watcher constructs a social graph out of all of the events on pubky-core homeservers
homepagehttps://github.com/pubky/pubky-nexus
repositoryhttps://github.com/pubky/pubky-nexus
max_upload_size
id1732886
size526,615
(tipogi)

documentation

README

Nexus Watcher

Nexus Watcher is a service that monitors events from a Pubky homeserver and updates the Nexus databases accordingly.
It polls for events from the /events endpoint of a homeserver and processes them ensuring that the graph database (Neo4j) and Redis indexes remain synchronized.

Features

  • Event Processing:
    Processes various types of events such as posts, bookmarks, follows, mutes, tags, and user profile updates using pubky-app-specs object builder.

  • Retry Mechanism:
    Supports retry logic for events that fail to index due to missing dependencies or other transient errors

  • Integration with Nexus Common:
    Leverages shared components from the nexus-common crate for configuration, database access, logging, and stack management

  • Configurable and Extensible:
    Provides a builder API to configure service parameters such as the homeserver Pubky ID, database settings, logging level, testnet mode, and more

  • Comprehensive Testing:
    Comes with an extensive test suite covering all event types and error conditions

Quick Examples

The main entry point is available via the builder in the nexus_watcher::builder module. For example, you can start the watcher using:

use nexus_watcher::builder::NexusWatcher;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
    NexusWatcher::builder().run().await
}

Alternatively, if you prefer to load the configuration from a file:

use nexus_watcher::builder::NexusWatcher;
use std::path::PathBuf;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
    NexusWatcher::start_from_path(PathBuf::from("path/to/config/folder")).await?;
    Ok(())
}

License

This project is licensed under the MIT License.

Commit count: 0

cargo fmt