nwaku/examples/wakustealthcommitments/wakustealthcommitments.nim
Ivan FB fd6a71cdd7
chore: Bump dependencies for v0.31.0 (#2885)
* bump_dependencies.md: add nim-results dependency
* change imports stew/results to results
* switching to Nim 2.0.8
* waku.nimble: reflect the requirement nim 1.6.0 to 2.0.8
  Adding --mm:refc as nim 2.0 enables a new garbage collector that we're
  not yet ready to support
* adapt waku code to Nim 2.0
* gcsafe adaptations because Nim 2.0 is more strict
2024-07-09 13:14:28 +02:00

28 lines
827 B
Nim

{.push raises: [].}
import results, chronicles, ./node_spec as Waku, ./stealth_commitment_protocol as SCP
logScope:
topics = "waku stealthcommitments"
when isMainModule:
## Logging setup
setupLog(logging.LogLevel.NOTICE, logging.LogFormat.TEXT)
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)
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()