{"id":20486863,"url":"https://github.com/rricard/consens","last_synced_at":"2025-09-07T22:43:25.407Z","repository":{"id":25187710,"uuid":"28611098","full_name":"rricard/consens","owner":"rricard","description":"Distributed clojure data structures through Paxos","archived":false,"fork":false,"pushed_at":"2015-01-03T10:48:55.000Z","size":244,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-31T03:58:46.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rricard.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}},"created_at":"2014-12-30T00:06:57.000Z","updated_at":"2024-08-14T20:22:26.000Z","dependencies_parsed_at":"2022-08-23T18:00:53.451Z","dependency_job_id":null,"html_url":"https://github.com/rricard/consens","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rricard/consens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fconsens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fconsens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fconsens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fconsens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rricard","download_url":"https://codeload.github.com/rricard/consens/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fconsens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274107991,"owners_count":25223473,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-15T16:38:55.678Z","updated_at":"2025-09-07T22:43:25.379Z","avatar_url":"https://github.com/rricard.png","language":"Clojure","readme":"# consens\n\nConsens is a library/server cluster for distributed consensus. It doesn't do much right now but we are already capable to boot up a paxos cluster.\n\n## Installation\n\nDownload from https://github.com/rricard/consens.\n\n## Usage\n\n### Paxos server node\n\nFor now, everything is in development so everything will pass through leiningen.\n\nOk, so let's start a single node (which is pointless...)\n\n    $ lein ring server\n\nLet's store some keys inside and retrieve them ! (later this will be supported by a nice Clojure API too !)\n\n    $ curl -XPUT localhost:3000/mykey -d mydata\n    created\n    $ curl -XGET localhost:3000/mykey\n    mydata\n\nAt this point, nothing to be amazed !\n\nLet's restart all of that by spinning 3 instances:\n\n    # in tty1\n    $ CLUSTER=http://localhost:4000,http://localhost:5000 lein ring server\n    # in tty2\n    $ CLUSTER=http://localhost:3000,http://localhost:5000 PORT=4000 lein ring server\n    # in tty3\n    $ CLUSTER=http://localhost:3000,http://localhost:4000 PORT=5000 lein ring server\n\nNow let's write on one node and see it on the other nodes:\n\n    $ curl -XPUT localhost:4000/mykey -d mydata\n    created\n    $ curl -XGET localhost:3000/mykey\n    mydata\n    $ curl -XGET localhost:4000/mykey\n    mydata\n    $ curl -XGET localhost:5000/mykey\n    mydata\n\nYou can disconnect one node, write and still see a consensus. Disconnect the majority of the nodes, the consensus goes away !\n\nIf a node is disconnected, you can make him catch up with the cluster with JOIN:\n\n    # tty3\n    ^C\n    $ CLUSTER=http://localhost:3000,http://localhost:4000 PORT=5000 JOIN=true lein ring server\n\nJOIN will try to catch up with first node in the cluster list. JOIN will fail if the this node is unavailable too !\n\nIf all the nodes gets disconnected, well, you lose your data. So here's my advice for now: **DON'T YOU EVEN TRY TO USE THIS IN ANY KIND OF PRODUCTION SYSTEM**. Of course, I want to make it better but if you still want to put it in production for whatever crazy reason: **THIS IS MY FIRST CLOJURE PROJECT**.\n\nBut that doesn't keep you from playing with it and even helping me making it a real, usable system ! PRs are welcome !\n\n### Roadmap\n\n- **TEST THE HANDLERS**, yeah that's bad ! The core funcs are tested but the whole system is not. I don't know how to tackle the problem right now anyway, I have to think a little bit more about it...\n- Simple, side-effect free, Client API. With futures if possible.\n- Try to integrate it with existing clojure protocols, I'll need to read more literature on that before I think ...\n- Oh ! and ... LOAD TESTING !\n\n## License\n\nCopyright © 2014-2015 Robin Ricard\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frricard%2Fconsens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frricard%2Fconsens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frricard%2Fconsens/lists"}