Quickstart¶
In order to set up a minimally viable ledgering system, one must:
Set up a ledger¶
Set up accounts¶
insert into omni_ledger.accounts (ledger_id, debits_allowed_to_exceed_credits, credits_allowed_to_exceed_debits)
values (noted_ledger_id, false, true), ...
returning id -- (1) note their IDs
Start transferring¶
It is important to ensure you are using serializable transactions:
begin transaction isolation level serializable;
insert into omni_ledger.transfers (debit_account_id, credit_account_id, amount)
values
...;
commit;
Since serializable transactions can fail due to serialization issues, you're advised to use omni_txn.retry
Set up accounting¶
Once ready, set up some basic accounts: