{"id":13713855,"url":"https://github.com/markthethomas/raft-badger","last_synced_at":"2026-03-01T14:35:21.862Z","repository":{"id":57487942,"uuid":"171398341","full_name":"markthethomas/raft-badger","owner":"markthethomas","description":"Badger-based backend for Hashicorp's raft package","archived":false,"fork":false,"pushed_at":"2019-04-20T15:15:03.000Z","size":28,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T00:36:02.054Z","etag":null,"topics":["consensus","distributed-systems","go","key-value","raft"],"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/markthethomas.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":"2019-02-19T03:27:37.000Z","updated_at":"2024-10-07T15:16:06.000Z","dependencies_parsed_at":"2022-08-29T11:21:49.009Z","dependency_job_id":null,"html_url":"https://github.com/markthethomas/raft-badger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/markthethomas/raft-badger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthethomas%2Fraft-badger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthethomas%2Fraft-badger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthethomas%2Fraft-badger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthethomas%2Fraft-badger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markthethomas","download_url":"https://codeload.github.com/markthethomas/raft-badger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthethomas%2Fraft-badger/sbom","scorecard":{"id":620564,"data":{"date":"2025-08-11","repo":{"name":"github.com/markthethomas/raft-badger","commit":"b37d14e77a69c7df2c8d108537c584234f618667"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0536 / GHSA-39qc-96h7-956f / GHSA-hgr8-6h9x-f7q9","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T05:07:31.152Z","repository_id":57487942,"created_at":"2025-08-21T05:07:31.152Z","updated_at":"2025-08-21T05:07:31.152Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29971003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T14:11:48.712Z","status":"ssl_error","status_checked_at":"2026-03-01T14:11:48.352Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["consensus","distributed-systems","go","key-value","raft"],"created_at":"2024-08-02T23:01:46.087Z","updated_at":"2026-03-01T14:35:21.836Z","avatar_url":"https://github.com/markthethomas.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# raft-badger\n\n[![CircleCI](https://circleci.com/gh/markthethomas/raft-badger/tree/master.svg?style=svg)](https://circleci.com/gh/markthethomas/raft-badger/tree/master) [![Go Report Card](https://goreportcard.com/badge/github.com/markthethomas/raft-badger)](https://goreportcard.com/report/github.com/markthethomas/raft-badger) [![Maintainability](https://api.codeclimate.com/v1/badges/2aef013ae290d9233ac5/maintainability)](https://codeclimate.com/github/markthethomas/raft-badger/maintainability) [![codecov.io Code Coverage](https://img.shields.io/codecov/c/github/markthethomas/raft-badger.svg?maxAge=2592000)](https://codecov.io/github/markthethomas/raft-badger?branch=master) [![HitCount](http://hits.dwyl.io/markthethomas/github.com/markthethomas/raft-badger.svg)](http://hits.dwyl.io/markthethomas/github.com/markthethomas/raft-badger) [![GoDoc](https://godoc.org/github.com/markthethomas/raft-badger?status.png)](https://godoc.org/github.com/markthethomas/raft-badger)\n\n![Raft + Badger backend plugin](https://cdn.ifelse.io/images/raft-badger.png)\n\nThis repository provides a storage backend for the excellent [raft package](https://github.com/hashicorp/raft) from Hashicorp. Raft is a [distributed consensus](https://en.wikipedia.org/wiki/Consensus_(computer_science)) protocol. Distributed consensus has *many* practical applications, ranging from fault-tolerant databases to clock synchronization to things like Google's PageRank.\n\nThis package exports the `BadgerStore`, which is an implementation of both a `LogStore` and `StableStore` (interfaces used by the raft package for reading/writing logs as part of its consensus protocol).\n\n- [raft-badger](#raft-badger)\n  - [installation](#installation)\n  - [usage](#usage)\n  - [developing](#developing)\n  - [motivation](#motivation)\n  - [misc.](#misc)\n  - [todo](#todo)\n\n## installation\n\n```bash\ngo get -u github.com/markthethomas/raft-badger\n```\n\n## usage\n\nCreate a new BadgerStore and pass it to Raft when setting up.\n\n```go\n//...\nvar logStore raft.LogStore\nvar stableStore raft.StableStore\nmyPath  := filepath.Join(s.RaftDir) // replace this with what you're actually using\nbadgerDB, err := raftbadgerdb.NewBadgerStore(myPath)\nif err != nil {\n  return fmt.Errorf(\"error creating new badger store: %s\", err)\n}\nlogStore = badgerDB\nstableStore = badgerDB\n\nr, err := raft.NewRaft(config, (*fsm)(s), logStore, stableStore, snapshots, transport)\n//...\n```\n\n## developing\n\nTo run tests, run:\n\n```bash\ngo test -cover -coverprofile=coverage.out .\n```\n\nTo view coverage, run:\n\n```bash\ngo tool cover -html=coverage.out\n```\n\nTo run the benchmark, run:\n\n```bash\ngo test -race -bench .\n```\n\n## motivation\n\nThis package is meant to be used with the [raft package](https://github.com/hashicorp/raft) from Hashicorb. This package borrows heavily from the excellent [raft-boltdb](https://github.com/hashicorp/raft-boltdb) package, also from Hashicorp. I wanted to learn about Badger and similar tools and needed to use Raft + a durable backend.\n\n## misc.\n\n-   raft-badger uses prefix keys to \"bucket\" logs and config, avoiding the need for multiple badger database files for each type of k/v raft sets\n-   encodes/decodes the raft [Log](https://godoc.org/github.com/hashicorp/raft#Log) types using Go's [gob](https://golang.org/pkg/encoding/gob/) for efficient encoding/decoding of keys See more at https://blog.golang.org/gobs-of-data.\n-   images used are from the [raft website](https://raft.github.io) and [the badger repository](https://github.com/dgraph-io/badger), respectively\n-   thanks to the authors of the excellent [raft-boltdb](https://github.com/hashicorp/raft-boltdb) package for providing patterns to follow in satisfying the requisite raft interfaces 🙌\n-   curious to learn more about the raft protocol? check out [the raft website](https://raft.github.io). There's also a beginner's guide at [Free Code Camp](https://medium.freecodecamp.org/in-search-of-an-understandable-consensus-algorithm-a-summary-4bc294c97e0d)\n\n## todo\n\n-   support custom badger options\n-   explore other encodings besides `gob`\n-   add more examples of use with raft\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthethomas%2Fraft-badger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkthethomas%2Fraft-badger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthethomas%2Fraft-badger/lists"}