Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/beige-pugs-win.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ensindexer": minor
"ensrainbow": minor
---

Terraform Render environment
40 changes: 26 additions & 14 deletions .github/workflows/deploy_ensnode.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Deploy: ENSNode to Railway Environment"
name: "Deploy: ENSNode to Railway and Render Environments"

on:
workflow_dispatch:
Expand Down Expand Up @@ -37,14 +37,28 @@ jobs:
# Terraform keeps it's state inside S3 bucket. This bucket needs to be created before running Terraform apply.
# AWS_REGION should be the same as Terraform S3 bucket state region.
AWS_REGION: us-east-1
TF_VAR_railway_token: ${{ secrets.RAILWAY_TOKEN }}
TF_VAR_mainnet_rpc_url: ${{ secrets.MAINNET_RPC_URL }}
TF_VAR_sepolia_rpc_url: ${{ secrets.SEPOLIA_RPC_URL }}
TF_VAR_holesky_rpc_url: ${{ secrets.HOLESKY_RPC_URL }}
TF_VAR_base_rpc_url: ${{ secrets.BASE_RPC_URL }}
TF_VAR_linea_rpc_url: ${{ secrets.LINEA_RPC_URL }}
TF_VAR_optimism_rpc_url: ${{ secrets.OPTIMISM_RPC_URL }}
TF_VAR_ensnode_version: ${{ inputs.tag }}
# For now only one Terraform environment is active. In future this will be calculated based on workflow input.
TF_VAR_render_environment: "yellow"
TF_VAR_render_api_key: ${{ secrets.RENDER_API_KEY }}
TF_VAR_render_owner_id: ${{ secrets.RENDER_OWNER_ID }}
# RPC URLs
# Mainnet
TF_VAR_etherum_mainnet_rpc_url: ${{ secrets.ETH_MAINNET_RPC_URL }}
TF_VAR_base_mainnet_rpc_url: ${{ secrets.BASE_MAINNET_RPC_URL }}
TF_VAR_linea_mainnet_rpc_url: ${{ secrets.LINEA_MAINNET_RPC_URL }}
TF_VAR_optimism_mainnet_rpc_url: ${{ secrets.OPTIMISM_MAINNET_RPC_URL }}
TF_VAR_arbitrum_mainnet_rpc_url: ${{ secrets.ARBITRUM_MAINNET_RPC_URL }}
TF_VAR_scroll_mainnet_rpc_url: ${{ secrets.SCROLL_MAINNET_RPC_URL }}
# Sepolia
TF_VAR_etherum_sepolia_rpc_url: ${{ secrets.ETH_SEPOLIA_RPC_URL }}
TF_VAR_base_sepolia_rpc_url: ${{ secrets.BASE_SEPOLIA_RPC_URL }}
TF_VAR_linea_sepolia_rpc_url: ${{ secrets.LINEA_SEPOLIA_RPC_URL }}
TF_VAR_optimism_sepolia_rpc_url: ${{ secrets.OPTIMISM_SEPOLIA_RPC_URL }}
TF_VAR_arbitrum_sepolia_rpc_url: ${{ secrets.ARBITRUM_SEPOLIA_RPC_URL }}
TF_VAR_scroll_sepolia_rpc_url: ${{ secrets.SCROLL_SEPOLIA_RPC_URL }}
# Holesky
TF_VAR_etherum_holesky_rpc_url: ${{ secrets.ETH_HOLESKY_RPC_URL }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -213,12 +227,6 @@ jobs:
#ENSRAINBOW
redeploy_service ${RAILWAY_ENVIRONMENT_ID} ${ENSRAINBOW_SVC_ID}

# Terraform deploy - apply Terraform template everytime new deployment is introduced to either green or blue environment
- name: Set full permissions to execute scripts (read / write / execute)
working-directory: terraform
run: |
chmod 777 ./healthcheck.sh

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
Expand All @@ -234,6 +242,10 @@ jobs:
run: terraform init
working-directory: terraform

- name: Terraform Init
run: terraform workspace select ${{env.TF_VAR_render_environment}}
working-directory: terraform

- name: Terraform Validate
run: terraform validate
working-directory: terraform
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
- name: Run TypeScript type checks
run: pnpm -r typecheck

- name: Check Terraform format
run: terraform fmt -recursive -check -diff

- name: Build packages
if: needs.changed-packages.outputs.packages == 'true'
run: pnpm packages:prepublish
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
ports:
- "42069:42069"
environment:
# Start ensindexer instance in "serve" mode. This environment variable is intercepted by the ensindexer Docker image to modify the ensindexer start command. This special strategy for dynamically configuring the ensindexer start command is used due to limitations with Railway Terraform.
# Start ensindexer instance in "serve" mode. This environment variable is intercepted by the ensindexer Docker image to modify the ensindexer start command.
PONDER_COMMAND: serve
# Same DATABASE_URL as ensindexer instance
DATABASE_URL: postgresql://postgres:password@postgres:5432/postgres
Expand Down
8 changes: 4 additions & 4 deletions docs/ensnode.io/src/content/docs/docs/deploying/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Running your own ENSNode instance is helpful for those that wish to:
Note that because ENSNode makes many label healing requests to ENSRainbow while indexing, it's _imperative_ that they be on the same local network to minimize request time.
:::

### Deploying on Railway
### Deploying on Render

Railway is a convenient platform for hosting an ENSNode instance.
Render is a convenient platform for hosting an ENSNode instance.

<LinkCard title="Deploy on Railway" href="/docs/deploying/railway" />
<LinkCard title="Deploy on Render" href="/docs/deploying/render" />

### Deploying with Docker

Expand All @@ -36,6 +36,6 @@ The Docker deployment option provides the easiest way to run the full ENSNode su

### Deploying with Terraform

An example Terraform deployment reference is available, showing an example of deploying the full ENSNode suite on Railway with AWS managed domain names.
An example Terraform deployment reference is available, showing an example of deploying the full ENSNode suite on Render with AWS managed domain names.

<LinkCard title="Deploy with Terraform" href="/docs/deploying/terraform" />
17 changes: 0 additions & 17 deletions docs/ensnode.io/src/content/docs/docs/deploying/railway.mdx

This file was deleted.

47 changes: 34 additions & 13 deletions docs/ensnode.io/src/content/docs/docs/deploying/terraform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ sidebar:
order: 4
---

import { LinkCard } from '@astrojs/starlight/components';
import { LinkCard } from "@astrojs/starlight/components";

This guide will help you deploy ENSNode using Terraform to Railway. The Terraform configuration provides a complete infrastructure setup including database, ENSIndexer, ENSRainbow, and other required services.
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.

:::note[Important]
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.
Expand All @@ -22,8 +22,8 @@ These Terraform scripts are currently specific to ENSNode instances hosted by Na
## Prerequisites

- [Terraform](https://www.terraform.io/downloads.html) installed
- [Railway](https://railway.app/) account
- Railway API token (generate from https://railway.com/account/tokens)
- [Render](https://https://render.com/) 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)
Expand All @@ -33,21 +33,39 @@ These Terraform scripts are currently specific to ENSNode instances hosted by Na
Copy `.env.sample` to `.env.local` and fill in your configuration values:

```bash
railway_token = "your_railway_token"
mainnet_rpc_url = "your_mainnet_rpc_url"
sepolia_rpc_url = "your_sepolia_rpc_url"
holesky_rpc_url = "your_holesky_rpc_url"
base_rpc_url = "your_base_rpc_url"
linea_rpc_url = "your_linea_rpc_url"
ensnode_version = "latest" # or specific version
# ENSNode configuration
ensnode_version = "latest" # or specific version

# Render configuration
render_api_key = "your_railway_token"
render_owner_id = "your_render_onwer_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
etherum_sepolia_rpc_url = "your_etherum_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
etherum_holesky_rpc_url = "your_etherum_holesky_rpc_url"
```

## Infrastructure Components

The Terraform configuration sets up the following components:

- Railway
- Railway project and environment
- Render
- Render project and environment
- PostgreSQL database
- ENSIndexer services
- ENSRainbow service
Expand All @@ -57,16 +75,19 @@ The Terraform configuration sets up the following components:
## Deployment Steps

1. Initialize Terraform:

```bash
terraform init
```

2. Review the planned changes:

```bash
terraform plan
```

3. Apply the configuration:

```bash
terraform apply
```
Expand Down
2 changes: 1 addition & 1 deletion examples/example-docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
ports:
- "42069:42069"
environment:
# Start ensindexer instance in "serve" mode. This environment variable is intercepted by the ensindexer Docker image to modify the ensindexer start command. This special strategy for dynamically configuring the ensindexer start command is used due to limitations with Railway Terraform.
# Start ensindexer instance in "serve" mode. This environment variable is intercepted by the ensindexer Docker image to modify the ensindexer start command.
PONDER_COMMAND: serve
# Same DATABASE_URL as ensindexer instance
DATABASE_URL: postgresql://postgres:password@postgres:5432/postgres
Expand Down
27 changes: 20 additions & 7 deletions terraform/.env.sample
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
TF_VAR_railway_token=
TF_VAR_mainnet_rpc_url=
TF_VAR_sepolia_rpc_url=
TF_VAR_holesky_rpc_url=
TF_VAR_base_rpc_url=
TF_VAR_linea_rpc_url=
TF_VAR_optimism_rpc_url=
# Render
TF_VAR_render_api_key=
TF_VAR_render_owner_id=
TF_VAR_render_environment=
TF_VAR_ensnode_version=
# Mainnet
TF_VAR_ethereum_mainnet_rpc_url=
TF_VAR_base_mainnet_rpc_url=
TF_VAR_linea_mainnet_rpc_url=
TF_VAR_optimism_mainnet_rpc_url=
TF_VAR_arbitrum_mainnet_rpc_url=
TF_VAR_scroll_mainnet_rpc_url=
# Sepolia
TF_VAR_etherum_sepolia_rpc_url=
TF_VAR_base_sepolia_rpc_url=
TF_VAR_linea_sepolia_rpc_url=
TF_VAR_optimism_sepolia_rpc_url=
TF_VAR_arbitrum_sepolia_rpc_url=
TF_VAR_scroll_sepolia_rpc_url=
# Holesky
TF_VAR_etherum_holesky_rpc_url=
3 changes: 1 addition & 2 deletions terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ This Terraform configuration manages the infrastructure for ENSNode deployments.
- DNS configuration and management
- S3 bucket for Terraform state - `ensnode-terraform` (must be pre-existing with a predefined name)

### Railway Resources
### Render Resources
- Application deployment and hosting
- Service configuration
- Note: Railway volume size cannot be defined in Terraform and must be manually increased through the Railway UI after deployment

## Getting Started

Expand Down
38 changes: 0 additions & 38 deletions terraform/dns.tf

This file was deleted.

6 changes: 0 additions & 6 deletions terraform/ensrainbow.tf

This file was deleted.

68 changes: 0 additions & 68 deletions terraform/healthcheck.sh

This file was deleted.

Loading