{"id":37213367,"url":"https://github.com/sarthakvk/gokey","last_synced_at":"2026-01-15T00:37:13.086Z","repository":{"id":217944667,"uuid":"745055145","full_name":"sarthakvk/gokey","owner":"sarthakvk","description":"fault tolerant Key-Value store based on RAFT protocol","archived":false,"fork":false,"pushed_at":"2024-02-03T18:14:59.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T15:36:24.277Z","etag":null,"topics":["golang-application","raft-consensus-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sarthakvk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-01-18T14:57:06.000Z","updated_at":"2024-05-12T08:40:37.000Z","dependencies_parsed_at":"2024-01-21T22:51:04.438Z","dependency_job_id":"ac3e9db6-8c77-422a-a158-7529d97f2b23","html_url":"https://github.com/sarthakvk/gokey","commit_stats":null,"previous_names":["sarthakvk/gokey"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sarthakvk/gokey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarthakvk%2Fgokey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarthakvk%2Fgokey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarthakvk%2Fgokey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarthakvk%2Fgokey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarthakvk","download_url":"https://codeload.github.com/sarthakvk/gokey/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarthakvk%2Fgokey/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:34:46.850Z","status":"ssl_error","status_checked_at":"2026-01-15T00:34:46.551Z","response_time":107,"last_error":"SSL_read: 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":["golang-application","raft-consensus-algorithm"],"created_at":"2026-01-15T00:37:12.554Z","updated_at":"2026-01-15T00:37:13.068Z","avatar_url":"https://github.com/sarthakvk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gokey: Distributed key-value store\n\n**Documentation**: For complete documentation, see the associated [Godoc](https://pkg.go.dev/github.com/sarthakvk/gokey)\n--\n\n**Usage:**  \n **This is still under development, don't use in PRODUCTION**\n\n* **Application Prerequisites:**\n  - Make sure go is installed version \u003e= 1.21\n  - Clone the repository\n\n* **Application Startup:**\n  - Execute the following commands to initiate the nodes:\n    ```bash\n    go run cmd/httpd/httpd.go -node-id A -address localhost:8000 -http-port 9000 -bootstrap\n    ```\n    ```bash\n    go run cmd/httpd/httpd.go -node-id B -address localhost:8001 -http-port 9001\n    ```\n    ```bash\n    go run cmd/httpd/httpd.go -node-id C -address localhost:8002 -http-port 9002\n\n  After successfully launching the nodes, ensure that the leader node (i.e., `node A`, as it was designated with the bootstrap option) adds the other two nodes to the cluster.\n\n* **Adding Nodes API:**\n  - Add node B to the cluster:\n    ```bash\n    curl --location 'localhost:9000/add-replica' \\\n    --header 'Content-Type: application/json' \\\n    --data '{\n        \"node_id\": \"B\",\n        \"address\": \"localhost:8001\"\n    }'\n    ```\n  - Add node C to the cluster:\n    ```bash\n    curl --location 'localhost:9000/add-replica' \\\n    --header 'Content-Type: application/json' \\\n    --data '{\n        \"node_id\": \"C\",\n        \"address\": \"localhost:8002\"\n    }'\n    ```\n\n- **Examples:**\n  1. **SET:**\n       - **Request:**\n           ```bash\n           curl --location 'localhost:9000/key-store' \\\n           --header 'Content-Type: application/json' \\\n           --data '{\n               \"command\": \"SET\",\n               \"key\": \"FOO\",\n               \"value\": \"BAR\"\n           }'\n           ```\n      - **Response:**\n          ```json\n          {\"created\":true}\n          ```\n  2. **DELETE:**\n        - **Request:**\n            ```bash\n            curl --location 'localhost:9000/key-store' \\\n            --header 'Content-Type: application/json' \\\n            --data '{\n                \"command\": \"DELETE\",\n                \"key\": \"FOO\"\n            }'\n            ```\n  3. **GET_OR_CREATE:**\n       - **Request:**\n         ```bash\n         curl --location 'localhost:9000/key-store' \\\n         --header 'Content-Type: application/json' \\\n         --data '{\n             \"command\": \"GET_OR_CREATE\",\n             \"key\": \"FOO\",\n             \"value\": \"FOO\"\n         }'\n         ```\n      - **Response:**\n        ```json\n        {\"value\":\"BAR\"}\n        ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarthakvk%2Fgokey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarthakvk%2Fgokey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarthakvk%2Fgokey/lists"}