mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-09 14:26:27 +00:00
9518322198
* Change folder structure to {v1,v2,common}/... Addresses https://github.com/status-im/nim-waku/issues/261 * Update waku.nimble paths * Flatten paths * Fix import paths * Pull out utils folder for nat * Pull out waku_types to top level for v2 * Fix test import paths * Remove old READMEs and replace with one liner * Update README and split v1 and v2 * Skeleton READMEs * Update README.md Co-authored-by: Kim De Mey <kim.demey@gmail.com> * Update README.md Co-authored-by: Kim De Mey <kim.demey@gmail.com> Co-authored-by: Kim De Mey <kim.demey@gmail.com>
17 lines
599 B
Nim
17 lines
599 B
Nim
import
|
|
chronos,
|
|
eth/[p2p, async_utils], eth/p2p/peer_pool
|
|
|
|
proc setBootNodes*(nodes: openArray[string]): seq[ENode] =
|
|
result = newSeqOfCap[ENode](nodes.len)
|
|
for nodeId in nodes:
|
|
# TODO: something more user friendly than an expect
|
|
result.add(ENode.fromString(nodeId).expect("correct node"))
|
|
|
|
proc connectToNodes*(node: EthereumNode, nodes: openArray[string]) =
|
|
for nodeId in nodes:
|
|
# TODO: something more user friendly than an assert
|
|
let whisperENode = ENode.fromString(nodeId).expect("correct node")
|
|
|
|
traceAsyncErrors node.peerPool.connectToNode(newNode(whisperENode))
|