From 978f57604534a92dfe38836521dbc5d826448100 Mon Sep 17 00:00:00 2001 From: Smorci Date: Tue, 3 Sep 2024 14:39:44 +0200 Subject: [PATCH 1/4] Add commands README --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 32a8c73..059d86a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,40 @@ # ethereum-node-automation Automated solution to setup a local network of at least three ethereum nodes + +``` +kind create cluster --name ethereum-nodes +``` + +``` +flux bootstrap github \ + --owner=$GITHUB_USER \ + --repository=ethereum-node-automation \ + --branch=main \ + --path=./clusters/ethereum-node-automation \ + --personal +``` + +``` +flux create source git ethereum-node-automation \ + --url=https://github.com/Smorci/ethereum-node-automation \ + --branch=main \ + --interval=1m \ + --export > ./clusters/ethereum-node-automation/ethereum-node-automation-source.yaml +``` + +``` +flux create kustomization ethereum-node-automation \ + --target-namespace=ethereum-node-automation \ + --source=ethereum-node-automation \ + --path="./kustomize" \ + --prune=true \ + --wait=true \ + --interval=30m \ + --retry-interval=2m \ + --health-check-timeout=3m \ + --export > ./clusters/ethereum-node-automation/ethereum-node-automation-kustomization.yaml +``` + +``` +flux get kustomizations --watch +``` From 89eb6cd8e93d808936b70f93d21e83bab456c415 Mon Sep 17 00:00:00 2001 From: Szekely-Schnedarek Marton <43480627+Smorci@users.noreply.github.com> Date: Thu, 5 Sep 2024 17:23:58 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 059d86a..18483e1 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,18 @@ Automated solution to setup a local network of at least three ethereum nodes kind create cluster --name ethereum-nodes ``` +``` +./scripts/generate-token.sh +``` + +``` +kubectl create namespace ethereum-node-automation +``` + +``` +kubens ethereum-node-automation +``` + ``` flux bootstrap github \ --owner=$GITHUB_USER \ From fd5cce666c720bb1d96b382f7d19b49433c21abc Mon Sep 17 00:00:00 2001 From: Szekely-Schnedarek Marton <43480627+Smorci@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:43:10 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 18483e1..58d3305 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ # ethereum-node-automation -Automated solution to setup a local network of at least three ethereum nodes +Simple to use, packaged, continuously deployed solution to start 3 monitored ethereum nodes in your local environment + +## Pre-requisite +1.Nix version 2.18.2 or higher. Follow the [installation instructions](https://nix.dev/install-nix.html) for your operating system. +2. Github personal access token. Follow the [official documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) or take a look at the detailed application specific documentation in this repository. + +## `.env` file + +Create a `.env` file in the repository root, adding your github access token +``` +export GITHUB_TOKEN= +``` +> Replace `` with the generated access token in *pre-requisite* section + +## Usage ``` kind create cluster --name ethereum-nodes From a3370b1821a16cb50dea5b96f59e7047e72697e1 Mon Sep 17 00:00:00 2001 From: Szekely-Schnedarek Marton <43480627+Smorci@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:59:23 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 63 +++++++++++++++++++++++-------------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 58d3305..23aa066 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,55 @@ -# ethereum-node-automation -Simple to use, packaged, continuously deployed solution to start 3 monitored ethereum nodes in your local environment +# Ethereum Node Automation +Simple to use, packaged, continuously deployed solution to start 3 monitored ethereum nodes in your local environment. ## Pre-requisite 1.Nix version 2.18.2 or higher. Follow the [installation instructions](https://nix.dev/install-nix.html) for your operating system. 2. Github personal access token. Follow the [official documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) or take a look at the detailed application specific documentation in this repository. ## `.env` file - Create a `.env` file in the repository root, adding your github access token ``` export GITHUB_TOKEN= ``` -> Replace `` with the generated access token in *pre-requisite* section ## Usage - +### Bootstrap cluster +To start a kubernetes cluster and deploy 3 ethereum [full nodes](https://ethereum.org/en/developers/docs/nodes-and-clients/#what-are-nodes-and-clients) (two clients each), grafana and prometheus in the *ethereum-node-automation* namespace, run: ``` -kind create cluster --name ethereum-nodes +nix run ``` +This will start each deployment and continuously sync with the *main* branch of this repository, with Flux +### Delete cluster +To stop and destroy the cluster on your local machine, you can run: ``` -./scripts/generate-token.sh +nix run .#delete ``` +### Suspend Flux continuous deployment +To stop Flux from continuously syncing the cluster, you can suspend the Flux kustomization, run: ``` -kubectl create namespace ethereum-node-automation +flux suspend kustomization ethereum-node-automation ``` +### Get Flux continuous deployment status +To see the status of the deployment, run: ``` -kubens ethereum-node-automation +flux get kustomizations ``` +## Monitoring +After deploying the applications, there will be a Grafana and a Prometheus deployment in the namespace. To access the Grafan UI, you should port-forward the HTTP port of Grafana: ``` -flux bootstrap github \ - --owner=$GITHUB_USER \ - --repository=ethereum-node-automation \ - --branch=main \ - --path=./clusters/ethereum-node-automation \ - --personal +kubectl port-forward svc/grafana 3000:3000 ``` +After that you can access the UI from your browser at `localhost:3000`. -``` -flux create source git ethereum-node-automation \ - --url=https://github.com/Smorci/ethereum-node-automation \ - --branch=main \ - --interval=1m \ - --export > ./clusters/ethereum-node-automation/ethereum-node-automation-source.yaml -``` +The password for the admin user is `admin`. After logging in it is advised to update the password. -``` -flux create kustomization ethereum-node-automation \ - --target-namespace=ethereum-node-automation \ - --source=ethereum-node-automation \ - --path="./kustomize" \ - --prune=true \ - --wait=true \ - --interval=30m \ - --retry-interval=2m \ - --health-check-timeout=3m \ - --export > ./clusters/ethereum-node-automation/ethereum-node-automation-kustomization.yaml -``` +The instance is provisioned with two dashboards that use Prometheus as a datasource. Prometheus is configured to scrape data from the ethereum clients themselves and the kubernetes resources. -``` -flux get kustomizations --watch -``` +## More details +If you would wish to read more about implementation details check out the detailed documentation in the docs folder. + +## Contributing +Contributions are welcome, feel free to open a discussion on the repository.