TODO: An early (and pre-alpha) implementation of the raft consensus protocol in crystal, no deps.
Why ? Because I want to learn crystal and love distributed systems
- Add the dependency to your
shard.yml
:
dependencies:
craft:
github: tclain/craft
- Run
shards install
require "craft"
cluster = Craft::Cluster.new(current: Craft::Node.new 'addr1', peers: [Craft::Node.new 'addr2', Craft::Node.new 'addr3'])
if cluster.current.leader?
cluster.propagate_state "hello"
end
git clone github.com/tclain/
- Fork it (https://github.com/tclain/craft/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Timothee Clain - creator and maintainer