FC Farcaster Snapchain

Open Source · MIT License · Zero Third-Party API Keys

Read and post on Farcaster from your own server.

A production-grade, sovereign Farcaster node and web client suite requiring zero third-party API keys. Run your own independent infrastructure in one command.

Single-Command Autonomous Setup

Just ONE Command!

Deploy a personal Farcaster Snapchain Read Node and Sovereign Web Client on any clean Ubuntu 22.04+ server (or AWS EC2 instance) with a single command:

bash
curl -sSL https://raw.githubusercontent.com/mohammadma98/farcaster-snapchain-node-client/main/scripts/0-provision-compute.sh | bash

How it works: The pipeline executes all 3 stages sequentially: Server Tuning (0) → Snapchain RocksDB Streaming (1) → Web Client & Cloudflare SSL Tunnel (2).

The 3 Sequential Stages

While the single command above runs the entire pipeline end-to-end autonomously, you can also execute each modular script independently:

Stage 1

Server Configuration & Kernel Tuning (0-provision-compute.sh)

Installs prerequisite packages (Docker, Compose plugin, UFW firewall, zstd, jq). Configures ports: 22, 3000, 3381 (HTTP), 3382 (Gossip), 3383 (gRPC), 3005. Dynamically tunes Linux kernel network buffers for sustained P2P throughput.

curl -sSL https://raw.githubusercontent.com/mohammadma98/farcaster-snapchain-node-client/main/scripts/0-provision-compute.sh | bash
Stage 2

Read Node Installation & Concurrent Streaming (1-setup-read-node.sh)

Streams and downloads the Snapchain database snapshot at maximum throughput using a concurrent chunk pipeline. Extracts on-the-fly directly to RocksDB, eliminating duplicate multi-hundred-gigabyte archive files. Monitors :3381/v1/info until synced.

curl -sSL https://raw.githubusercontent.com/mohammadma98/farcaster-snapchain-node-client/main/scripts/1-setup-read-node.sh | bash
Stage 3

Web Client, Data Indexer & Cloudflare SSL Tunnel (2-create-client.sh)

