Skip to content

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.

  • 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, Holesky, Base, Linea)
  • AWS account (for DNS management)
  • AWS S3 bucket defined inside AWS account - ensnode-terraform (for Terraform state)

Copy .env.sample to .env.local and fill in your configuration values:

Terminal window
# ENSNode configuration
ensnode_version = "latest" # or specific version
ensindexer_label_set_id = "ensindexer_label_set_id"
ensindexer_label_set_version = "ensindexer_label_set_version"
ensrainbow_label_set_id = "ensrainbow_label_set_id"
ensrainbow_label_set_version = "ensrainbow_label_set_version"
# Render configuration
render_api_key = "your_render_api_key"
render_owner_id = "your_render_owner_id"
render_environment = "your_render_environment"
# Mainnet RPC URLs
ethereum_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
ethereum_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"
# Holesky RPC URLs
ethereum_holesky_rpc_url = "your_ethereum_holesky_rpc_url"

The Terraform configuration sets up the following components:

  • Render
    • Render project and environment
    • PostgreSQL database
    • ENSIndexer services
    • ENSRainbow service
  • AWS
    • DNS configuration
  1. Initialize Terraform:
Terminal window
terraform init
  1. Review the planned changes:
Terminal window
terraform plan
  1. Apply the configuration:
Terminal window
terraform apply

To destroy the infrastructure:

Terminal window
terraform destroy