interledger / rafiki

An open-source, comprehensive Interledger service for wallet providers, enabling them to provide Interledger functionality to their users.
https://rafiki.dev/
Apache License 2.0
226 stars 77 forks source link

Declarative Rafiki Configuration file #418

Open matdehaast opened 1 year ago

matdehaast commented 1 year ago

Explore adding the ability to declaretivly add ledgers and liquidity accounts to tigerbeetle.

sabineschaller commented 1 year ago

@matdehaast Can you elaborate on this? What exactly do you want to do?

matdehaast commented 1 year ago

So this was allowing the ability to declare the default ledgers and accounts for TB via a file and then Rafiki would auto setup it up for you. This meant you wouldn't have to use the API on startup to configure it.

Example

ledgers:
  - id: 123
    name: "LocalUSD"
    asset: "USD"
    scale: 2
  - id: 124
    name: "LocalZAR"
    asset: "ZAR"
    scale: 2

accounts:
  - id: "46d4a2bd-e29b-4a63-9aa8-7990776c714e"
    ledger_id: 124
    code: 2
    linked: false
    debits_must_not_exceed_credits: false
    credits_must_not_exceed_debits: false
  - id: "c54aa8a9-b303-4b75-9bf4-203a9cf15f68"
    ledger_id: 123
    code: 2
    linked: true
    debits_must_not_exceed_credits: false
    credits_must_not_exceed_debits: false
  - id: "29e5aa54-0dc8-4e92-a9dd-b99a373525f0"
    ledger_id: 123
    code: 2
    linked: false
    debits_must_not_exceed_credits: false
    credits_must_not_exceed_debits: false
mkurapov commented 1 year ago

@sabineschaller ^ this makes sense, but I'm wondering if it would be applicable for us now because we also support PSQL accounting, since (IMO) the seeding should be DB-agnostic. Also, I don't know whether it would make sense to create TB accounts that aren't tied to backend accounts like Assets, Peers, Incoming Payments and Outgoing Payments