From ab903f0f5e3ab4056da4019a2d7a3c83a8396e98 Mon Sep 17 00:00:00 2001 From: Denislav Mladenov <124160873+denislav-mladenov@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:20:44 +0300 Subject: [PATCH 1/5] Update README.md --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 0d5b787212..5a66a0a8da 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,34 @@ +## DevOps Take Home Task + +1. Fork the following repo: + 1. go-ethereum (geth) https://github.com/ethereum/go-ethereum +2. Update your forked repo with the following functionality: + 1. When a PR with label `CI:Build` is merged in it, a trigger kicks in and: + 1. builds a new docker image of the given project + 2. uploads it to a registry + 2. Create a Docker Compose definition that runs a local devnet with the newly built image. +3. Create e new directory named `hardhat` in the repository. Inside it start a new **Sample Hardhat Project** (*following official Hardhat docs*) + 1. When a PR with label `CI:Deploy` is merged in the repo, a pipeline is triggered that + 1. runs a local devnet using the forked `go-ethereum` image. + 2. deploys the Sample Hardhat Project to it. + 3. builds a new docker image, which allows to run an instance of the devnet with the contracts already deployed and uploads it to the same registry with a suitable different tag +4. Add a step to the pipeline which runs the hardhat tests from the sample project against the image with predeployed contracts +5. Create a Terraform script that quickly creates a k8s cluster in the cloud and deploys an instance of the built image to it. +6. (Bonus) Add Blockscout explorer to the Docker Compose definition created + +## DevOps Task Solution. (Under construction) + +1. The forked repo could be found under `https://github.com/denislav-mladenov/go-ethereum` +2. Updated the forked repo with new functionality. + 1. The required docker image file could be found under `/go-ethereum/.github/workflows/docker-build.yml` + 2. The docker-compose file could be found under `/go-ethereum/docker-compose/docer-compose.yml` +4. The docker deploy file which creates new hardhat could found uder `/go-ethereum/.github/workflows/docker-deploy.yml` + 1. The hardhat project is under `/go-ethereum/hardhat` +5. Terraform script which creates k8s cluster in AWS could be found `/go-ethereum/terraform/main.tf` +6. Added Blockscount + + + ## Go Ethereum Golang execution layer implementation of the Ethereum protocol. From 1c2b436223db8d9568fa8294d729014958d8463a Mon Sep 17 00:00:00 2001 From: Denislav Mladenov <124160873+denislav-mladenov@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:28:38 +0300 Subject: [PATCH 2/5] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a66a0a8da..1e3dbb2dba 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,12 @@ 1. The forked repo could be found under `https://github.com/denislav-mladenov/go-ethereum` 2. Updated the forked repo with new functionality. 1. The required docker image file could be found under `/go-ethereum/.github/workflows/docker-build.yml` - 2. The docker-compose file could be found under `/go-ethereum/docker-compose/docer-compose.yml` + 1. The PR was successfully executed and completed: + image + + ![image](https://github.com/user-attachments/assets/a7d2819c-b28c-420b-97d9-0ae977b2d53c) + + 3. The docker-compose file could be found under `/go-ethereum/docker-compose/docer-compose.yml` 4. The docker deploy file which creates new hardhat could found uder `/go-ethereum/.github/workflows/docker-deploy.yml` 1. The hardhat project is under `/go-ethereum/hardhat` 5. Terraform script which creates k8s cluster in AWS could be found `/go-ethereum/terraform/main.tf` From cf5aaba9930d5f09ff1dfa150e3c7d6eaeeb9e86 Mon Sep 17 00:00:00 2001 From: denislav-mladenov Date: Wed, 17 Jul 2024 19:12:25 +0300 Subject: [PATCH 3/5] update --- docker-compose/docker-compose.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index f0a337c183..6414688ba9 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -5,8 +5,17 @@ services: image: denislav-mladenov/go-ethereum:latest ports: - "8545:8545" + - "8546:8546" - "30303:30303" - volumes: - - ./data:/root/.ethereum - command: --dev --http --http.addr 0.0.0.0 --http.port 8545 --http.api eth,net,web3,personal,miner - + command: > + --dev + --http + --http.addr 0.0.0.0 + --http.port 8545 + --http.corsdomain "*" + --http.api personal,db,eth,net,web3 + --ws + --ws.addr 0.0.0.0 + --ws.port 8546 + --ws.origins "*" + --ws.api personal,db,eth,net,web3 From f1977ed998bac549e6919167aea62333b1edccbe Mon Sep 17 00:00:00 2001 From: Denislav Mladenov <124160873+denislav-mladenov@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:41:53 +0300 Subject: [PATCH 4/5] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 1e3dbb2dba..1e10f793b4 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,34 @@ 3. The docker-compose file could be found under `/go-ethereum/docker-compose/docer-compose.yml` 4. The docker deploy file which creates new hardhat could found uder `/go-ethereum/.github/workflows/docker-deploy.yml` 1. The hardhat project is under `/go-ethereum/hardhat` + + 2. The hardhat project was tested to verify that everything works as expected + + * hardhat was initilized and new sample project was created:

+ + image + + * 1 Solidity file was compiled successfully:

+ + image + + * New test was initiated and passed successfully:

+ + image + + * Another full test suite for the token with a lot of additional information about Mocha passed successfully:

+ + image + + * The Deployment finished successfully:

+ + image + + * Tested Deploying to remote networks `Infura`

+ + image + image + 5. Terraform script which creates k8s cluster in AWS could be found `/go-ethereum/terraform/main.tf` 6. Added Blockscount From a9b83a2a5b89b3ff4b26d9ccbf2ce77df9a9ee3f Mon Sep 17 00:00:00 2001 From: Denislav Mladenov <124160873+denislav-mladenov@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:45:07 +0300 Subject: [PATCH 5/5] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 1e10f793b4..0c83636b47 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,11 @@ image image + * Additional details:

+ + image + + 5. Terraform script which creates k8s cluster in AWS could be found `/go-ethereum/terraform/main.tf` 6. Added Blockscount