{"id":16216017,"url":"https://github.com/tangledbytes/go-vsr","last_synced_at":"2025-03-19T10:30:30.401Z","repository":{"id":206238120,"uuid":"715107603","full_name":"tangledbytes/go-vsr","owner":"tangledbytes","description":"ViewStamped Replication implementation in Go","archived":false,"fork":false,"pushed_at":"2023-11-11T18:51:42.000Z","size":111,"stargazers_count":39,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T06:03:57.415Z","etag":null,"topics":["consensus","distributed-systems","golang","replication"],"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/tangledbytes.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-11-06T13:48:51.000Z","updated_at":"2025-03-10T04:56:17.000Z","dependencies_parsed_at":"2024-06-21T17:43:31.649Z","dependency_job_id":"2335200c-700a-4a45-a482-97918d174e14","html_url":"https://github.com/tangledbytes/go-vsr","commit_stats":null,"previous_names":["tangledbytes/go-vsr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledbytes%2Fgo-vsr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledbytes%2Fgo-vsr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledbytes%2Fgo-vsr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledbytes%2Fgo-vsr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tangledbytes","download_url":"https://codeload.github.com/tangledbytes/go-vsr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244407646,"owners_count":20447830,"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":["consensus","distributed-systems","golang","replication"],"created_at":"2024-10-10T11:17:43.675Z","updated_at":"2025-03-19T10:30:30.133Z","avatar_url":"https://github.com/tangledbytes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-vsr\n\ngo-vsr is the implementation of ViewStamped Replication[^1] in Golang. The goal here is to NOT build a production ready package rather is to simply play around with the protocol. As of now the it implements:\n1. Normal Operation\n2. View Change\n3. State Transfer\n\nRecovery is not yet supported.\n\n[^1]: https://pmg.csail.mit.edu/papers/vr-revisited.pdf\n\n## Simulator\nThe simulator in the repository is still in works as is the VSR implmentation. The simulator is a deterministic simulator, i.e. for as long as the given seed is the same, you should be able to generate the same scenarios on repeat. At the moment, the simulator is in working condition and can do the following:\n1. Take a seed and create a cluster of random numbers of replicas + random number of clients.\n2. Simulates packet drops\n3. Simulates unordered deliveries\n4. Simulates network delays\n5. Can do some sanity tests in the middle of the simulation as simulator drives the entire cluster and clients as well as has complete control over the passage of time.\n6. Performs a several assertions at the end of the simulation.\n\n### How to run?\nRunning the simulator is easy, you just need Go installed on the system.\n```console\n$ go run ./cmd/simulator \u003cseed\u003e\n```\n\nIf a seed is given then that seed will be used or else a seed will be generated and will be printed.\n\n## Example\nThere is a simple client (REPL) server example in the repository. It can mimic a distributed in-memory KV store.\n\n### How to run the example?\n```console\n$ #export DEBUG=1 will enable debug logs\n$ go run ./cmd/example server -members \"0.0.0.0:10000,0.0.0.0:10001,0.0.0.0:10002\" -id 0 -port 10000\n```\n```console\n$ #export DEBUG=1 will enable debug logs\n$ go run ./cmd/example server -members \"0.0.0.0:10000,0.0.0.0:10001,0.0.0.0:10002\" -id 1 -port 10001\n```\n```console\n$ #export DEBUG=1 will enable debug logs\n$ go run ./cmd/example server -members \"0.0.0.0:10000,0.0.0.0:10001,0.0.0.0:10002\" -id 2 -port 10002\n```\n\nThe above will start 3 replicas on port 10000, 10001, 10002.\n\n```console\n$ #export DEBUG=1 will enable debug logs\n$ go run ./cmd/example client -members \"0.0.0.0:10000,0.0.0.0:10001,0.0.0.0:10002\"\nStarting client... members [0.0.0.0:10000 0.0.0.0:10001 0.0.0.0:10002] id 5688340127043569018\nclient=\u003eGET abc\nserver=\u003e {\"result\": \"\"}\nclient=\u003eSET abc 123\nserver=\u003e {\"result\": \"123\"}\nclient=\u003eGET abc\nserver=\u003e {\"result\": \"123\"}\nclient=\u003e\n```\n\nThe above will start a client which can communicate with the cluster.\n\n## NOTE\nThis is below alpha level software at the moment and is being actively worked on.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangledbytes%2Fgo-vsr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftangledbytes%2Fgo-vsr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangledbytes%2Fgo-vsr/lists"}