From 999438517924691dfe023f287dd497ad20c9564b Mon Sep 17 00:00:00 2001 From: swrup Date: Thu, 20 Nov 2025 20:30:41 +0100 Subject: [PATCH] + exchangedb-postgres --- default.config | 3 +++ include/dune | 2 +- include/parse_config.ml | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/default.config b/default.config index b1b00e13..fb795207 100644 --- a/default.config +++ b/default.config @@ -51,6 +51,9 @@ aggregator_shift = "1 year" max_aml_program_runtime = "1 year" default_purse_limit = 9999 +[exchangedb-postgres] +config = "pgx://mte:hunter2@localhost:5432/taler-exchange" + [coin_kudo_1] value= EUR:0.01 duration_withdraw= "1 year" diff --git a/include/dune b/include/dune index 0bb76a72..84286029 100644 --- a/include/dune +++ b/include/dune @@ -17,7 +17,7 @@ (executable (name parse_config) (modules parse_config) - (libraries mirage-crypto-ec ptime fmt angstrom amount b32)) + (libraries mirage-crypto-ec ptime fmt angstrom uri amount b32)) ; we prefer to generate taler_signatures.ml once, ; and commit it, for versionning: diff --git a/include/parse_config.ml b/include/parse_config.ml index 40a99e99..229f9c52 100644 --- a/include/parse_config.ml +++ b/include/parse_config.ml @@ -225,6 +225,7 @@ let yes_no = function | "YES" -> `YES | s -> fail_with (Fmt.str "expected `YES`/`NO` value, got `%s`" s) +let uri s = Uri.of_string s let amount s = s |> Amount.of_string |> unwrap_res let duration s = Parse_duration.(s |> parse |> to_ptime_span) @@ -356,6 +357,11 @@ module Config = struct let default_purse_limit = get "default_purse_limit" |> int end + module Exchangedb_postgres = struct + let config = + get config ~section:"exchangedb-postgres" ~field:"config" |> uri + end + module Currency = struct type t = { enabled: [ `YES | `NO ];