2024-06-28 10:34:57 +00:00
|
|
|
{.push raises: [].}
|
2024-03-06 13:14:33 +00:00
|
|
|
|
2024-07-09 11:14:28 +00:00
|
|
|
import results, chronicles, ./node_spec as Waku, ./stealth_commitment_protocol as SCP
|
2024-03-06 13:14:33 +00:00
|
|
|
|
|
|
|
logScope:
|
|
|
|
topics = "waku stealthcommitments"
|
|
|
|
|
|
|
|
when isMainModule:
|
|
|
|
## Logging setup
|
2024-05-17 14:28:54 +00:00
|
|
|
setupLog(logging.LogLevel.NOTICE, logging.LogFormat.TEXT)
|
2024-03-15 23:08:47 +00:00
|
|
|
|
2024-03-06 13:14:33 +00:00
|
|
|
info "Starting Waku Stealth Commitment Protocol"
|
|
|
|
info "Starting Waku Node"
|
|
|
|
let node = Waku.setup()
|
|
|
|
info "Waku Node started, listening for StealthCommitmentMessages"
|
|
|
|
let scp = SCP.new(node).valueOr:
|
|
|
|
error "Could not start Stealth Commitment Protocol", error = $error
|
|
|
|
quit(1)
|
2024-03-15 23:08:47 +00:00
|
|
|
|
2024-03-06 13:14:33 +00:00
|
|
|
try:
|
|
|
|
info "Sending stealth commitment request"
|
|
|
|
(waitFor scp.sendRequest()).isOkOr:
|
|
|
|
error "Could not send stealth commitment request", error = $error
|
|
|
|
except:
|
|
|
|
error "Could not send stealth commitment request", error = getCurrentExceptionMsg()
|
|
|
|
|
|
|
|
runForever()
|