The Airswap implementation of Geth clustering in a CloudFormation script
Want to give it a try?
Installing Geth is easy. Running Geth at scale can be a headache. Setting up the infrastructure and code required to manage Geth in an automated way requires time and effort. We've made that a single click with a CloudFormation template. Check out the great features:
- TLS capable with optional SSL Certificate
- Locked down security groups to only allow traffic on ports 80 or 443
- Load balanced Geth nodes
- Automatic rotation of unhealthy nodes
- Automatic health checking for syncing state
- Custom VPC and subnet compatible
- Bring your own Infura API keys
- Proven instance types that will run Geth in production
- Hardened Geth node for mass RPC queries
- AWS best practices for infrastructure and security
- Built by an AWS Solution Architect Professional!
The setup for the Geth cluster is very simple. First, click here to launch the stack or use the hosted template here: https://s3.amazonaws.com/opensource.airswap.io/geth/cloudformation.yml
Specify the settings
The ARN string for the SSL certificate you want on the load balancer. This is useful if you plan to run the cluster in production, as you will be able to access the load balancer via HTTPS.
This field is optional.
If you specify this field, port 80 access is automatically disabled for security. You will need to create a Route 53 record pointing to the load balancer with the correct DNS name.
Infura API Key
An optional API key can be provided for Infura. This might result in less rate limiting and better quality of service with Infura when querying their nodes.
Select your instance type. We have found that the
c5d families of instances work the best. As such, we have limited the options we present by default to these families. We have also eliminated instance sizes that we know do not have enough power to maintain a sync.
If you plan to run this cluster for production, choose at least a
xlarge sized instance to handle traffic appropriately. We have found that instances below this size have trouble both syncing and serving requests to the JSON RPC endpoints.
Specify the SSH key to be used for the EC2 instances. This should be a private key that you have access to in order to log in and debug any issues that may occur.
This is the IP CIDR block that should be allowed SSH access. By default, we set it to world accessible. Please do not set production systems to world accessible!
This is a list of the subnets in your VPC where the EC2 instance should be launched. These should be in the same VPC as the VPC selected in the next parameter.
The ID of the VPC in which to launch the Geth Cluster. This is customizable for advanced users.
If you want to run this cluster in production, we recommend a few improvements prior to subjecting the cluster to production traffic for best performance and security.
- Limit the CORS domains in the Geth configuration
- Evaluate how many Geth nodes you need - the template has a max of 4 and you may need more
Just click the button below to get started: