{"id":26911541,"url":"https://github.com/blockscapenetwork/raftify","last_synced_at":"2025-04-01T14:39:05.130Z","repository":{"id":57529756,"uuid":"258155893","full_name":"BlockscapeNetwork/raftify","owner":"BlockscapeNetwork","description":"Go package implementing the Raft leader election algorithm, used to turn any application into a Raft node.","archived":false,"fork":false,"pushed_at":"2020-08-27T14:23:03.000Z","size":184,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-06T13:22:27.912Z","etag":null,"topics":["cosmos-sdk","go","high-availability","raft-consensus","tendermint"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlockscapeNetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-23T09:32:50.000Z","updated_at":"2022-11-27T13:24:52.000Z","dependencies_parsed_at":"2022-08-30T17:20:31.985Z","dependency_job_id":null,"html_url":"https://github.com/BlockscapeNetwork/raftify","commit_stats":null,"previous_names":["blockscapelab/raftify"],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fraftify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fraftify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fraftify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fraftify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlockscapeNetwork","download_url":"https://codeload.github.com/BlockscapeNetwork/raftify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246657561,"owners_count":20813037,"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":["cosmos-sdk","go","high-availability","raft-consensus","tendermint"],"created_at":"2025-04-01T14:39:04.457Z","updated_at":"2025-04-01T14:39:05.124Z","avatar_url":"https://github.com/BlockscapeNetwork.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raftify\n\n[![CircleCI](https://circleci.com/gh/BlockscapeLab/raftify/tree/master.svg?style=shield)](https://circleci.com/gh/BlockscapeLab/raftify/tree/master)\n[![codecov](https://codecov.io/gh/BlockscapeLab/raftify/branch/master/graph/badge.svg)](https://codecov.io/gh/BlockscapeLab/raftify)\n[![Go Report Card](https://goreportcard.com/badge/github.com/blockscapelab/raftify)](https://goreportcard.com/report/github.com/blockscapelab/raftify)\n[![License](https://img.shields.io/github/license/cosmos/cosmos-sdk.svg)](https://github.com/cosmos/cosmos-sdk/blob/master/LICENSE)\n\n\u003e :warning: This project has not yet had a security audit or stress test and is therefore not ready for use in production! Use at your own risk!\n\n_Raftify_ is a Go implementation of the Raft leader election algorithm without the Raft log and enables the creation of a self-managing cluster of nodes by transforming an application into a Raft node. It is meant to be a **more cost-efficient** small-scale alternative to running a validator cluster with a separate full-fledged Raft consensus layer.\n\nIt is designed to be directly embedded into an application and provide a direct way of communicating between individual nodes, omitting the overhead caused by replicating a log.\nRaftify was built with one particular use case in mind: **running a self-managing cluster of Cosmos validators**.\n\n## Requirements\n\n- Golang 1.14+\n\n## Configuration Reference\n\nThe configuration is to be provided in a `raftify.json` file and must be located in the working directory specified in the second parameter of the `InitNode` method.\n\n\u003e :information_source: For Gaia, the working directory is `~/.gaiad/config/` by default.\n\n| Key         | Value    | Description                                                                                                                                                                                                           |\n|:------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id`          | string   | **(Mandatory)** The node's identifier.\u003c/br\u003eMust be **unique**.                                                                                                                                                         |\n| `max_nodes`   | int      | **(Mandatory)** The self-imposed limit of nodes to be run in the cluster.\u003c/br\u003eMust be greater than 0 and must _never_ be exceeded. |\n| `expect`      | int      | **(Mandatory)** The number of nodes expected to be online in order to bootstrap the cluster and start the leader election. Once the expected number of nodes is online, all cluster members will be started simultaneously.\u003c/br\u003eMust be 1 or higher and must _never_ exceed the self-imposed `max_nodes` limit.\u003c/br\u003e:warning: Please use `expect = 1` for single-node setups only. If you plan on running more than one node, set the `expect` value to the final cluster size on **ALL** nodes. |\n| `encrypt`     | string   | _(Optional)_ The hex representation of the secret key used to encrypt messages.\u003c/br\u003eThe value must be either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.\u003c/br\u003e[**Use this tool to generate a key.**](https://www.browserling.com/tools/random-bytes) |\n| `performance` | int      | _(Optional)_ The modifier used to multiply the maximum and minimum timeout and ticker settings. Higher values increase leader stability and reduce bandwidth and CPU but also increase the time needed to recover from a leader failure.\u003c/br\u003eMust be 1 or higher. Defaults to 1 which is also the maximum performance setting. |\n| `log_level`   | string   | _(Optional)_ The minimum log level for console log messages.\u003c/br\u003eCan be DEBUG, INFO, WARN, ERR. Defaults to `WARN`.                                                                                                    |\n| `bind_addr`   | string   | _(Optional)_ The address to bind the node application to.\u003c/br\u003eDefaults to `0.0.0.0`.                                                                                                                                                        |\n| `bind_port`   | string   | _(Optional)_ The port to bind the node application to.\u003c/br\u003eDefaults to `7946`.                                                                                                                                                              |\n| `peer_list`   | []string | _(Optional)_ The list of IP addresses of all cluster members (optionally including the address of the local node). It is used to determine the quorum in a non-bootstrapped cluster.\u003c/br\u003eFor example, if your peerlist has `n = 3` nodes then `math.Floor((n/2)+1) = 2` nodes will need to be up and running to bootstrap the cluster.\u003c/br\u003eAddresses must be provided in the `host:port` format.\u003c/br\u003eMust not be empty if more than one node is expected. |\n\n### Example Configuration\n\n```json\n{\n    \"id\": \"My-Unique-Name\",\n    \"max_nodes\": 3,\n    \"expect\": 3,\n    \"encrypt\": \"8ba4770b00f703fcc9e7d94f857db0e76fd53178d3d55c3e600a9f0fda9a75ad\",\n    \"performance\": 1,\n    \"log_level\": \"WARN\",\n    \"bind_addr\": \"192.168.0.25\",\n    \"bind_port\": 3000,\n    \"peer_list\": [\n        \"192.168.0.25:3000\",\n        \"192.168.0.26:3000\",\n        \"192.168.0.27:3000\"\n    ]\n}\n```\n\n## Getting Started\n\nFor a step-by-step guide on how to get started with your raftified Cosmos validator, check out [this tutorial](doc/getting-started.md).\n\n## Testing\n\nUse\n\n```go\nmake unit-tests\n```\n\nto run unit tests, and\n\n```go\nmake integration-tests\n```\n\nto run integration tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockscapenetwork%2Fraftify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockscapenetwork%2Fraftify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockscapenetwork%2Fraftify/lists"}