{"id":16269731,"url":"https://github.com/tairov/simple-blockchain-client","last_synced_at":"2026-02-17T22:31:56.705Z","repository":{"id":172537481,"uuid":"649401053","full_name":"tairov/simple-blockchain-client","owner":"tairov","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-04T19:50:36.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T15:20:12.104Z","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/tairov.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}},"created_at":"2023-06-04T18:16:47.000Z","updated_at":"2023-06-04T19:35:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfa46a2d-7e9d-432f-87e2-60a7e033b37a","html_url":"https://github.com/tairov/simple-blockchain-client","commit_stats":null,"previous_names":["tairov/simple-blockchain-client"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tairov/simple-blockchain-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tairov%2Fsimple-blockchain-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tairov%2Fsimple-blockchain-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tairov%2Fsimple-blockchain-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tairov%2Fsimple-blockchain-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tairov","download_url":"https://codeload.github.com/tairov/simple-blockchain-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tairov%2Fsimple-blockchain-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29560779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":"2024-10-10T18:08:58.970Z","updated_at":"2026-02-17T22:31:56.683Z","avatar_url":"https://github.com/tairov.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# block chain client service example\n\n### Endpoints:\n\n`/block/\u003cid\u003e` - returns JSON response with block number retrieved from block chain API\n`/get_block_by_number/\u003cnumber\u003e` - returns JSON response with block information\n\n`/metrics` - returns metrics in plain text format supported by Prometheus\n`/health` - returns JSON status of the service\n\n### Terraform setup\n\n`terraform init`\n\n### Tests\n\nRun tests via script :\n`./scripts/run_tests.sh`\n\n# Design decision\n\nThe main design decision in this Terraform project was to split the infrastructure into modules and use Terraform\nworkspaces to manage different environments. This allows for easier management of resources and separation of\nenvironments during development.\nUsing modules in this way makes it easier to add, update, and remove services, because an engineer can do so by\nmaintaining only a couple of files in a single place - main.tf and \u003cENV\u003e.tfvars rather than having to search through the\nhuge single main.tf. It also makes the code more organized, easier to understand, simpler to refactor, since we\neliminated code/logic duplication.\n\nUsing modules in this way makes it easier to add, update, and remove services, because an engineer can do so by\nmaintaining only a couple of files in a single place - `main.tf` and `\u003cENV\u003e.tfvars` rather than having to search through\nthe huge single `main.tf`. It also makes the code more organized, easier to understand, simpler to refactor, since we\neliminated code/logic duplication.\n\n### Using Terraform Workspaces for Development and CI/CD\n\nTerraform workspaces allow for the creation of separate environments within a single configuration. This is useful for\ndevelopment as it allows for easy testing of changes without affecting other environments. It also allows for the\ncreation of specific environments for different stages of the CI/CD pipeline, such as development, staging, and\nproduction.\n\nEssentially we have 2 types of CI/CD pipelines.\n\n1. CI/CD for the infra code (Terraform, ansible, etc.)\n2. CI/CD for the apps \u0026 services\n\nIn both cases the refactored modules repository could be nicely integrated into the pipelines.\n\n#### CI/CD for the client service\n\nSee: `.github/workflows/build.yml`\n\nBuild pipeline is implemented in the github actions script. It contains the following steps:\n\n* notify\n* build-and-push-image\n\n#### CI/CD for the Terraform infra\n\nSee: `.github/workflows/infra-update.yml`\n\nI've implemented ready to use github actions script. Beside basic liniting \u0026 setup steps it also contains the following\nwhich must convey the idea I'm proposing:\n\n`Comment terraform plan` - that is executed when **Pull Reqeust** created with changes under `tf/*` path.\nIt creates a comment within Pull Request that will show the implied changes implemented in the commits.\nThis will only work if TF state is stored somehwere remotely like in AWS-S3 or in Terraform Cloud.\n\n`Terraform Apply` - if PR merged then this step will apply all changes on infra\n\nIf the changes are successful in the staging environment, they can then be promoted to the production environment by\nmerging the staging branch into the production branch and running Terraform in the production workspace.\n\n\n### Suggestions for Further Advancements\n\nThere are several ways that this solution could be further advanced:\n\n1. Move the state to external storage like Terraform Cloud or AWS-S3. It must improve the security, auditing, collaboration and we can have versioning of infra changes.\n2. As an out-of-the-box step - it might be much better to deploy services to kubernetes/minikube in order to get some advancements suggested in this list\n3. Add set of features/services/solutions for Observability\n4. Implement basic features for horizontal/vertical scaling/autoscaling of services\n5. Implementing testing of the deployed infrastructure, such as integration tests or acceptance tests, to ensure that the infrastructure is functioning as expected. I'd suggest to use `Cucumber` scripts for covering all necessary cases. For `production` I'd suggest to implement Game-day by injecting different level failures on the infra ( chaos engineering )\n6. Automating the promotion of changes from staging to production (or at least from dev to staging), such as through the use of approval processes or manual intervention. Which is partially implemented in the POC script I've provided (see: `.github/workflows/infra-update.yml`)\n7. Implementing a rollback mechanism to allow for easy reversal of changes in the event of failures or issues.\n8. Adding additional security measures, such as the use of secrets management or encryption of sensitive data.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftairov%2Fsimple-blockchain-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftairov%2Fsimple-blockchain-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftairov%2Fsimple-blockchain-client/lists"}