mirror of
https://github.com/logos-messaging/logos-chat.git
synced 2026-05-18 10:29:27 +00:00
chore: stop with waku node
This commit is contained in:
parent
a76af7b2c7
commit
09f2af49e9
@ -21,10 +21,6 @@ proc main() {.async.} =
|
|||||||
var cfg_saro = DefaultConfig()
|
var cfg_saro = DefaultConfig()
|
||||||
var cfg_raya = 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 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 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()
|
let raya_bundle = raya.createIntroBundle()
|
||||||
discard await saro.newPrivateConversation(raya_bundle)
|
discard await saro.newPrivateConversation(raya_bundle)
|
||||||
|
|
||||||
await sleepAsync(200.seconds) # Run for some time
|
await sleepAsync(20.seconds) # Run for some time
|
||||||
|
|
||||||
saro.stop()
|
saro.stop()
|
||||||
raya.stop()
|
raya.stop()
|
||||||
|
|||||||
@ -293,5 +293,6 @@ proc start*(client: Client) {.async.} =
|
|||||||
|
|
||||||
proc stop*(client: Client) =
|
proc stop*(client: Client) =
|
||||||
## Stop the client.
|
## Stop the client.
|
||||||
|
client.ds.stop()
|
||||||
client.isRunning = false
|
client.isRunning = false
|
||||||
notice "Client stopped", client = client.getId()
|
notice "Client stopped", client = client.getId()
|
||||||
|
|||||||
@ -72,8 +72,8 @@ type
|
|||||||
|
|
||||||
proc DefaultConfig*(): WakuConfig =
|
proc DefaultConfig*(): WakuConfig =
|
||||||
let nodeKey = crypto.PrivateKey.random(Secp256k1, crypto.newRng()[])[]
|
let nodeKey = crypto.PrivateKey.random(Secp256k1, crypto.newRng()[])[]
|
||||||
let clusterId = 19'u16
|
let clusterId = 16'u16
|
||||||
let shardId = 0'u16
|
let shardId = 32'u16
|
||||||
var port: uint16 = 50000'u16 + uint16(rand(200))
|
var port: uint16 = 50000'u16 + uint16(rand(200))
|
||||||
|
|
||||||
result = WakuConfig(nodeKey: nodeKey, port: port, clusterId: clusterId,
|
result = WakuConfig(nodeKey: nodeKey, port: port, clusterId: clusterId,
|
||||||
@ -162,7 +162,7 @@ proc start*(client: WakuClient) {.async.} =
|
|||||||
|
|
||||||
client.node.peerManager.start()
|
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 nameServer = parseIpAddress("1.1.1.1")
|
||||||
let discoveredPeers = await retrieveDynamicBootstrapNodes(dnsDiscoveryUrl, @[nameServer])
|
let discoveredPeers = await retrieveDynamicBootstrapNodes(dnsDiscoveryUrl, @[nameServer])
|
||||||
if discoveredPeers.isOk:
|
if discoveredPeers.isOk:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user