{"id":19137796,"url":"https://github.com/ibaryshnikov/raft-example","last_synced_at":"2025-10-05T18:02:08.356Z","repository":{"id":212587337,"uuid":"731327842","full_name":"ibaryshnikov/raft-example","owner":"ibaryshnikov","description":"An example of using raft","archived":false,"fork":false,"pushed_at":"2023-12-16T02:35:25.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T22:07:28.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/ibaryshnikov.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":"2023-12-13T20:47:33.000Z","updated_at":"2023-12-13T23:32:53.000Z","dependencies_parsed_at":"2023-12-16T04:51:24.827Z","dependency_job_id":null,"html_url":"https://github.com/ibaryshnikov/raft-example","commit_stats":null,"previous_names":["ibaryshnikov/raft-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibaryshnikov/raft-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaryshnikov%2Fraft-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaryshnikov%2Fraft-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaryshnikov%2Fraft-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaryshnikov%2Fraft-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibaryshnikov","download_url":"https://codeload.github.com/ibaryshnikov/raft-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaryshnikov%2Fraft-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262341621,"owners_count":23296070,"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","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-11-09T06:40:37.782Z","updated_at":"2025-10-05T18:02:03.298Z","avatar_url":"https://github.com/ibaryshnikov.png","language":"Rust","readme":"# Raft example\n\nRebuilding an example from\n[openraft](https://github.com/datafuselabs/openraft)\nfor learning purposes.\nThe original example is [raft-kv-memstore](https://github.com/datafuselabs/openraft/tree/main/examples/raft-kv-memstore).\n\n## Usage\n\nStart a node\n```bash\ncargo run -- --id 1 --http-addr 127.0.0.1:8081\n```\n\nInit leader\n```bash\ncurl http://localhost:8081/init -H \"Content-Type: application/json\" -d '{}'\n```\n\nAdd learner\n```bash\ncurl http://localhost:8081/add-learner -H \"Content-Type: application/json\" -d '[2, \"127.0.0.1:8082\"]'\ncurl http://localhost:8081/add-learner -H \"Content-Type: application/json\" -d '[3, \"127.0.0.1:8083\"]'\n```\n\nChange membership\n```bash\ncurl http://localhost:8081/change-membership -H \"Content-Type: application/json\" -d '[1, 2, 3]'\n```\n\nMetrics\n```bash\ncurl http://localhost:8081/metrics\n```\n\nRead\n```bash\ncurl http://localhost:8081/read -H \"Content-Type: application/json\" -d '\"foo\"'\n```\n\nWrite\n```bash\ncurl http://localhost:8081/write -H \"Content-Type: application/json\" -d '{\"Set\":{\"key\":\"foo\",\"value\":\"bar\"}}'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaryshnikov%2Fraft-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibaryshnikov%2Fraft-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaryshnikov%2Fraft-example/lists"}