A library implementing the Carol programming language, providing an eDSL for writing operations and a replica system that runs them.
First, get the project.
$ git clone https://github.com/cuplv/card-systems $ cd card-systems
Next, build the project. If you have the
package manager, the process is simple:
$ nix-env -i cabal2nix cabal-install $ cabal2nix --shell . > shell.nix $ nix-shell --command "cabal configure" $ cabal build
The current demo executable is a simple conflict-aware bank account,
in which replicas announce updates via http and store their history in
IPFS. To try it, first make sure there is an IPFS daemon running
with it's API on port
5001 (the default).
$ nix run nixpkgs.ipfs -c ipfs daemon --init
Then, open two terminals, and run the following:
(term 1)$ cabal run discard-demo -- -c 2local.yaml -i alpha (term 2)$ cabal run discard-demo -- -c 2local.yaml -i beta
Now a node is running in each terminal. Choose one and type
to see the current shared account value (0 to start). Add money with
dp INT, withdraw with
Try testing the safety of the system by running
wd INT with enough
value to empty the account simultaneously on two nodes.
Library documentation, which is still minimal and disorganized, can be
If you don't have Nix, here's another way to set up the system (that hasn't been tested in a while...)