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

View file

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

Binary file not shown.

View file

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