Upsycle_router.CommonsContains shared types and values which are used throughout the application.
type 'a rresult = ('a, result_msg) Stdlib.resulttype 'a of_yaml = Yaml.value -> 'a rresultThese are the base types we use for private and public keys; no need to try and hide the implementation.
Used for choosing the Blake2 hash function for calculating message IDs.
When the message router receives a JOIN request whose src field doesn't match the actual public key of the peer, it needs to decide which one to actually add to the group. By default this is set to `Src in the configurations, but `Peerkey can be useful for testing or experimenting.
Configures whether or not to dump the contents of every message received by the message router to the console.
type multicast_table =
(multicast_group_pubkey, multicast_subscriber BatSet.t) BatMap.tThe functions in T are just function versions of the constructors of various types, which provides a convenient way of constructing types in many situations.
module T : sig ... endmodule Pp : sig ... endmodule Encode : sig ... endmodule Decode : sig ... endmodule Crypto : sig ... endmodule Yaml : sig ... endmodule Mk : sig ... endmodule Acc : sig ... endProvides handlers for the keys 'q', '\n', and an unknown key press, to be used in the key thread.
Returns a random integer for use in the `ttl` field.
mk_random_ttl `Short produces an integer in the range [3, 10].
mk_random_ttl `Medium produces an integer in the range [10, 30].
Returns a random integer representing minutes elapsed since 2020-01-01 00:00 UTC, for use in the `expiry` field.
Returns a random integer in the range [0, 19], for use in the `revision` field.
val to_yaml_noop : 'a Util_yaml.to_yamlppx_deriving_yaml requires both an x_to_yaml and x_of_yaml function for a type x in order to be able produce derivations for types which include x. However the 'of_yaml' variant is never used in this library so there's no sense in writing it; this function can be provided instead to satisfy the requirements.
val error_msg : string -> string rresultConvenience for generating Error (`Msg s) from a string s.
val pubkey_of_multicast_group : multicast_group -> pubkeyval string_list_of_command : command -> string list