{"id":19458497,"url":"https://github.com/postgrespro/raft","last_synced_at":"2025-04-25T06:30:27.893Z","repository":{"id":69542861,"uuid":"53679120","full_name":"postgrespro/raft","owner":"postgrespro","description":"Raft protocol implementation in C","archived":false,"fork":false,"pushed_at":"2016-08-10T12:54:26.000Z","size":65,"stargazers_count":51,"open_issues_count":0,"forks_count":11,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-04-24T10:48:43.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postgrespro.png","metadata":{"files":{"readme":"README","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":"2016-03-11T16:06:36.000Z","updated_at":"2025-04-17T06:24:12.000Z","dependencies_parsed_at":"2023-04-19T17:47:19.012Z","dependency_job_id":null,"html_url":"https://github.com/postgrespro/raft","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postgrespro","download_url":"https://codeload.github.com/postgrespro/raft/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250766957,"owners_count":21483894,"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-10T17:27:20.416Z","updated_at":"2025-04-25T06:30:27.887Z","avatar_url":"https://github.com/postgrespro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"libraft\n=======\n\nRaft protocol implementation in C.\n\nFeatures\n--------\n\n+ Leader Election\n+ Log Replication\n+ Log Compaction\n\nUsage\n-----\n\n1. Include raft.h and link with -lraft\n\n2. Initialize:\n\ta. Populate a ``raft_config_t`` with parameters (host, port, timeouts,\n\tlog length, etc.)\n\n\tb. Set an applier and a snapshooter callbacks. The applier should\n\tperform state modification, and the snapshooter should dump the state.\n\tSee raft.h for their signatures.\n\n\tc. Call raft_init(cfg).\n\n\td. Use raft_peer_up(...) to configure the peers, including the current\n\tone.\n\n\te. Create and bind the socket with raft_create_udp_socket(...).\n\n3. Serve raft:\n\ta. Call raft_tick(...) frequently to perform the logic of timeouts.\n\n\tb. Try to extract a message with raft_recv_message(...) when you\n\tbelieve there is one in the socket.\n\n\tc. Call raft_handle_message(...) when a message has been successfully\n\textracted from the socket.\n\n4. Serve clients:\n\ta. If this server is a leader (call raft_get_leader(...) to find out),\n\tthen it should accept pending connections and process client quieries.\n\n\tb. Use raft_emit(...) to update the state though raft. Then wait until\n\traft_applied(...) before returning the result to the client.\n\n\tc. You may use raft_get_leader(...) to redirect clients to the leader,\n\tthough this is not necessary.\n\nPlease read raft.h and example/ for more details.\n\nTesting\n-------\n\n1. Install docker and blockade.\n2. You may want to gain superuser privileges at this point.\n3. $ make check\n\nTODO\n----\n\n+ Membership Changes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostgrespro%2Fraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostgrespro%2Fraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostgrespro%2Fraft/lists"}