Deploying ENSNode with Terraform
This guide will help you deploy ENSNode using Terraform to Render. The Terraform configuration provides a complete infrastructure setup including database, ENSIndexer, ENSRainbow, and other required services.
These Terraform scripts are currently specific to ENSNode instances hosted by NameHash Labs. While these scripts provide a good starting point for deploying your own ENSNode instance, you will need to make modifications to suit your specific deployment needs. We plan to generalize these scripts in the future to better support community deployments.
Prerequisites
Section titled “Prerequisites”- Terraform installed
- Render account
- Render API token (generate from https://render.com/docs/api#1-create-an-api-key)
- RPC URLs for the chains you want to support (Mainnet, Sepolia, Base, Linea)
- AWS account (for DNS management)
- AWS S3 bucket defined inside AWS account -
ensnode-terraform(for Terraform state)
ENSIndexer runs CREATE EXTENSION IF NOT EXISTS pg_trgm at startup to back partial-name search indexes. Render’s managed Postgres has pg_trgm available by default; if you adapt this configuration to a different provider, confirm the extension is available for installation on your Postgres plan.
Configuration
Section titled “Configuration”Copy .env.sample to .env.local and fill in your configuration values:
# ENSNode configurationensnode_version = "0.0.0" # pin to the specific version you want to use as found at https://github.com/namehash/ensnode/releasesensrainbow_searchlight_label_set_version = "1" # pin to the specific version, see https://ensnode.io/ensrainbow/concepts/glossary#label_set_versionanthropic_api_key = "your_anthropic_api_key"
# Render configurationrender_api_key = "your_render_api_key"render_owner_id = "your_render_owner_id"render_environment = "your_render_environment"
# Mainnet RPC URLsethereum_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 URLsethereum_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"Infrastructure Components
Section titled “Infrastructure Components”The Terraform configuration sets up the following components:
- Render
- Render project and environment
- PostgreSQL database
- ENSIndexer services
- ENSRainbow service
- AWS
- DNS configuration
Deployment Steps
Section titled “Deployment Steps”- Initialize Terraform:
terraform init- Review the planned changes:
terraform plan- Apply the configuration:
terraform applyCleanup
Section titled “Cleanup”To destroy the infrastructure:
terraform destroy