Node Setup
This page provides a production‑ready path using Node.js 20+ or Docker. The node is a small TypeScript service with JSON logs and an HTTP health check.
Prerequisites
- Linux/Windows/macOS with Node.js 20+ and npm, or Docker 24+
- RPC access to your target network (HTTP; optional WebSocket)
- A dedicated EOA with some gas token
- SYL tokens to stake (see Node Registry) and approve the staking contract
Install (source)
# 1) clone & install
cp .env.example .env # then edit values (see below)
npm i
# 2) develop or build
npm run dev # watch mode
npm run build && npm startInstall (Docker)
# Build local image and run
docker build -t sylan/node .
# Provide env via --env-file or bind a mounted .env
docker run --rm -it --name sylan-node --env-file .env sylan/nodeMulti‑node compose (for testing)
version: "3.9"
services:
node1:
build: .
image: sylan/node
restart: unless-stopped
env_file: [.env.common, .env.node1]
node2:
image: sylan/node
depends_on: [node1]
restart: unless-stopped
env_file: [.env.common, .env.node2]
node3:
image: sylan/node
depends_on: [node1]
restart: unless-stopped
env_file: [.env.common, .env.node3]Environment variables
| Key | Description |
|---|---|
RPC_URL | HTTP RPC endpoint for the target chain |
WS_RPC_URL | (optional) WebSocket RPC; enables live event streaming with HTTP polling fallback |
CHAIN_ID | Network chain id (e.g., 80002 for Polygon Amoy) |
CONSENSUS_ADDR | Deployed APIConsensus address |
REGISTRY_ADDR | Deployed AccessRegistry address |
PRIVATE_KEY | Node’s EOA private key (hex, 0x…) |
LOG_LEVEL | info, debug, warn, etc. |
POLL_FROM_BLOCK | Starting block for polling fallback (BigInt string) |
CONFIRMATIONS | Block confirmations for reads |
DRY_RUN | true to simulate without sending txs |
PROVIDER_BASE_URL | Base URL for Provider Gateway (the off‑chain server exposing /snapshot) |
PROVIDER_API_KEY | Optional API key header sent as x-api-key |
PINATA_JWT | If set, node pins JSON pointers to IPFS via Pinata |
IPFS_API_URL | Alternative native IPFS HTTP API (if not using Pinata) |
Health check & logs
- Health endpoint:
GET /healthz→200 OKwhen the event loop is active. - Logs are JSON via pino; redact secrets by default.
- Graceful shutdown on
SIGINT/SIGTERM.
Last updated on