Builds and launches the Next.js web client and fast-indexing layer in isolated Docker containers. Automatically configures a zero-config Cloudflare Edge Tunnel (https://*.trycloudflare.com) with valid SSL certificates for immediate browser access.

curl -sSL https://raw.githubusercontent.com/mohammadma98/farcaster-snapchain-node-client/main/scripts/2-create-client.sh | bash

Key Features & Capabilities

Engineered for minimal resource footprint, maximum reliability, and zero third-party dependencies.

💾 Minimal Storage (600 GB - 750 GB)

Runs smoothly on drives as low as 600 GB to 750 GB. Memory-assisted streaming extracts directly to RocksDB partitions, reducing peak disk from 1.4 TB+ to ~500–600 GB.

⚙️ 1 vCPU & 3 GB RAM Compatible

Adaptive hardware detection enables reliable execution even on low-cost servers with as little as 1 vCPU core and 3 GB RAM.

⚡ Fast Snapshot Sync

Full snapshot ingestion in under 3 hours on low-end servers and under 1 hour on mid/high-end servers through concurrent streaming.

🔒 Automatic HTTPS Tunnel

Deploys a secure Cloudflare Edge Tunnel with valid SSL certificates automatically, requiring zero manual DNS records or port forwarding.

🔑 Gasless App Signers (Engine V16)

Authorize app signers off-chain via EIP-712 custody signatures without spending Optimism ETH or submitting on-chain transactions.

📱 Client Neutrality & Source Filtering

Filter out or isolate casts by client origin (e.g. exclude Warpcast marketing). Responsive on mobile and desktop.

Tested Server Benchmarks & Hosting Providers

Benchmarked across real-world hardware profiles:

Server Profile Hardware Specs Monthly Cost Sync & Boot Status
Low-End Entry Tier 1 vCPU, 3 GB RAM, 750 GB HDD ~$6 / month ~3 hours ✅ Verified
Balanced Mid Tier 2 vCPU, 4 GB RAM, 600 GB SSD ~$15 / month ~3 hours ✅ Verified
High-Performance Tier 4 vCPU, 12 GB RAM, 600 GB NVMe ~$60 / month ~1 - 2 hours ✅ Verified

Tested on Hetzner, InterServer, and Cloudzy. Also compatible with AWS EC2 (m5.xlarge), DigitalOcean, Vultr, and OVH.

System Architecture & Protocol Mechanics

Direct mempool writes, gasless signing, and CometBFT consensus flow:

┌─────────────────────────────────────────────────────────────────────────────┐
│                       Sovereign Farcaster Client                            │
│    (Web Client at localhost:3000 • Mobile Responsive • Gasless EIP-712)     │
└───────────────────────┬─────────────────────────────▲───────────────────────┘
                        │ POST /v1/submitMessage      │ GET /v1/castsByFid
                        │ (Protobuf Binary)           │ GET /v1/info
                        ▼                             │
┌─────────────────────────────────────────────────────┴───────────────────────┐
│                       Standalone Read Node (:3381)                          │
│   (Dockerized Snapchain Read Node  •  Zero API Keys  •  Local Mempool)      │
└───────────────────────┬─────────────────────────────▲───────────────────────┘
                        │ libp2p Gossip (:3382)       │ Block Synchronization
                        │ (mempool topic)             │ (Tendermint / CometBFT)
                        ▼                             │
┌─────────────────────────────────────────────────────┴───────────────────────┐
│                        Snapchain Validator Network                          │
│          Shard 0 (Identity & Rent)  •  Shards 1 & 2 (User Actions)          │
└─────────────────────────────────────────────────────────────────────────────┘

1. Why Read Nodes Accept Writes

In Snapchain, read nodes accept writes via POST /v1/submitMessage. The node verifies the Ed25519 signature locally, places the message in its local mempool, and gossips it over libp2p (:3382) to validator nodes for block inclusion.

2. Gasless App Key Cryptography (Engine V16)

App keys are authorized off-chain: (1) Client generates an Ed25519 keypair; (2) The Ethereum custody address signs an off-chain EIP-712 KeyAddBody struct; (3) The Ed25519 private key signs for Proof of Possession (PoP); (4) The KEY_ADD is accepted with zero OP ETH gas.

3. Developer Security Guidance (Unix rm Analogy)

Like entering rm -rf in Unix, developer software taking a mnemonic seed phrase is intended strictly for developer test accounts. Never enter your cold-storage keys in local dev environments.

Sovereign REST API Documentation

The suite exposes a complete, zero-dependency RESTful API on http://localhost:3000/api/...:

GET
/api/node/status

Live node health check, latency, peer count, and sync state.

GET
/api/feed

Retrieve protocol casts with client attribution filters (mode, limit, source, viewerFid).

POST
/api/casts & GET /api/casts/:hash

Publish a new cast, quote cast, or thread reply directly to the read node mempool.

POST
/api/reactions

Submit or retract likes and recasts to the protocol mempool.

POST
/api/links

Follow or unfollow users via protocol-level LinkAdd / LinkRemove messages.

GET
/api/users/:id & /api/users/:id/casts & /api/users/search

Fetch user profile metadata, bio, follower count, and published casts.

GET
/api/wallet/tokens?fid=...

Query live on-chain token holdings and valuation across Ethereum and Base.

POST
/api/upload

Upload images for cast embeds with server-side magic byte verification.

POST
/api/auth/login

Authorize an EIP-712 gasless app signer without blockchain transactions or OP ETH.

Peer Verification & Human Voucher Checklist

A 3-minute reproducible test checklist for community reviewers to endorse on Farcaster:

Step 1: Quickstart

Run script 0 on clean VPS. Confirm Docker boots.

Step 2: Node Health

Confirm curl :3381/v1/info returns 200 OK.

Step 3: Gasless Key

Issue EIP-712 signer with zero OP ETH.

Step 4: Endorse Cast

Publish endorsement cast referencing @mohammad98.

Sample Endorsement Cast Template (Click to Copy):

Verified @mohammad98's Farcaster Snapchain Suite on a clean Ubuntu VPS. 3 commands booted the node on :3381 and launched the sovereign client with gasless EIP-712 signers. https://github.com/mohammadma98/farcaster-snapchain-node-client