A horizontally distributed ledger. Wave builds on a few key components:
- It implements the invariants and data structures necessary to do simple double-entry accounting using postgreSQL as a storage layer.
- It wraps this state machine over the consensus protocol RAFT via rabbitmq/ra.
- It exposes an api interface to read/write to the ledger.
- There are three nodes - a single leader and two followers
- It will accept writes (CREATE TABLE, INSERT) on the leader and
- accept reads (SELECT) on any node. All nodes will always contain the same data.
- Supported Ledger Operations:
- create a ledger
- create more than one account on the ledger
- add a CR entry
- add a DR entry
- retrieve a balance
Using the docker-compose up
OR
The application must be able to connect to three postgres instances with a database called wave_ledger
on ports 5432
, 5433
, 5344
. Via psql:
psql -U user -p 5432
postgres=# CREATE DATABASE wave_ledger;
CREATE DATABASE
In three seperate terminals:
iex --name [email protected] --cookie wave -S mix
iex --name [email protected] --cookie wave -S mix
iex --name [email protected] --cookie wave -S mix
If available in Hex, the package can be installed
by adding wave
to your list of dependencies in mix.exs
:
def deps do
[
{:wave, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/wave.