Update examples

This commit is contained in:
Jazz Turner-Baggs 2025-12-16 23:39:08 -08:00
parent d0a655ee1f
commit ef1f2fc18a
No known key found for this signature in database
2 changed files with 6 additions and 9 deletions

View File

@ -7,10 +7,9 @@ import chat
import content_types
proc main() {.async.} =
let dsConfig = DefaultConfig()
let waku = initWakuClient(DefaultConfig())
let ident = createIdentity("EchoBot")
var chatClient = newClient(dsConfig, ident)
var chatClient = newClient(waku, ident)
chatClient.onNewMessage(proc(convo: Conversation, msg: ReceivedMessage) {.async.} =
info "New Message: ", convoId = convo.id(), msg= msg

View File

@ -25,17 +25,15 @@ proc fromBytes(bytes: seq[byte]): ContentFrame =
proc main() {.async.} =
# Create Configurations
var cfg_saro = DefaultConfig()
var cfg_raya = DefaultConfig()
var waku_saro = initWakuClient(DefaultConfig())
var waku_raya = initWakuClient(DefaultConfig())
let sKey = loadPrivateKeyFromBytes(@[45u8, 216, 160, 24, 19, 207, 193, 214, 98, 92, 153, 145, 222, 247, 101, 99, 96, 131, 149, 185, 33, 187, 229, 251, 100, 158, 20, 131, 111, 97, 181, 210]).get()
let rKey = loadPrivateKeyFromBytes(@[43u8, 12, 160, 51, 212, 90, 199, 160, 154, 164, 129, 229, 147, 69, 151, 17, 239, 51, 190, 33, 86, 164, 50, 105, 39, 250, 182, 116, 138, 132, 114, 234]).get()
let sIdent = Identity(name: "saro", privateKey: sKey)
# Create Clients
var saro = newClient(cfg_saro, sIdent)
var raya = newClient(cfg_raya, Identity(name: "raya", privateKey: rKey))
var saro = newClient(waku_saro, Identity(name: "saro", privateKey: sKey))
var raya = newClient(waku_raya, Identity(name: "raya", privateKey: rKey))
var ri = 0
# Wire Callbacks