Under Construction This DApp is in development

Node Setup (Relayer & Indexer)

This guide is intended for technically inclined community members, contributors, and power users interested in supporting the decentralization and resilience of OmniSocial’s infrastructure.

This guide walks you through how to run and maintain two core infrastructure components of OmniSocial:

  1. Relayer Node for handling meta-transactions (e.g. gasless posts, tipping).

  2. Indexer Node for hosting your own copy of the OmniSocial subgraph, contributing to decentralized data access.

⚙️ 1. Relayer Node Setup (OmniWallet Meta-Tx Handler)

Relayers are off-chain services that listen for signed meta-transactions from users and submit them to the blockchain on their behalf.

📦 Requirements

  • Node.js v18+

  • Redis (for job queue persistence)

  • Access to an RPC endpoint for Polygon zkEVM (Alchemy, Ankr, or self-hosted)

📁 Clone the Repo

git clone https://github.com/OmniSocialBlockchain/omnisocial-relayer.git
cd omnisocial-relayer

📄 .env Configuration

Create a .env file with the following:

PRIVATE_KEY=your_relayer_wallet_private_key
RPC_URL=https://your-zkevm-rpc-node
CHAIN_ID=1101
REDIS_URL=redis://localhost:6379
WALLET_FACTORY_ADDRESS=0xOmniWalletFactory...
RELAYER_LOG_LEVEL=info
PORT=4000

🚀 Start the Relayer

npm install
npm run start

The service:

  • Watches for UserOperation events

  • Verifies signature and nonce

  • Submits to the OmniWallet via execute()

📝 Logs and metrics are available at localhost:4000/health and /metrics.

🌐 2. Indexer Node Setup (The Graph)

Running your own Graph node allows you to query OmniSocial data (wallets, personas, proposals, tips) and ensure redundancy.

📦 Requirements

  • Docker + Docker Compose

  • PostgreSQL (11+)

  • IPFS (for storing subgraph manifests)

  • Node.js v18+ (for scripting support)

📁 Clone the Subgraph

git clone https://github.com/OmniSocialBlockchain/omnisocial-subgraph.git
cd omnisocial-subgraph

🐳 Spin Up the Graph Node Stack

Using the provided docker-compose.yml:

docker-compose up -d

This launches:

  • Graph Node

  • IPFS

  • Postgres

  • GraphQL playground on localhost:8000/subgraphs/name/omnisocial

🚀 Deploy the Subgraph

Once your Graph node is running:

graph auth http://localhost:8020 <your-auth-token>
graph deploy \
  --product hosted-service \
  omnisocial/omnisocial \
  --node http://localhost:8020 \
  --ipfs http://localhost:5001

Optional: You can modify subgraph.yaml to track custom contracts or add data sources.

🔄 Syncing & Metrics

You can monitor indexing progress at:

http://localhost:8000/subgraphs

You’ll see:

  • Sync status

  • Block lag

  • Query latencies

🔍 Example GraphQL Query:

{
  personas(first: 5) {
    id
    handle
    rep
  }
}

💡 Why Run a Node?

  • Resilience: Decentralized infra can’t be taken down easily.

  • Transparency: Trust but verify — run your own mirror.

  • Rewards (TBD): Community-run relayers and indexers may be eligible for future incentives.

🛠 Optional Enhancements

  • Deploy your Graph node behind a reverse proxy (e.g. NGINX)

  • Add TLS certificates

  • Enable logging to Prometheus / Grafana (see Monitoring & Analytics docs)

Last updated

Was this helpful?