{"id":16551416,"url":"https://github.com/blackode/slack-backend-test","last_synced_at":"2025-07-24T10:06:47.933Z","repository":{"id":83817059,"uuid":"432684829","full_name":"blackode/slack-backend-test","owner":"blackode","description":"VHS Backend Test","archived":false,"fork":false,"pushed_at":"2022-09-05T07:16:25.000Z","size":312,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T16:46:29.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/blackode.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":"2021-11-28T10:47:13.000Z","updated_at":"2022-09-05T07:15:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcc094a9-58e2-4e02-9cc3-0753a565532d","html_url":"https://github.com/blackode/slack-backend-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blackode/slack-backend-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackode%2Fslack-backend-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackode%2Fslack-backend-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackode%2Fslack-backend-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackode%2Fslack-backend-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blackode","download_url":"https://codeload.github.com/blackode/slack-backend-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackode%2Fslack-backend-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266823653,"owners_count":23990051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11T19:37:15.033Z","updated_at":"2025-07-24T10:06:47.890Z","avatar_url":"https://github.com/blackode.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome Slack Notifications\n\n![Project Out Line Image](vhs.png)\n\n\n\n## Project Highlighted Module\n\n### Vhs.Servers.Transaction\n\nThis module simulates a Transaction Server for registering, updating, notifying slack, and listing transactions using `GenServer`\n\nIt will start as soon as our `vhs` app started\n\n## Development Technologies\n\nAt the moment of developing this project, I used the following versions of\nElixir and Erlang.\n\n```elixir\niex\u003e mix hex.info\n\nHex:    0.21.2\nElixir: 1.12.2\nOTP:    24.0.4\n\nBuilt with: Elixir 1.11.4 and OTP 21.3\n\n```\n\n\n\n## API EndPoints\n\n- POST `/blocknative/confirm` to watch transaction hash\n  \n  ```json\n   // Request body params to be sent\n   { \n      \"hash\": \"0x51d49ccc52e0d00941f86a1bd67e020162a6e1041b4e904ecdae03ebf0f1a907\"\n   }\n  ```\n- POST `/blocknative/webhook` webhook url to receive transaction updates\n- POST `/blocknative/transactions/pending` to list the all pending transactions\n\n  ```json\n  // response\n  {\n    \"data\": [\n        {\n            \"hash\": \"0x51d49ccc52e0d00941f86a1bd67e020162a6e1041b4e904ecdae03ebf0f1a907\",\n            \"status\": \"pending\"\n        }\n    ],\n    \"status\": \"ok\"\n  }\n  ```\n\n\n\n# Running Application\n\n\n\n## 1. Docker Setup \u0026 Running\n\nAdd `.env` file with following environment variables\n\n```shell\nBLOCKNATIVE_API_KEY=\"\u003ckey\u003e\"\nSLACK_WEBHOOK_KEY=\"\"\n```\n\nAfter that just build and run using the following commands\n\n```\ndocker build -t vhs .\ndocker run -t vhs\n```\n\nBy default visit `172.17.0.2:4000/blocknative/transactions/pending` \n\n\n\n## 2. Running Local\n\n#### 2.1) mix release vhs\n\n```\nmix deps.get\nmix release vhs\n```\n\nI added the releases path to `./releases` \n\nSo, we are provided with following commands.\n\n```\nRelease created at releases!\n\n    # To start your system\n    releases/bin/vhs start\n\nOnce the release is running:\n\n    # To connect to it remotely\n    releases/bin/vhs remote\n\n    # To stop it gracefully (you may also send SIGINT/SIGTERM)\n    releases/bin/vhs stop\n\nTo list all commands:\n\n    releases/bin/vhs\n\n```\n\nvisit `localhost:4000/blocknative/transactions/pending` \n\n\n\n#### 2.2) iex -S mix\n\nRunning Interactively\n\n\n\n# Receiving Transaction Updates as Webhooks\n\n## Expose a local web server to the internet\n\nThe `ngrok` will allow local webserver running to internet. So, we can use our local webserver url as webhook url at `blocknative`.\n\nrun the following command\n\n```shell\nngrok http 4000\n```\n\nYou will see the following output.\n\n```\nSession Status                online\nVersion                       2.3.40\nRegion                        United States (us)\nWeb Interface                 http://127.0.0.1:4040\nForwarding                    http://14fc-136-185-52-176.ngrok.io -\u003e http://localhost:4000\nForwarding                    https://14fc-136-185-52-176.ngrok.io -\u003e http://localhost:4000\nConnections                   ttl     opn     rt1     rt5     p50     p90\n```\n\nThe urls may look different as `ngrok` assigns random hexadecimal names to the HTTP tunnels it opens.  \nHere the url is `http://14fc-136-185-52-176.ngrok.io` which will act our webhook base.\n\nMake sure you add `http://14fc-136-185-52-176.ngrok.io/blocknative/webhook` as webhook url for `blocknative`.\n\n## Project Challenges\n\n- API Integration (Blocknative) Implementation\n- Transaction Server callbacks for updating the transaction status.\n- Using docker to releases with Elixir.\n\n## TIL\n\n- Learned how to use localhost web server as `webhook` using `ngrok`\n- Docker setup for Elixir projects with releases\n\n## Overall Project Experience\n\nI felt it is a well framed to test core concepts of Elixir as project made me to code in all the core concepts of Elixir like `GenServers`, `Enumaration`, `collections`, `webhooks`.\n\n## What I enjoyed?\n\nI really enjoyed coding webhooks, playing with docker, and notifying over slack.\n\nThank You :)\n\nBest Regards,\nAnkanna\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackode%2Fslack-backend-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackode%2Fslack-backend-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackode%2Fslack-backend-test/lists"}