chore: stop with waku node

This commit is contained in:
kaichaosun 2025-12-03 17:34:58 +08:00
parent a76af7b2c7
commit 09f2af49e9
No known key found for this signature in database
GPG Key ID: 223E0F992F4F03BF
3 changed files with 5 additions and 8 deletions

View File

@ -21,10 +21,6 @@ proc main() {.async.} =
var cfg_saro = DefaultConfig()
var cfg_raya = DefaultConfig()
# Cross pollinate Peers - No Waku discovery is used in this example
# cfg_saro.staticPeers.add(cfg_raya.getMultiAddr())
# cfg_raya.staticPeers.add(cfg_saro.getMultiAddr())
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()
@ -79,7 +75,7 @@ proc main() {.async.} =
let raya_bundle = raya.createIntroBundle()
discard await saro.newPrivateConversation(raya_bundle)
await sleepAsync(200.seconds) # Run for some time
await sleepAsync(20.seconds) # Run for some time
saro.stop()
raya.stop()

View File

@ -293,5 +293,6 @@ proc start*(client: Client) {.async.} =
proc stop*(client: Client) =
## Stop the client.
client.ds.stop()
client.isRunning = false
notice "Client stopped", client = client.getId()

View File

@ -72,8 +72,8 @@ type
proc DefaultConfig*(): WakuConfig =
let nodeKey = crypto.PrivateKey.random(Secp256k1, crypto.newRng()[])[]
let clusterId = 19'u16
let shardId = 0'u16
let clusterId = 16'u16
let shardId = 32'u16
var port: uint16 = 50000'u16 + uint16(rand(200))
result = WakuConfig(nodeKey: nodeKey, port: port, clusterId: clusterId,
@ -162,7 +162,7 @@ proc start*(client: WakuClient) {.async.} =
client.node.peerManager.start()
let dnsDiscoveryUrl = "enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im"
let dnsDiscoveryUrl = "enrtree://AI4W5N5IFEUIHF5LESUAOSMV6TKWF2MB6GU2YK7PU4TYUGUNOCEPW@boot.staging.status.nodes.status.im"
let nameServer = parseIpAddress("1.1.1.1")
let discoveredPeers = await retrieveDynamicBootstrapNodes(dnsDiscoveryUrl, @[nameServer])
if discoveredPeers.isOk: