{"id":27334940,"url":"https://github.com/dmuth/ethereum-on-aws","last_synced_at":"2026-03-01T14:32:44.450Z","repository":{"id":138470357,"uuid":"99504060","full_name":"dmuth/ethereum-on-aws","owner":"dmuth","description":"Terraform and Ansible files set up an Ethereum server on Amazon Web Services","archived":false,"fork":false,"pushed_at":"2020-09-03T22:21:33.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T14:51:28.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmuth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-08-06T17:58:19.000Z","updated_at":"2019-02-27T03:04:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"5521b066-34ae-447d-8258-068c87d919c4","html_url":"https://github.com/dmuth/ethereum-on-aws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmuth/ethereum-on-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fethereum-on-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fethereum-on-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fethereum-on-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fethereum-on-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmuth","download_url":"https://codeload.github.com/dmuth/ethereum-on-aws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fethereum-on-aws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29970988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T14:11:48.712Z","status":"ssl_error","status_checked_at":"2026-03-01T14:11:48.352Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-12T14:46:41.228Z","updated_at":"2026-03-01T14:32:44.409Z","avatar_url":"https://github.com/dmuth.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethereum On AWS\n\nThis repo contains Terraform and Ansible files to set up an AWS EC2 instance to run Ethereum's \u003ca href=\"https://github.com/ethereum/go-ethereum/wiki/geth\"\u003eGeth client\u003c/a\u003e.  \nThis was a proof of concept that I did to see if such a thing was really possible.  Sad news: \nit's non-trivial to pull off, because with 4.1 million Ethereum blocks as of this writing, it takes many \nmany hours for the node to sync up with the full block chain. \u003ca href=\"#note1\"\u003e[1]\u003c/a\u003e\u003ca name=\"back1\"\u003e\u003c/a\u003e  \n\nThat said, I still wanted to publish this so that others may perhaps benefit from it.\n\n\n## Prerequisites\n\n- An Amazon Web Services account\n- The \u003ca href=\"https://aws.amazon.com/cli/\"\u003eAWS CLI Tool\u003c/a\u003e set up and configured with keys. (the tool is not used for this project, but Terraform will look for those keys)\n- A DNS zone hosted in AWS Route 53\n- \u003ca href=\"https://www.terraform.io/\"\u003eTerraform\u003c/a\u003e installed on your machine\n- \u003ca href=\"https://www.ansible.com/\"\u003eAnsible\u003c/a\u003e installed on your machine\n\n\n## Configuration\n\n- Clone this repo\n- Create a VPC by hand in your AWS account and note the ID\n- Edit the file `terraform/variables-local.tf` and add in the following\n   - Your VPC ID\n   - Your EC2 SSH key ID\n   - A name for an S3 bucket to create\n   - A name for an S3 bucket where Cloudtrail will store logs (you log all of your S3 accesses, right?  Right??)\n   - A logging prefix in the S3 bucket where Cloudtrail stores logs, unique to this bucket\n   - Your DNS Zone ID\n   - The DNS hostname to create\n-  Edit the file `ansible/inventory` and change `eth1.dmuth.org` to the name of the hostname you will create.\n\n\n## Usage\n\n- Initialize Terraform: \n   - `cd terraform`\n   - `terraform init`\n- Make sure Terraform will do what you want, with no complaints or errors: `terraform plan`\n- Build your server: `terraform apply`\n   - This will build an m2.large server, which has 2 cores and 8 GB of RAM, and will cost 9.4 cents per hour.\n- Run Ansible to install Python on that server and then install Geth and configure that server:\n   - `cd ansible`\n   - `ansible-playbook -i ./inventory ./1-install-python.yml`\n   - `ansible-playbook -i ./inventory ./2-ethereum.yml`\n\nYou can now SSH into the server.  I recommend starting up `tmux` and then running Geth as follows: \n\n`geth --rpc --fast -cache=2048 --maxpeers=500`\n\nTo monitor the status of Geth while it is running, I recommend this command:\n\n`while true; do  echo \"eth.syncing\" | geth attach; echo \"admin.peers.length\" | geth attach; sleep 30; done  | ts | tee output.txt`\n\n\n## Saving Progress to S3\n\nPart of the Terraform setup applies a role to the EC2 instance which will grant access to the S3 bucket \nwhich was created by Terraform.  If you want to save your progress with Geth between sessions, that \ncan be done by using `aws s3 sync` to copy up the files and then copy them down after standing up a new machine.\n\n\n## Monitoring Resource Usage\n\nThe Ansible playbook installs \u003ca href=\"http://munin-monitoring.org/\"\u003eMunin\u003c/a\u003e on the server, and you \ncan pull up the graphs by going to `http://hostname/munin/`.  This is useful to watch CPU usage, RAM usage,\nand especially Swapfile usage.  If you notice the swapfile getting hammered, it probably means you need\nmore RAM. (took me several m2.small and m2.medium instances to figure THAT one out!)\n\n\n### Actual Resource Graphs\n\nHere are some actual resource graphs from running Geth on a m2.large instance:\n\nThe I/O Wait on our CPUs are increasing, which means we probably don't have enough RAM:\n\u003cimg src=\"img/cpu.png\"/\u003e\n\nThere is substantial network usage once the node starts acting like a peer and sending traffic out.\nThis is worth noting, as AWS charges 9 cents per GB out as of this writing:\n\u003cimg src=\"img/network.png\"/\u003e\n\nRAM usage has actually gone down a bit, which I can't fully explain...\n\u003cimg src=\"img/ram.png\"/\u003e\n\nSwap isn't hit all that much, which is also a good sign:\n\u003cimg src=\"img/swap.png\"/\u003e\n\nBased on the above graphs, I would say that the I/O Wait is not due to excessive swap, but due to cache misses\neither in Geth or in the system cache itself.  Running Geth with a larger `--cache` setting may help, possibly\nat the expense of requiring an instance with more RAM.\n\n\n## Finishing Up\n\n- Run `terraform destroy` and then type `yes` to remove your EC2 instance, DNS name, and S3 bucket.\n   - If you want to keep the S3 bucket, comment out the lines in that file first!\n\n\n## So What Comes Next?\n\nUltimately, I was not sucessful at getting a fully functioning Ethereum node on my machine--at least\nnot to my satisfaction, as I was hoping to be able to send/receive from money and write some\n\u003ca href=\"https://solidity.readthedocs.io/\"\u003eSolidity code\u003c/a\u003e.\n\nMy next step will be to try \u003ca href=\"https://parity.io/\"\u003ethe lightweight Parity client\u003c/a\u003e and see \nif I have more luck with it.  Watch my GitHub repo and/or \u003ca href=\"http://www.dmuth.org/\"\u003emy blog\u003c/a\u003e \nfor more news on that front. :-)\n\n\n\n## Footnotes\n\n\u003ca name=\"note1\"\u003e\u003c/a\u003e[1] \u003ca href=\"#back1\"\u003e^\u003c/a\u003e But hey, I'm new to Ethereum, and maybe I did something wrong.  If that's the case, feel\nfree to open an issue on this project and let me know! \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fethereum-on-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmuth%2Fethereum-on-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fethereum-on-aws/lists"}