A Go server that indexes dagit posts from IPFS, supports moderation via stamps, and serves curated feeds per community. Single binary, handles many users.
dagit (pydagit) Protocol library (Python)
↓ publishes posts to IPFS
dagit-server Indexes, moderates, serves feeds (Go)
↓ provides feeds to
memex Client workstation (Python)
Posts are signed with Ed25519 keys (did:key identities), stored on IPFS, and submitted to dagit-server by CID. The server verifies signatures, indexes content in SQLite with full-text search, and filters feeds through moderator stamps.
# Build
go build ./cmd/dagit-server
# Run (requires IPFS daemon on localhost:5001)
./dagit-server
# Server runs on http://localhost:5000| Variable | Default | Description |
|---|---|---|
PORT |
5000 |
HTTP listen port |
DAGIT_DB |
dagit_server.db |
SQLite database path |
IPFS_API |
http://localhost:5001/api/v0 |
IPFS HTTP API URL |
curl localhost:5000/healthSubmit a CID to fetch from IPFS, verify its signature, and index it:
curl -X POST localhost:5000/api/submit \
-H 'Content-Type: application/json' \
-d '{"cid":"QmYourPostCID..."}'Get posts that moderators have stamped for a community tag:
curl 'localhost:5000/api/feed?tag=science&limit=20'Posts awaiting moderation:
curl 'localhost:5000/api/pending?tag=science'curl localhost:5000/api/post/{cid}Full-text search across post content and tags:
curl 'localhost:5000/api/search?q=quantum+computing'# Register a moderator
curl -X POST localhost:5000/api/moderators \
-H 'Content-Type: application/json' \
-d '{"did":"did:key:z6Mk...","tag":"science"}'
# List moderators for a tag
curl 'localhost:5000/api/moderators?tag=science'- A user publishes a post via dagit (Python) to IPFS
- The CID is submitted to dagit-server via
POST /api/submit - The server fetches the post from IPFS, verifies the Ed25519 signature, and indexes it
- The post appears in
GET /api/pending?tag=... - A moderator publishes a stamp post (type: "stamp", refs: [post CID], tags: [community])
- The stamp CID is submitted to dagit-server
- The server verifies the stamp, checks the author is a registered moderator, and records the approval
- The original post now appears in
GET /api/feed?tag=...
cmd/dagit-server/main.go Entry point, config, router, graceful shutdown
internal/
api/handlers.go HTTP handlers (8 endpoints)
dagit/types.go Post struct, protocol constants
dagit/did.go DID decoding (base58btc → Ed25519)
dagit/verify.go Signature verification
db/schema.go SQLite DDL, indexes, FTS5
db/sqlite.go Query functions
ingest/ingest.go Fetch, verify, classify, index
ipfs/client.go IPFS HTTP API client
BSD 3-Clause License. See LICENSE.