This commit is contained in:
swrup 2025-11-28 18:10:38 +01:00
parent 1cb9d3e60b
commit cf52637724
3 changed files with 14 additions and 8 deletions

View file

@ -14,7 +14,7 @@ db = postgres
attribute_encryption_key = "deadbeef" attribute_encryption_key = "deadbeef"
port = 3434 port = 3434
bind_to = localhost bind_to = localhost
master_public_key = "8MQF2XPWCKCW4199JFPE08X7Y9XAX21SF2HD8NZKXM3PY3CMCJ90====" master_public_key = "SJ0NYND22VQP3MP7FM754RDX8HCKVWAXTHY9SQNBTPRJZ2SPM2S0===="
stefan_abs = EUR:0.00 stefan_abs = EUR:0.00
stefan_log = EUR:0.00 stefan_log = EUR:0.00
stefan_lin = 0.00 stefan_lin = 0.00

Binary file not shown.

View file

@ -3,6 +3,7 @@
- setup - setup
- sign *) - sign *)
(* doc: https://docs.taler.net/manpages/taler-exchange-offline.1.html *) (* doc: https://docs.taler.net/manpages/taler-exchange-offline.1.html *)
let version = "%%VERSION%%"
let download ~base_url ~output = let download ~base_url ~output =
let open Bos in let open Bos in
@ -53,7 +54,7 @@ let setup_cmd =
& opt filepath "data/eddsa_master_offline" & opt filepath "data/eddsa_master_offline"
& info [ "o"; "output" ] ~doc) & info [ "o"; "output" ] ~doc)
in in
Cmd.make (Cmd.info "setup" ~version:"%%VERSION%%" ~doc) Cmd.make (Cmd.info "setup" ~version ~doc)
@@ @@
let+ output = output in let+ output = output in
match setup ~output with match setup ~output with
@ -75,7 +76,7 @@ let download_cmd =
let doc = "Base url of the exchange." in let doc = "Base url of the exchange." in
Arg.(value & opt string "http://localhost:3434/" & info [ "base-url" ] ~doc) Arg.(value & opt string "http://localhost:3434/" & info [ "base-url" ] ~doc)
in in
Cmd.make (Cmd.info "download" ~version:"%%VERSION%%" ~doc ~man) Cmd.make (Cmd.info "download" ~version ~doc ~man)
@@ @@
let+ output = output and+ base_url = base_url in let+ output = output and+ base_url = base_url in
match download ~base_url ~output with match download ~base_url ~output with
@ -104,7 +105,7 @@ let sign_cmd =
& opt filepath "data/eddsa_master_offline" & opt filepath "data/eddsa_master_offline"
& info [ "master-key" ] ~doc) & info [ "master-key" ] ~doc)
in in
Cmd.make (Cmd.info "sign" ~version:"%%VERSION%%" ~doc) Cmd.make (Cmd.info "sign" ~version ~doc)
@@ @@
let+ input = input and+ output = output and+ master_key = master_key in let+ input = input and+ output = output and+ master_key = master_key in
match sign ~input ~output ~master_key with match sign ~input ~output ~master_key with
@ -113,7 +114,12 @@ let sign_cmd =
exit 1 exit 1
| Ok () -> () | Ok () -> ()
let main () = Cmd.eval setup_cmd let cli =
let _main () = Cmd.eval download_cmd let info =
let __main () = Cmd.eval sign_cmd let doc = "MTE Offline CLI tool" in
let () = if !Sys.interactive then () else exit (main ()) Cmd.info "mte-offline" ~version ~doc
in
Cmd.group info [ setup_cmd; download_cmd; sign_cmd ]
let main () = Cmd.eval cli
let () = exit (main ())