{"id":16112535,"url":"https://github.com/abdulsametileri/leader-election-bully-algorithm","last_synced_at":"2026-04-02T01:19:23.440Z","repository":{"id":185410195,"uuid":"673502674","full_name":"Abdulsametileri/leader-election-bully-algorithm","owner":"Abdulsametileri","description":"This repository is implementation of Bully Algorithm in Golang with RPC","archived":false,"fork":false,"pushed_at":"2023-08-07T04:58:53.000Z","size":477,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T14:03:27.611Z","etag":null,"topics":["bully-algorithm","go","leader-election","rpc-client","rpc-server"],"latest_commit_sha":null,"homepage":"https://medium.com/@abdulsamet-ileri/lets-implement-a-basic-leader-election-algorithm-using-go-with-rpc-6cd012515358","language":"Go","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/Abdulsametileri.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-08-01T19:19:51.000Z","updated_at":"2025-03-13T08:22:51.000Z","dependencies_parsed_at":"2024-10-27T17:29:25.620Z","dependency_job_id":"8fe1de48-5cb7-43bb-9aa0-7f00c3539125","html_url":"https://github.com/Abdulsametileri/leader-election-bully-algorithm","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"099896e09447f4151e6aac3f7e78d95455950279"},"previous_names":["abdulsametileri/leader-election-bully-algorithm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abdulsametileri/leader-election-bully-algorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulsametileri%2Fleader-election-bully-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulsametileri%2Fleader-election-bully-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulsametileri%2Fleader-election-bully-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulsametileri%2Fleader-election-bully-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abdulsametileri","download_url":"https://codeload.github.com/Abdulsametileri/leader-election-bully-algorithm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulsametileri%2Fleader-election-bully-algorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"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":["bully-algorithm","go","leader-election","rpc-client","rpc-server"],"created_at":"2024-10-09T20:08:19.848Z","updated_at":"2026-04-02T01:19:23.423Z","avatar_url":"https://github.com/Abdulsametileri.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nYou can check [the article](https://medium.com/@abdulsamet-ileri/lets-implement-a-basic-leader-election-algorithm-using-go-with-rpc-6cd012515358) out.\n\n# Working Demo\n\n[![asciicast](https://asciinema.org/a/600162.svg)](https://asciinema.org/a/600162)\n\n# Quickstart with Docker\n\nThis project has an already configured [Docker Compose file](docker-compose.yml) launching four nodes.\n\nYou can build and run docker-compose as follows:\n\n`docker-compose up --build`\n\nYou can kill some nodes with docker commands to test the cluster behavior.\n\nIf you want to add new nodes, please add its address to hardcoded variables.\n\n```go\n// nodeAddressByID: It includes nodes currently in cluster\nvar nodeAddressByID = map[string]string{\n\t\"node-01\": \"node-01:6001\",\n\t\"node-02\": \"node-02:6002\",\n\t\"node-03\": \"node-03:6003\",\n\t\"node-04\": \"node-04:6004\",\n}\n```\n\nIn this repository, I wanted to avoid implementing a service discovery mechanism. \nI aim to learn and implement basic how to do leader election without service discovery. \n\nYou can also find [my service discovery implementation](https://github.com/Abdulsametileri/simple-service-discovery) and \n[article](https://itnext.io/lets-implement-basic-service-discovery-using-go-d91c513883f6)\n\n# Quickstart without Docker\n\nYou can still execute this project without using Docker.\n\nFirst, change the Node IPs. For example\n\n```go\n// nodeAddressByID: It includes nodes currently in cluster\nvar nodeAddressByID = map[string]string{\n\t\"node-01\": \"node-01:6001\", \u003c--- change here to localhost:6001\n\t\"node-02\": \"node-02:6002\", \u003c--- change here to localhost:6002\n\t\"node-03\": \"node-03:6003\", \u003c--- change here to localhost:6003\n\t\"node-04\": \"node-04:6004\", \u003c--- change here to localhost:6004\n}\n```\n\nSecond, you can set which node you want to run in `Program arguments` like\n\n`go run . node-02`\n\n## Additional ToDos\n\n- [ ] 1- Implement with service discovery\n- [ ] 2- Change ordered election to dynamic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulsametileri%2Fleader-election-bully-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulsametileri%2Fleader-election-bully-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulsametileri%2Fleader-election-bully-algorithm/lists"}