=============== LIBRARY RULES =============== From library maintainers: - Prefer the ENS Omnigraph GraphQL API for reading ENS data over the deprecated ENS Subgraph API. - Use enssdk (TypeScript) or enskit (React) for typed ENS Omnigraph access. - AI agents working with ENS should install the ensskills npm package for curated agent skills. ### Creating Test Dataset Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/creating-files.mdx Example command to create a test .ensrainbow dataset from a CSV file named 'test-labels.csv'. ```bash # Create test dataset from CSV pnpm run convert \ --input-file test-labels.csv \ --output-file test-dataset_0.ensrainbow \ --label-set-id test-dataset ``` -------------------------------- ### Quick Start Docker Deployment Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/deploying/docker.mdx Run ENSRainbow with test data for a quick setup. This command mounts a local directory for persistent data and sets environment variables for test data. ```bash # Create a directory for persistent data storage mkdir -p ~/my_ensrainbow_data # Run with the ens-test-env data docker run -d --name ensrainbow \ -v ~/my_ensrainbow_data:/app/apps/ensrainbow/data \ -e DB_SCHEMA_VERSION="3" \ -e LABEL_SET_ID="ens-test-env" \ -e LABEL_SET_VERSION="0" \ -p 3223:3223 \ ghcr.io/namehash/ensnode/ensrainbow:latest ``` -------------------------------- ### Install Dependencies Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensadmin/contributing/index.mdx Installs all necessary project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Copy Example Environment File for Docker Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/self-host/docker.mdx Copy the example environment file to a local configuration file for customization. This is the first step for configuring Docker deployments. ```bash cp docker/envs/.env.docker.example docker/envs/.env.docker.local ``` -------------------------------- ### System Key Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/glossary.mdx Example of a system key, distinguished by its non-32-byte length. ```text 0xff 0xff 0xff 0xfd ``` -------------------------------- ### Install Preview Release Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/releases.mdx Install preview packages using this command. The tag includes `@preview-` followed by the branch name or a custom suffix. ```bash npm install @ensnode/[package-name]@preview-branch-name ``` -------------------------------- ### Prepare ENSAdmin Local Environment Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/index.mdx Copy the example environment file for ENSAdmin configuration. ```bash cd apps/ensadmin cp .env.local.example .env.local ``` -------------------------------- ### Add Start Script to package.json Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/integration-options/omnigraph-graphql-api.mdx Configure the 'start' script in package.json to execute the main TypeScript file (src/index.ts) using tsx. ```json { "type": "module", "scripts": { "start": "tsx src/index.ts" } } ``` -------------------------------- ### Add ensskills and skills-npm to package.json Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/ai-llm.mdx Install `ensskills` and `skills-npm` as dev dependencies and set up a `prepare` script to sync skills on install. ```jsonc // package.json { "devDependencies": { "ensskills": "${snapshot.sdkVersion}", "skills-npm": "^1" }, "scripts": { "prepare": "skills-npm" } } ``` -------------------------------- ### Install enskit and enssdk Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/index.mdx Install the exact versions of enskit and enssdk that are compatible with your ENSNode instance. Pinning exact versions is crucial for type safety. ```sh npm install enskit@${snapshot.sdkVersion} enssdk@${snapshot.sdkVersion} ``` -------------------------------- ### ENS-Rainbow Client SDK Initialization Examples Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/typescript-interfaces.mdx Demonstrates how to initialize the EnsRainbowApiClient with different clientLabelSet configurations to manage label set expectations. ```typescript import { EnsRainbowApiClient } from "@ensnode/ensrainbow-sdk"; // Default: use latest version of any labelset const client1 = new EnsRainbowApiClient({ endpointUrl: "https://api.ensrainbow.io", }); // Pin to subgraph labelset, use latest version const client2 = new EnsRainbowApiClient({ endpointUrl: "https://api.ensrainbow.io", clientLabelSet: { labelSetId: "subgraph" }, }); // Pin to exact labelset snapshot for deterministic results across time const client3 = new EnsRainbowApiClient({ endpointUrl: "https://api.ensrainbow.io", clientLabelSet: { labelSetId: "subgraph", labelSetVersion: 0, }, }); ``` -------------------------------- ### Set Local Configuration Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensadmin/contributing/index.mdx Copies the example environment file to create a local configuration. This file should be modified with specific environment variables. ```bash cp .env.local.example .env.local ``` -------------------------------- ### Install ENSRainbow SDK Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/usage/client-sdk.mdx Install the ENSRainbow SDK using pnpm. This command adds the necessary package to your project dependencies. ```bash pnpm add @ensnode/ensrainbow-sdk ``` -------------------------------- ### Run Development Server Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensadmin/contributing/index.mdx Starts the Next.js development server for local development. Access the application at http://localhost:4173. ```bash pnpm dev ``` -------------------------------- ### Configure ENSIndexer Environment Variables Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensindexer/contributing/index.mdx Navigate to the ENSIndexer application directory and copy the example environment file to create a local configuration. ```bash cd apps/ensindexer cp .env.local.example .env.local ``` -------------------------------- ### Start ENSRainbow API Server Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/contributing/index.mdx Starts the API server. Specify the port and data directory if needed. Exits with code 0 on clean shutdown, 1 on error. ```bash pnpm run serve [--port 3223] [--data-dir path/to/db] ``` -------------------------------- ### Install Snapshot Release (NPM) Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/releases.mdx Use this command to install snapshot releases from NPM. Snapshot releases are associated with each commit to the main branch and tagged with `@next`. ```bash pnpm install @ensnode/[package-name]@next ``` -------------------------------- ### Install ENS skills using npx skills Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/ai-llm.mdx Use `npx skills` to install ENS skills directly from the repository, pinned to a specific version. ```bash npx skills add https://github.com/namehash/ensnode/tree/v${snapshot.sdkVersion}/packages/ensskills/skills --skill '*' ``` -------------------------------- ### cURL Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/integration-options/omnigraph-graphql-api.mdx A practical example demonstrating how to query the ENS Omnigraph API using `curl`. This showcases a simple query to retrieve domain information. ```APIDOC ## cURL Example ### Description This example shows how to make a POST request to the ENS Omnigraph API using `curl` to fetch domain details. ### Method POST ### Endpoint `https://api.v2-sepolia.ensnode.io/api/omnigraph` ### Request Body ```json { "query": "{ domain(by: { name: \"eth\" }) { canonical { name { beautified } } owner { address } } }" } ``` ### Request Example ```sh curl -sS -X POST \ -H 'Content-Type: application/json' \ -d '{"query":"{ domain(by: { name: \"eth\" }) { canonical { name { beautified } } owner { address } } }"}' \ https://api.v2-sepolia.ensnode.io/api/omnigraph ``` ``` -------------------------------- ### Install Snapshot Release Version (NPM & Docker) Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/releases.mdx Install snapshot releases using the '@next' tag for NPM packages or Docker images. Remember to run 'docker pull' to ensure you have the latest image, as the 'next' tag is a floating pointer. ```bash npm install @ensnode/[package-name]@next docker run ghcr.io/namehash/ensnode/[app-name]:next ``` -------------------------------- ### Example Label Set Version Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/glossary.mdx Shows valid non-negative integer versions for a label set. ```text 0, 1, 2 ``` -------------------------------- ### Install Preview Release Version (NPM & Docker) Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/releases.mdx Install preview releases by specifying the preview branch name as the version tag for NPM packages or Docker images. These are intended for testing features on a PR branch and should generally be avoided unless actively contributing. ```bash npm install @ensnode/[package-name]@[preview-branch-name] docker run ghcr.io/namehash/ensnode/[app-name]:[preview-branch-name] ``` -------------------------------- ### Run ENSAdmin Service Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/index.mdx Start the ENSAdmin service in development mode from the monorepo root or its specific directory. ```bash # from monorepo root pnpm run -F ensadmin dev # or from apps/ensadmin pnpm run dev ``` -------------------------------- ### Run ENSApi Service Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/index.mdx Start the ENSApi service in development mode from the monorepo root or its specific directory. ```bash # from monorepo root pnpm run -F ensapi dev # or from apps/ensapi pnpm run dev ``` -------------------------------- ### Install ENS Skills with npx skills Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/integration-options/ensskills.mdx Install ensskills directly from its GitHub repository using the 'skills' tool, suitable for projects not using Node.js package managers. Ensure you point to the correct release tag for version stability. ```bash # install ensskills npx skills add https://github.com/namehash/ensnode/tree/v${snapshot.sdkVersion}/packages/ensskills/skills --skill '*' ``` -------------------------------- ### Environment Variable Configuration Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensapi/usage/configuration.mdx This snippet shows the default environment variables for ENSApi configuration. Copy this to `.env.local` and adjust values as needed. ```bash NODE_ENV=development # Database configuration DATABASE_URL="postgresql://user:password@host:port/database" # ENS API configuration ENSAPI_RPC_URL="https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID" ENSAPI_REGISTRY_ADDRESS="0x00000000000C2E074eB183412439230172578700" ENSAPI_NAMEWRAPPER_ADDRESS="0x0000000000000000000000000000000000000000" # Cache configuration CACHE_TTL_SECONDS=3600 # Rate limiting configuration RATE_LIMIT_WINDOW_MS=60000 RATE_LIMIT_MAX_REQUESTS=100 # Logging configuration LOG_LEVEL=info # JWT configuration JWT_SECRET="your-super-secret-jwt-key" # IPFS configuration IPFS_GATEWAY="https://ipfs.io" ``` -------------------------------- ### Install Snapshot Release (Docker) Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/releases.mdx Use this command to pull snapshot release Docker images. These images are published under the `@next` tag. ```bash docker run ghcr.io/namehash/ensnode/[app-name]:next ``` -------------------------------- ### Run ENSIndexer Service Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/index.mdx Start the ENSIndexer service in development mode from the monorepo root or its specific directory. ```bash # from monorepo root pnpm run -F ensindexer dev # or from apps/ensindexer pnpm run dev ``` -------------------------------- ### ENSIndexer Environment Configuration Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensindexer/usage/configuration.mdx This snippet shows the default environment variables for configuring ENSIndexer. Copy this to .env.local and set your specific values. ```bash APP_ENV=production NODE_ENV=production # ENSIndexer INDEXER_RPC_URL=https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID INDEXER_RPC_WSS_URL=wss://mainnet.infura.io/ws/v3/YOUR_INFURA_PROJECT_ID # ENSRainbow ENSRAINBOW_URL=https://api.ensrainbow.io # Database DATABASE_URL=postgresql://user:password@host:port/database # Cache CACHE_URL=redis://localhost:6379 # Logging LOG_LEVEL=info # Optional: For local development, set to "development" # APP_ENV=development # NODE_ENV=development # Optional: For local development, use a local RPC endpoint # INDEXER_RPC_URL=http://localhost:8545 # INDEXER_RPC_WSS_URL=ws://localhost:8545 # Optional: For local development, use a local ENSRainbow instance # ENSRAINBOW_URL=http://localhost:3000 # Optional: For local development, use a local database # DATABASE_URL=postgresql://user:password@localhost:5432/database # Optional: For local development, use a local cache # CACHE_URL=redis://localhost:6379 ``` -------------------------------- ### Run ENSApi Locally Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensapi/contributing/index.mdx Start the ENSApi service for local development. You can run this command from the monorepo root or directly from the 'apps/ensapi' directory. ```bash # from monorepo root pnpm run -F ensapi dev ``` ```bash # from apps/ensapi pnpm run dev ``` -------------------------------- ### Fetch Domain Events by Canonical Name Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/unigraph/examples/domain-events.mdx Fetches recent events for a domain by its canonical name. This example joins the `events`, `domain_events`, and `domains` tables. See Connect for setup. ```sql SELECT e.id, e.block_number, e.log_index, e.data, e.topics, e.selector, de.domain_id, d.name FROM events AS e JOIN domain_events AS de ON e.id = de.event_id JOIN domains AS d ON de.domain_id = d.id WHERE d.name = 'vitalik.eth' ORDER BY e.block_number DESC, e.log_index DESC LIMIT 10; ``` -------------------------------- ### Configure ENSApi Environment Variables Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensapi/contributing/index.mdx Navigate to the ENSApi directory and copy the example environment file to create a local configuration. Ensure the file is placed correctly within the 'apps/ensapi' directory. ```bash cd apps/ensapi cp .env.local.example .env.local ``` -------------------------------- ### Workflow 2: Create Test Environment Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/creating-files.mdx Sets up a test environment by converting test data, ingesting it, and starting the API server with the test data. ```bash # 1. Convert test data pnpm run convert \ --input-file test/fixtures/ens_test_env_names.csv \ --output-file ens-test-env_0.ensrainbow \ --label-set-id ens-test-env # 2. Ingest test data pnpm run ingest-ensrainbow \ --input-file ens-test-env_0.ensrainbow \ --data-dir data-test-env # 3. Run with test data pnpm run serve --data-dir data-test-env --port 3223 ``` -------------------------------- ### Example Label Set Identifier Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/glossary.mdx Provides examples of valid identifiers for a label set. ```text subgraph, discovery-a, searchlight ``` -------------------------------- ### Download, Extract, and Serve Prebuilt Database Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/creating-files.mdx This option demonstrates downloading a prebuilt database archive, extracting it, and starting the ENSRainbow server. Requires ENSRAINBOW_LABELSET_SERVER_URL to be set. ```bash # Configure your label set server export ENSRAINBOW_LABELSET_SERVER_URL="https://my-label-set-server.com" # Download prebuilt database ./scripts/download-prebuilt-database.sh 3 my-dataset 0 # Extract database tar -xzf databases/3/my-dataset_0.tgz -C data-my-dataset --strip-components=1 # Start ENSRainbow server pnpm run serve --data-dir data-my-dataset --port 3223 ``` -------------------------------- ### Install ENSDb SDK (Bash) Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/unigraph/examples/index.mdx Install the @ensnode/ensdb-sdk package using npm. This is the first step to using the SDK in your TypeScript project. ```bash npm install @ensnode/ensdb-sdk ``` -------------------------------- ### Download Prebuilt Database Archives with Script Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/creating-files.mdx Use this script to download prebuilt database archives from a configured label set server. Ensure ENSRAINBOW_LABELSET_SERVER_URL is set. ```bash # Configure your label set server URL export ENSRAINBOW_LABELSET_SERVER_URL="https://my-label-set-server.com" # Download prebuilt database using the existing script ./scripts/download-prebuilt-database.sh 3 my-dataset 0 ``` -------------------------------- ### Launch HTTP API Server Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/contributing/cli-reference.mdx The `serve` command launches the HTTP API server. Specify the data directory and the port to listen on. ```bash pnpm run serve --port 3223 ``` -------------------------------- ### Get Command Help Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/contributing/cli-reference.mdx Append `--help` to any ENSRainbow CLI command to get detailed usage information and available flags. ```bash pnpm run serve --help ``` -------------------------------- ### Initialize Terraform Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/self-host/terraform.mdx Run this command to download the necessary Terraform providers and modules for your configuration. ```bash terraform init ``` -------------------------------- ### Preview Production Build Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensadmin/contributing/index.mdx Builds an optimized static export of the application and serves it locally for preview. The production preview also runs on http://localhost:4173. ```bash pnpm build pnpm start ``` -------------------------------- ### Start the API server Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/contributing/local-development.mdx Start the ENSRainbow API server locally to serve the ingested data. The server can be accessed at http://localhost:3223/health to verify its status. ```bash pnpm run serve --data-dir ./my-subgraph-data --port 3223 ``` -------------------------------- ### Ingest .ensrainbow File and Serve ENSRainbow Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/creating-files.mdx This option demonstrates downloading an .ensrainbow file, ingesting it into ENSRainbow, and starting the ENSRainbow server. Requires ENSRAINBOW_LABELSET_SERVER_URL to be set. ```bash # Configure your label set server export ENSRAINBOW_LABELSET_SERVER_URL="https://my-label-set-server.com" # Download .ensrainbow file ./scripts/download-ensrainbow-files.sh my-dataset 0 # Ingest into ENSRainbow pnpm run ingest-ensrainbow \ --input-file labelsets/my-dataset_0.ensrainbow \ --data-dir data-my-dataset # Start ENSRainbow server pnpm run serve --data-dir data-my-dataset --port 3223 ``` -------------------------------- ### Install enssdk and Development Dependencies Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/index.mdx Install the enssdk package along with tsx for running TypeScript and its type definitions. Pinning exact versions is crucial for type safety. ```sh npm install enssdk@${snapshot.sdkVersion} npm install -D tsx typescript @types/node ``` -------------------------------- ### Label Set File Naming Convention Examples Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/label-sets-and-versioning.mdx Illustrates the file naming convention for label sets, showing how the labelSetId and version number are combined. ```text subgraph_0.ensrainbow # labelSetId = "subgraph", version = 0 subgraph_1.ensrainbow # next version with incremental labelhash-to-label mappings added discovery-a_0.ensrainbow # different dataset, initial version ``` -------------------------------- ### Readiness Check Endpoint Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/usage/api.mdx Use the /ready endpoint for readiness probes to check if the database has been downloaded, validated, and opened. Returns OK when ready, or a 503 error if still bootstrapping. ```bash curl https://api.ensrainbow.io/ready ``` -------------------------------- ### ENSNode Configuration Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/self-host/terraform.mdx This snippet shows the environment variables required for configuring ENSNode, ENSRainbow, and Render. Ensure you replace placeholder values with your actual credentials and URLs. ```bash # ENSNode configuration ensnode_version = "0.0.0" # pin to the specific version you want to use as found at https://github.com/namehash/ensnode/releases ensrainbow_searchlight_label_set_version = "1" # pin to the specific version, see https://ensnode.io/ensrainbow/concepts/glossary#label_set_version ``` ```bash anthropic_api_key = "your_anthropic_api_key" # Render configuration render_api_key = "your_render_api_key" render_owner_id = "your_render_owner_id" render_environment = "your_render_environment" # Mainnet RPC URLs hereum_mainnet_rpc_url = "your_ethereum_mainnet_rpc_url" base_mainnet_rpc_url = "your_base_mainnet_rpc_url" linea_mainnet_rpc_url = "your_linea_mainnet_rpc_url" arbitrum_mainnet_rpc_url = "your_arbitrum_mainnet_rpc_url" scroll_mainnet_rpc_url = "your_scroll_mainnet_rpc_url" # Sepolia RPC URLs hereum_sepolia_rpc_url = "your_ethereum_sepolia_rpc_url" base_sepolia_rpc_url = "your_base_sepolia_rpc_url" linea_sepolia_rpc_url = "your_linea_sepolia_rpc_url" optimism_sepolia_rpc_url = "your_optimism_sepolia_rpc_url" arbitrum_sepolia_rpc_url = "your_arbitrum_sepolia_rpc_url" scroll_sepolia_rpc_url = "your_scroll_sepolia_rpc_url" ``` -------------------------------- ### Configure skills-npm for Targeted Installs Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/integration-options/ensskills.mdx Create a skills-npm.config.ts file to scope the skill installation to specific agents or packages. This is useful for projects with multiple skill sources or when targeting only certain AI agents. ```ts // skills-npm.config.ts import { defineConfig } from "skills-npm"; export default defineConfig({ // Target specific agents by key (e.g. "claude-code", "cursor", "codex"). // Omit to auto-detect every agent you have installed. agents: ["claude-code"], // Pull skills only from the ensskills package, ignoring any others. include: ["ensskills"], // Skip the confirmation prompt so the prepare script runs unattended. yes: true, }); ``` -------------------------------- ### Configure and Run ENSNode with Docker Compose (Mainnet/Sepolia) Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/index.mdx Configure the local environment for mainnet/sepolia and start the ENSNode suite using Docker Compose. ```bash cp docker/envs/.env.docker.example docker/envs/.env.docker.local docker compose -f docker/docker-compose.yml up -d ``` -------------------------------- ### ENSRainbow Docker Environment Variable Examples Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/contributing/index.mdx Examples of environment variable combinations for selecting ENSRainbow database archives. These variables control the schema version, label set ID, and label set version. ```bash # Latest production data DB_SCHEMA_VERSION=3 LABEL_SET_ID=subgraph LABEL_SET_VERSION=0 # The ens-test-env data DB_SCHEMA_VERSION=3 LABEL_SET_ID=ens-test-env LABEL_SET_VERSION=0 ``` -------------------------------- ### Stamp Snapshot Labs ENS Resolution Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/ens-subgraph/key-limitations.mdx This example shows how Stamp, by Snapshot Labs, resolves ENS names directly against the Subgraph, which can lead to incorrect results as it does not follow the ENS Forward Resolution protocol. ```typescript resolveAddress( address: Address, name: string ): Promise { const query = ` query ($name: String!) { domains(where: { name: $name }) { resolvedAddress { id } } } `; const variables = { name }; const response = await fetch(SUBGRAPH_URL, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ query, variables }), }); const data = await response.json(); return data.data.domains[0]?.resolvedAddress?.id ?? null; } ``` -------------------------------- ### Initialize TypeScript Project Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/integrate/integration-options/omnigraph-graphql-api.mdx Scaffold a new directory for a TypeScript project, initialize npm, create a src directory, and install necessary development dependencies for running TypeScript with tsx. ```sh mkdir my-ens-script && cd my-ens-script npm init -y mkdir src npm install -D tsx typescript @types/node ``` -------------------------------- ### Ingest Command Example Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/glossary.mdx Command to ingest a .ensrainbow snapshot into LevelDB. ```bash pnpm run ingest subgraph_0.ensrainbow ``` -------------------------------- ### Example Labelhash Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/glossary.mdx Shows the expected format of a labelhash, which is a keccak256 hash. ```text 0xaf2caa…03cc ``` -------------------------------- ### Install Pinned Full Release Version (NPM & Docker) Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/reference/contributing/releases.mdx Use these commands to install a specific pinned full release version for NPM packages or run Docker images. Pinning exact versions is crucial for production stability as ENSNode patch versions may include breaking changes. ```bash npm install @ensnode/[package-name]@[version] docker run ghcr.io/namehash/ensnode/[app-name]:[version] ``` -------------------------------- ### Run Mainnet/Sepolia Docker Compose Stack Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/self-host/docker.mdx Start the main ENSNode services for mainnet or Sepolia using the base Docker Compose file. Ensure your environment variables are configured in `.env.docker.local`. ```bash docker compose -f docker/docker-compose.yml up -d ``` -------------------------------- ### Example Healable Count Source: https://github.com/namehash/ensnode/blob/main/docs/ensnode.io/src/content/docs/docs/services/ensrainbow/concepts/glossary.mdx Illustrates the format for the total number of healable labels. ```text 7 892 001 ```