Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

microcosm link aggregator is called constellation

+32 -32
Cargo.lock
···
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
+
name = "constellation"
+
version = "0.1.0"
+
dependencies = [
+
"anyhow",
+
"askama",
+
"axum",
+
"axum-extra",
+
"axum-metrics",
+
"bincode",
+
"clap",
+
"ctrlc",
+
"flume",
+
"fs4",
+
"headers-accept",
+
"links",
+
"mediatype",
+
"metrics",
+
"metrics-exporter-prometheus",
+
"metrics-process",
+
"rocksdb",
+
"serde",
+
"serde_with",
+
"tempfile",
+
"tinyjson",
+
"tokio",
+
"tokio-util",
+
"tower-http",
+
"tungstenite",
+
"zstd",
+
]
+
+
[[package]]
name = "core-foundation"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
···
"cc",
"pkg-config",
"vcpkg",
-
]
-
-
[[package]]
-
name = "link_aggregator"
-
version = "0.1.0"
-
dependencies = [
-
"anyhow",
-
"askama",
-
"axum",
-
"axum-extra",
-
"axum-metrics",
-
"bincode",
-
"clap",
-
"ctrlc",
-
"flume",
-
"fs4",
-
"headers-accept",
-
"links",
-
"mediatype",
-
"metrics",
-
"metrics-exporter-prometheus",
-
"metrics-process",
-
"rocksdb",
-
"serde",
-
"serde_with",
-
"tempfile",
-
"tinyjson",
-
"tokio",
-
"tokio-util",
-
"tower-http",
-
"tungstenite",
-
"zstd",
[[package]]
+1 -1
Cargo.toml
···
resolver = "2"
members = [
"links",
-
"link_aggregator",
+
"constellation",
]
+1 -1
link_aggregator/Cargo.toml constellation/Cargo.toml
···
[package]
-
name = "link_aggregator"
+
name = "constellation"
version = "0.1.0"
edition = "2021"
+1 -1
link_aggregator/readme.md constellation/readme.md
···
-
# link_aggregator
+
# constellation 🌌
## endpoints
link_aggregator/src/consumer/jetstream.rs constellation/src/consumer/jetstream.rs
link_aggregator/src/consumer/jsonl_file.rs constellation/src/consumer/jsonl_file.rs
+1 -1
link_aggregator/src/consumer/mod.rs constellation/src/consumer/mod.rs
···
use crate::storage::LinkStorage;
use anyhow::Result;
+
use constellation::{ActionableEvent, RecordId};
use jetstream::consume_jetstream;
use jsonl_file::consume_jsonl_file;
-
use link_aggregator::{ActionableEvent, RecordId};
use links::collect_links;
use metrics::{counter, describe_counter, describe_histogram, histogram, Unit};
use std::path::PathBuf;
link_aggregator/src/lib.rs constellation/src/lib.rs
link_aggregator/src/main.rs constellation/src/main.rs
link_aggregator/src/server/acceptable.rs constellation/src/server/acceptable.rs
link_aggregator/src/server/filters.rs constellation/src/server/filters.rs
+1 -1
link_aggregator/src/server/mod.rs constellation/src/server/mod.rs
···
use tokio_util::sync::CancellationToken;
use crate::storage::LinkReader;
-
use link_aggregator::RecordId;
+
use constellation::RecordId;
mod acceptable;
mod filters;
+1 -1
link_aggregator/src/storage/mem_store.rs constellation/src/storage/mem_store.rs
···
use super::{LinkReader, LinkStorage, PagedAppendingCollection, StorageStats};
use anyhow::Result;
-
use link_aggregator::{ActionableEvent, Did, RecordId};
+
use constellation::{ActionableEvent, Did, RecordId};
use links::CollectedLink;
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
+1 -1
link_aggregator/src/storage/mod.rs constellation/src/storage/mod.rs
···
use anyhow::Result;
-
use link_aggregator::{ActionableEvent, RecordId};
+
use constellation::{ActionableEvent, RecordId};
use std::collections::HashMap;
pub mod mem_store;
+1 -1
link_aggregator/src/storage/rocks_store.rs constellation/src/storage/rocks_store.rs
···
use super::{ActionableEvent, LinkReader, LinkStorage, PagedAppendingCollection, StorageStats};
use anyhow::{bail, Result};
use bincode::Options as BincodeOptions;
-
use link_aggregator::{Did, RecordId};
+
use constellation::{Did, RecordId};
use links::CollectedLink;
use rocksdb::{
AsColumnFamilyRef, ColumnFamilyDescriptor, DBWithThreadMode, IteratorMode, MergeOperands,
+1 -1
link_aggregator/templates/base.html.j2 constellation/templates/base.html.j2
···
</style>
</head>
<body class="{% block body_classes %}{% endblock %}">
-
<h1><a href="/">This</a> is an <a href="https://github.com/at-ucosm/links/tree/main/link_aggregator">atproto link aggregator</a> server from <a href="https://github.com/at-ucosm">µcosm</a>!</h1>
+
<h1><a href="/">This</a> is an <a href="https://github.com/at-ucosm/links/tree/main/constellation">atproto link aggregator</a> server from <a href="https://github.com/at-ucosm">µcosm</a>!</h1>
{% block content %}{% endblock %}
<footer>
link_aggregator/templates/hello.html.j2 constellation/templates/hello.html.j2
link_aggregator/templates/links.html.j2 constellation/templates/links.html.j2
link_aggregator/templates/try-it-macros.html.j2 constellation/templates/try-it-macros.html.j2
link_aggregator/zstd/dictionary constellation/zstd/dictionary
+43 -6
readme.md
···
-
µcosm links
-
===========
+
microcosm: links
+
================
+
+
this repo contains libraries and apps for working with cross-record references in at-protocol.
+
+
+
App: [Constellation](./tree/main/microcosm/)
+
--------------------------------------------
+
+
A global atproto backlink index ✨
+
+
- Self hostable: handles the full write throughput of the global atproto firehose on a raspberry pi 4b + single SSD
+
- Storage efficient: less than 2GB/day disk consumption indexing all references in all lexicons and all non-atproto URLs
+
- Simple JSON API
+
+
All social interactions in atproto tend to be represented by links (or references) between PDS records. This index can answer questions like "how many likes does a bsky post have", "who follows an account", "what are all the comments on a [frontpage](https://frontpage.fyi/) post", and more.
+
+
- **status**: works! api is unstable and likely to change, and no known instances have a full network backfill yet.
+
- source: [./microcosm/](./tree/main/microcosm/)
+
- public instance: [links.bsky.bad-example.com](https://links.bsky.bad-example.com/)
+
+
_note: the public instance currently runs on a little raspberry pi in my house, feel free to use it! it comes with only with best-effort uptime, no commitment to not breaking the api for now, and possible rate-limiting. if you want to be nice you can put your project name and bsky username (or email) in your user-agent header for api requests._
+
+
+
App: Spacedust
+
--------------
-
optimistically extract links from arbitrary atproto records, optionally resolving canonical representations and possibly validating StrongRefs.
+
A notification subscription service 💫
+
using the same "link source" concept as [constellation](./tree/main/microcosm), offer webhook notifications for new references created to records
-
status
-
------
+
- **status**: in design
-
not at all ready (yet)
+
+
Library: [links](./tree/main/links/)
+
------------------------------------
+
+
A rust crate (not published on crates.io yet) for optimistically parsing links out of arbitrary atproto PDS records, and potentially canonicalizing them
+
+
- **status**: unstable, might remain an internal lib for constellation (and spacedust, soon)
+
+
---
+
+
+
old notes follow, ignore
+
------------------------
+
as far as i can tell, atproto lexicons today don't follow much of a convention for referencing across documents: sometimes it's a StrongRef, sometimes it's a DID, sometimes it's a bare at-uri. lexicon authors choose any old link-sounding key name for the key in their document.