Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.09 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.09 KB

crdtdb: A Riak Core Application

#Instructions Compile Riak using devrel

Make a devrel release of the crdtdb repo, it will assign the ports to match Riak's devrel

Start a Riak node

Create a last writer wins bucket curl -X PUT -H 'Content-Type: application/json' -d '{"props":{"last_write_wins":true, "n_val":3}}' "http://localhost:10018/buckets/ITEMS/props"

Start a crdtdb node

crdtdb/dev/dev1/bin/crdtdb start

Initialize the nodes

erl -name '[email protected]' -setcookie crdtdb

rpc:call('[email protected]', crdtdb, start, [id0, [{id0,'[email protected]'}]]).

*id0 is the DC identifier

Clear the database

erl -name '[email protected]' -setcookie crdtdb

rpc:call('[email protected]', crdtdb, reset, [id0,0,5,[{id0,'[email protected]'}]]).

  • id0 is the local 1
  • 0 is the max key id
  • 5 is the initial value
  • [{id0,'[email protected]'}] is a list of server nodes

Try some commands

erl -name '[email protected]' -setcookie crdtdb

rpc:call('[email protected]', crdtdb, decrement, [<<"0">>]).