Files
2026-12-04 11:03:04 -08:00

32 lines
834 B
Plaintext

contract Sbn =
record sp =
{ip : string,
port : int,
protocol : string, // "tcp", "udp", "sctp", etc
noise : string, // Noise_Foo_Bar_Baz_Quux
pubkey : address, // responder static pubkey (noise: rs field)
prologue : bytes} // noise prologue (empty = no prologue)
type state = map(string, list(sp))
entrypoint
init : () => state
init() = {}
stateful entrypoint
register : (string, list(sp)) => bool
register(name, roster) =
put(state{[name] = roster})
true
stateful entrypoint
lookup : (string) => option(list(rp))
lookup(name) =
Map.lookup(name, state)
stateful entrypoint
get_state : state
get_state() =
state