-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.ml
35 lines (30 loc) · 887 Bytes
/
config.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
open Mirage
let net =
if_impl Key.is_unix
(socket_stackv4 [Ipaddr.V4.any])
(static_ipv4_stack ~arp:farp default_network)
let secret_k =
let doc = Key.Arg.info ~doc:"Secret" ["s"; "secret"] in
Key.(create "secret" Arg.(opt string ".oO( SEKRIT )Oo." doc))
let test_k =
let doc = Key.Arg.info ~doc:"test mode" ["test"] in
Key.(create "test" Arg.(flag doc))
let logger = syslog_udp ~config:(syslog_config ~truncate:1484 "pinata") net
let () =
let keys = Key.([ abstract secret_k ; abstract test_k ])
and packages = [
package ~sublibs:["mirage"] "tls";
package "tyxml";
package "logs";
package "ptime"]
in
register "btc-piñata" [
foreign
~deps:[ abstract nocrypto ; abstract logger ; abstract app_info ]
~keys
~packages
"Unikernel.Main"
(stackv4 @-> pclock @-> job)
$ net
$ default_posix_clock
]