This repository contains Infrastructure as Code (IaC) templates and instructions for deploying blockchain nodes on AWS infrastructure. The templates support multiple blockchain networks and can be easily extended to support additional chains.
Currently supported blockchain networks:
- Ethereum (Execution + Consensus clients)
- Polkadot
- Enjin Relaychain
Before you begin, ensure you have:
- AWS Account with appropriate permissions
- AWS CLI installed and configured
- SSH key pair for EC2 access
- Terraform installed (>= 1.2.0)
Configure your AWS credentials using one of these methods:
-
Environment variables:
export AWS_ACCESS_KEY_ID=your-access-key export AWS_SECRET_ACCESS_KEY=your-secret-access-key export AWS_REGION=your-preferred-region
-
Or using AWS CLI:
aws configure
- Ethereum: Recommended 2TB+
- Polkadot: Recommended 1.5TB+
- Enjin Relaychain: Recommended 300GB+
To modify the storage size, uncomment and adjust the ebs_volume_size
variable in the respective chain's .tfvars
file.
-
Generate an SSH key pair if you don't have one:
ssh-keygen -t rsa -b 4096
-
Copy your public key content:
cat ~/.ssh/id_rsa.pub
-
Note it for later update the
developer_public_key
variable in your chosen chain's.tfvars
file:developer_public_key = "ssh-rsa AAAA... [email protected]"
- Identify your development IP address
- Note it for later update the
developer_ip_for_ssh
variable in the chain-specific.tfvars
file
-
Clone this repository:
git clone https://github.com/yourusername/blockchain-node-aws.git cd blockchain-node-aws
-
Initialize Terraform:
terraform init
-
Choose your blockchain network and update the corresponding
.tfvars
file in thechains/
directory:- Update the
developer_public_key
with your SSH public key - Update the
developer_ip_for_ssh
with your IP address - Adjust the
ebs_volume_size
if needed
- Update the
-
Deploy the infrastructure:
terraform plan -var-file="chains/[chain-name].tfvars" -out=[chain-name].tfplan terraform apply [chain-name].tfplan
⚠️ Cost Warning: Deploying this infrastructure will incur costs in your AWS account. -
To destroy the infrastructure when no longer needed:
terraform destroy -var-file="chains/[chain-name].tfvars" -auto-approve
⚠️ Warning: This will permanently delete all resources and data. Make sure to backup any important blockchain data before destroying.
The infrastructure utilizes several AWS services:
-
VPC: Isolated network environment
- Custom VPC with public subnets
- Internet Gateway for public access
-
EC2: Compute instances
- Amazon Linux 2 with ECS optimization
- Auto-configured with user data script
- EBS volumes for blockchain data
-
ECS: Container orchestration
- ECS Cluster for container management
- Task definitions for blockchain node
-
CloudWatch: Monitoring and logging
- Container logs
- Metrics collection
-
Security Groups: Network access control
- SSH access from specified IP
- Blockchain-specific port access
- Outbound internet access
Contributions welcome! Please feel free to:
- Add support for new blockchain networks
- Improve existing configurations
- Update documentation
- Fix bugs
Please submit pull requests with clear descriptions of changes and updates to documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check existing issues
- Create a new issue with detailed information
- Join our community discussions
- Medium Article - Detailed setup guide and architecture explanation
- LinkedIn Post - Project announcement and community updates