https://github.com/tmigone/balena-ethereum-node
Run an ethereum node with one click!
https://github.com/tmigone/balena-ethereum-node
balena balenaos ethereum geth
Last synced: 5 months ago
JSON representation
Run an ethereum node with one click!
- Host: GitHub
- URL: https://github.com/tmigone/balena-ethereum-node
- Owner: tmigone
- Created: 2021-10-22T15:34:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-22T19:43:09.000Z (about 3 years ago)
- Last Synced: 2024-10-19T19:59:37.136Z (8 months ago)
- Topics: balena, balenaos, ethereum, geth
- Language: Shell
- Homepage:
- Size: 523 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ⟠ balena-ethereum-node ⟠
Run an ethereum node with one click! 🚀
This project makes deploying an ethereum node to a balenaOS device super simple. The bundle installs:
- Ethereum's go-client: [geth](https://geth.ethereum.org/)
- An [influxdb](https://www.influxdata.com/) database for storing metrics
- A [grafana](https://grafana.com/) dashboard for monitoring
## Supported architectures
The following device types and architectures are supported:
- Intel Nuc (amd64)
- Raspberry Pi 4 (aarch64) - WIP## Hardware requirements
Geth [requirements](https://docs.ethhub.io/using-ethereum/ethereum-clients/geth/) specify a minimum of 4GB of RAM and 320GB of SSD disk space available in order to properly sync your node to ethereum's mainnet. In practice, as of February 2022, 320GB is nowhere near enough to run a full node. The initial sync will take up to 500GB, so if you want to have some leeway you'll want to run with at least 1TB of disk space. Based on this the recommended specs are:
- Fast CPU with 4+ cores
- 16GB+ RAM
- Fast SSD with at least 1TB free space
- 25+ MBit/sec download Internet service**Using a USB drive**
If you don't have an SSD with enough space you can use an USB SSD drive instead (just make sure to use a USB 3.0 port). The startup script will automatically detect, format, mount the drive and configure geth to use it as the data directory.__WARNING__: plugging in a USB drive will format the device, erasing all data on it! Make sure to backup any files you want to keep before doing this.
## Installation
There are two ways of deploying this project depending on your needs:
- joining a public fleet of nodes via [balenaHub](https://hub.balena.io)
- creating your own private fleet of nodes using [balenaCloud](https://www.balena.io/cloud/)### balenaHub
balenaHub allows you to join an existing fleet of devices running this project. Deployment is simple, you just download and flash the image to your device and you're good to go. As you'll be joining an open fleet you won't have the same privileges you would have if you were running your own fleet. The fleet owner controls when updates are released and what configuration the devices run with. On the flip side, you won't need to create an account to join an open fleet. If you want to create and run your own private fleet check out the balenaCloud alternative below.
Read more about balenaHub and open fleets here: https://hub.balena.io/what-is-balenahub.
To deploy to your device using balenaHub visit: https://hub.balena.io/tmigone/balena-ethereum-node/Once your device is done downloading the application, you can access the grafana dashboard to view it's metrics on: `http://geth.local` or `http://geth` depending on your machine's operative system.
### balenaCloud
If you want to create your own private fleet you can do so using balenaCloud. This will let you control when to update your nodes, what specific configuration you want the node to run with and will give you all the perks of the balenaCloud dashboard: access to device metrics and logs, ssh access, remote management capabilities, etc.
If you are not familiar with balenaCloud you'll need to sign up for a free account [here](https://dashboard.balena-cloud.com/signup) and probably run through the [getting started guide](https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/) before deploying this project. The setup is fairly straightforward, it should take you about 15 minutes to get everything started.
You can then deploy this project to your fleet clicking the button below:
[](https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/tmigone/balena-ethereum-node&defaultDeviceType=intel-nuc)
## Configuration
The following environment variables can be used to customize your node. Read more about how to set variables in balenaCloud here: https://www.balena.io/docs/learn/manage/variables/. Note that they correspond to `geth` command line options so always check their [documentation](https://geth.ethereum.org/docs/interface/command-line-options) for up to date information.
__Note__: This only applies to balenaCloud deployment as only the fleet owner can modify these variables.
| Variable | Description | Geth option | Default |
| ------------- | ------------- | ------------- | ------------- |
| GETH_NETWORK | Which network to connect the node to. Available networks: `mainnet`, `goerli`, `rinkeby`, `ropsten`, `sepolia` | One of:
- `--mainnet`
- `--goerli`
- `--rinkeby`
- `--ropsten`
- `--sepolia`
| GETH_CACHE | Megabytes of memory allocated to internal caching. Can take any numeric value. | `--cache` | `1024` |
| GETH_SYNCMODE | Blockchain sync mode: `snap`, `full` or `light`. | `--syncmode` | `snap` |
| GETH_RPC_HTTP | Enable the HTTP-RPC server. Either `true` or `false` | Bundles:
- `--http`
- `--http.address 0.0.0.0`
- `--http.corsdomain "*"`
- `--http.api "$GETH_RPC_API"`
| GETH_RPC_WS | Enable the WS-RPC server. Either `true` or `false` | Bundles:
- `--ws`
- `--ws.address 0.0.0.0`
- `--ws.origins "*"`
- `--ws.api "$GETH_RPC_API"`
| GETH_RPC_API | API's offered over the HTTP-RPC and WS-RPC interfaces if enabled. | Bundles:
- `--http.apis `
- `--ws.apis `
## References
- https://greg.jeanmart.me/2020/02/23/running-an-ethereum-full-node-on-a-raspberrypi-4-/
- https://core-geth.org/setup-on-raspberry-pi
- https://ethereum.org/en/developers/tutorials/monitoring-geth-with-influxdb-and-grafana/
- https://grafana.com/grafana/dashboards/13877