mte/src/config.ml

93 lines
2.5 KiB
OCaml
Raw Normal View History

2025-10-13 11:48:29 +02:00
(* hardcoded config for now *)
let amount s = Amount.of_string s |> Result.get_ok
2025-10-18 20:28:38 +02:00
let zero_eur = amount "EUR:0.00"
2025-10-17 15:09:47 +02:00
let dummy_duration = Ptime.Span.of_int_s 99999999
2025-10-13 11:48:29 +02:00
module Exchange = struct
let currency = "EUR"
let currency_round_unit = amount "EUR:0.01"
let db = "postgres"
let attribute_encryption_key = "uhuhg" (* high-entropy nonce. *)
2025-11-11 03:12:12 +01:00
let port = 3434
2025-10-18 18:19:09 +02:00
let master_public_key =
"8MQF2XPWCKCW4199JFPE08X7Y9XAX21SF2HD8NZKXM3PY3CMCJ90===="
|> B32.decode
|> Result.get_ok
|> Mirage_crypto_ec.Ed25519.pub_of_octets
|> Result.get_ok
2025-10-17 15:09:47 +02:00
let stefan_abs = zero_eur
let stefan_log = zero_eur
2025-10-13 11:48:29 +02:00
let stefan_lin = 0.0
2025-10-17 15:09:47 +02:00
let signkey_legal_duration = dummy_duration
2025-10-13 11:48:29 +02:00
let max_keys_caching = 9999999
let max_requests = 99999999
let terms_dir = Fpath.(v "terms")
let terms_etag = "0" |> Headers_lib.Etag.of_crockford32 |> Result.get_ok
let privacy_dir = Fpath.(v "privacy")
let privacy_etag = "0" |> Headers_lib.Etag.of_crockford32 |> Result.get_ok
let enable_kyc = `NO
end
let currency_eur =
2025-10-16 08:23:40 +02:00
Types.Config_types.Currency.
{
enabled= `NO;
code= "EUR";
name= "euro";
fractional_input_digits= 2;
fractional_normal_digits= 2;
fractional_trailing_zero_digits= 2;
alt_unit_names= [ (0, "E"); (3, "kE") ];
}
2025-10-13 11:48:29 +02:00
module Secmod_rsa = struct
2025-10-17 15:09:47 +02:00
let lookahead_sign = dummy_duration
let overlap_duration = dummy_duration
2025-10-13 11:48:29 +02:00
let sm_priv_key = Fpath.(v "rsa_key.priv")
let key_dir = Fpath.(v "rsa")
end
module Secmod_eddsa = struct
2025-10-17 15:09:47 +02:00
let lookahead_sign = dummy_duration
let overlap_duration = dummy_duration
2025-10-13 11:48:29 +02:00
let sm_priv_key = Fpath.(v "eddsa_key.priv")
let key_dir = Fpath.(v "eddsa")
end
2025-11-11 03:12:12 +01:00
module Exchangedb_postgres = struct
(* pgx://<user>:<password>@<host-or-directory>:<port>/<database> *)
let config =
let user = "mte" in
let password = "hunter2" in
let host = "localhost" in
let port = 5432 in
let database = "taler-exchange" in
Uri.of_string
@@ Fmt.str "pgx://%s:%s@%s:%d/%s" user password host port database
end
2025-10-16 08:23:40 +02:00
let coin_kudo_1 =
Types.Config_types.Coin.
{
2025-10-16 10:18:22 +02:00
section_name= "kudo_1";
2025-10-16 08:23:40 +02:00
value= amount "EUR:0.01";
2025-10-17 15:09:47 +02:00
duration_withdraw= dummy_duration;
duration_spend= dummy_duration;
duration_legal= dummy_duration;
fee_withdraw= zero_eur;
fee_deposit= zero_eur;
fee_refresh= zero_eur;
fee_refund= zero_eur;
2025-10-16 08:23:40 +02:00
cipher= `RSA;
2025-10-17 15:09:47 +02:00
rsa_keysize= 2048;
2025-10-16 08:23:40 +02:00
age_restricted= `NO;
}
2025-10-13 11:48:29 +02:00
2025-10-16 10:18:22 +02:00
let coin_kudo_2 =
{ coin_kudo_1 with section_name= "kudo_2"; value= amount "EUR:0.02" }
2025-10-16 08:23:40 +02:00
let coins = [ coin_kudo_1; coin_kudo_2 ]