atproto-tap
TAP (Trusted Attestation Protocol) service consumer for AT Protocol.
Overview
WebSocket streaming client for TAP services, which deliver filtered and verified AT Protocol repository events. Supports automatic reconnection with exponential backoff, at-least-once delivery via acknowledgments, and an HTTP management API for controlling which repositories are tracked.
Features
- Verified event stream: Connects to a TAP service that provides MST-verified, signature-checked events
- Automatic reconnection: Exponential backoff with configurable limits
- At-least-once delivery: Acknowledgment protocol ensures no events are lost across reconnects
- Backfill support: Historical events delivered with
live: falsefor catch-up - Management API: HTTP client for adding/removing tracked DIDs, health checks, and DID resolution
- Memory efficient:
Arc-wrapped events,CompactStringfor small strings, pre-allocated ack buffers
CLI Tools
The following command-line tools are available when built with the clap feature:
atproto-tap-client: Stream TAP events as JSON and manage tracked repositoriesatproto-tap-extras: Bulk-add followed accounts to TAP tracking from a DID's social graph
Usage
Quick Start
use ;
use StreamExt;
async
Configuration
use ;
use Duration;
let config = builder
.hostname
.admin_password
.send_acks
.max_reconnect_attempts
.initial_reconnect_delay
.max_reconnect_delay
.channel_buffer_size
.build;
let mut stream = connect;
Using with tokio::select!
use ;
use StreamExt;
use signal;
async
Management API
use TapClient;
let client = new;
// Add repositories to track
client.add_repos.await?;
// Remove repositories
client.remove_repos.await?;
// Check service health
if client.health.await?
// Resolve a DID to its document
let doc = client.resolve.await?;
Command Line Examples
# Stream all events from a TAP service
# Stream with authentication and collection filtering
# Stream only live events (skip backfill)
# Add DIDs to tracking
# Remove DIDs from tracking
# Resolve a DID to its DID document
# Get repository tracking info
# Bulk-add all accounts followed by a DID
# Dry run to preview which DIDs would be added
License
MIT License