Local Development
Prerequisites
Section titled “Prerequisites”- Clone the monorepo and install dependencies (see the main ENSNode Contribution Guide).
- Make sure
pnpm
,Node.js >= 18
, and Docker (optional) are installed.
1 Download a .ensrainbow
file
Section titled “1 Download a .ensrainbow file”ENSRainbow stores label-hash-to-label pairs in compressed snapshots with the file extension .ensrainbow
.
Use the helper script located in apps/ensrainbow/scripts/
:
cd apps/ensrainbow
# Syntax: download-ensrainbow-files.sh <LABEL_SET_ID> <LABEL_SET_VERSION>./scripts/download-ensrainbow-files.sh subgraph 0 # classic ENS Subgraph labelset, version 0
Not sure which label set IDs and versions are available? You can check the Available Label Sets page for a complete list.
The script will:
- fetch the
.ensrainbow
file - verify its SHA-256 checksum
- place it in
apps/ensrainbow/labelsets/
2 Ingest into LevelDB
Section titled “2 Ingest into LevelDB”pnpm run ingest-ensrainbow \ --input-file subgraph-0.ensrainbow \ --data-dir ./my-subgraph-data
Important rules:
- The first ingest for a new directory must be version 0 of a label-set.
- All subsequent ingests must belong to the same
LABEL_SET_ID
. - Label-set versions must increment by exactly +1 each time.
3 Start the API server
Section titled “3 Start the API server”pnpm run serve --data-dir ./my-subgraph-data --port 3223
Visit http://localhost:3223/health
→ { "status": "ok" }
.