mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-15 01:14:56 +00:00
53e4e7b95a
Bump nim-web3, nim-eth and deps - on_chain/group_manager.nim adaption Added status-im/nim-minilru submodule required by latest nim-eth Added nim-quic and nim-ngtcp2 as new deps of nim-libp2p Fixing tests. Changes: modified: .gitmodules modified: tests/waku_discv5/utils.nim modified: tests/waku_enr/utils.nim modified: tests/waku_rln_relay/test_rln_group_manager_onchain.nim modified: tests/waku_rln_relay/utils.nim modified: tests/waku_rln_relay/utils_onchain.nim modified: vendor/nim-chronicles modified: vendor/nim-eth modified: vendor/nim-http-utils modified: vendor/nim-json-rpc modified: vendor/nim-json-serialization modified: vendor/nim-libp2p modified: vendor/nim-metrics new file: vendor/nim-minilru modified: vendor/nim-nat-traversal new file: vendor/nim-ngtcp2 modified: vendor/nim-presto new file: vendor/nim-quic modified: vendor/nim-secp256k1 modified: vendor/nim-serialization modified: vendor/nim-stew modified: vendor/nim-taskpools modified: vendor/nim-testutils modified: vendor/nim-toml-serialization modified: vendor/nim-unicodedb modified: vendor/nim-unittest2 modified: vendor/nim-web3 modified: vendor/nim-websock modified: vendor/nim-zlib modified: vendor/nimcrypto modified: waku.nimble modified: waku/common/enr/builder.nim modified: waku/common/enr/typed_record.nim modified: waku/common/utils/nat.nim modified: waku/discovery/waku_discv5.nim modified: waku/waku_rln_relay/conversion_utils.nim modified: waku/waku_rln_relay/group_manager/on_chain/group_manager.nim modified: waku/waku_rln_relay/rln/wrappers.nim modified: waku/waku_rln_relay/rln_relay.nim
40 lines
967 B
Nim
40 lines
967 B
Nim
import
|
|
std/options,
|
|
stew/results,
|
|
stew/shims/net,
|
|
chronos,
|
|
libp2p/crypto/crypto as libp2p_keys,
|
|
eth/keys as eth_keys
|
|
|
|
import
|
|
waku/
|
|
[waku_core/topics, waku_enr, discovery/waku_discv5, node/peer_manager/peer_manager],
|
|
../testlib/[common, wakucore]
|
|
|
|
proc newTestDiscv5*(
|
|
privKey: libp2p_keys.PrivateKey,
|
|
bindIp: string,
|
|
tcpPort: uint16,
|
|
udpPort: uint16,
|
|
record: waku_enr.Record,
|
|
bootstrapRecords = newSeq[waku_enr.Record](),
|
|
queue = newAsyncEventQueue[SubscriptionEvent](30),
|
|
peerManager: Option[PeerManager] = none(PeerManager),
|
|
): WakuDiscoveryV5 =
|
|
let config = WakuDiscoveryV5Config(
|
|
privateKey: eth_keys.PrivateKey(privKey.skkey),
|
|
address: parseIpAddress(bindIp),
|
|
port: Port(udpPort),
|
|
bootstrapRecords: bootstrapRecords,
|
|
)
|
|
|
|
let discv5 = WakuDiscoveryV5.new(
|
|
rng = rng(),
|
|
conf = config,
|
|
record = some(record),
|
|
queue = queue,
|
|
peerManager = peerManager,
|
|
)
|
|
|
|
return discv5
|