chore(enr): move waku_enr to protocols module

This commit is contained in:
Lorenzo Delgado 2023-03-07 10:52:12 +01:00 committed by GitHub
parent 0bf8d573a7
commit d5f93e385d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 18 deletions

View File

@ -41,11 +41,11 @@ import
../../waku/v2/protocol/waku_store,
../../waku/v2/protocol/waku_filter,
../../waku/v2/protocol/waku_lightpush,
../../waku/v2/protocol/waku_enr,
../../waku/v2/protocol/waku_dnsdisc,
../../waku/v2/protocol/waku_discv5,
../../waku/v2/protocol/waku_peer_exchange,
../../waku/v2/utils/peers,
../../waku/v2/utils/wakuenr,
./wakunode2_setup_rest,
./wakunode2_setup_rpc,
./config

View File

@ -14,9 +14,9 @@ import
../../../waku/v2/node/peer_manager,
../../../waku/v2/node/waku_node,
../../../waku/v2/protocol/waku_message,
../../../waku/v2/protocol/waku_enr,
../../../waku/v2/protocol/waku_discv5,
../../../waku/v2/utils/time,
../../../waku/v2/utils/wakuenr
../../../waku/v2/utils/time
proc now*(): Timestamp =
getNanosecondTime(getTime().toUnixFloat())

View File

@ -14,8 +14,8 @@ import
../../../waku/v2/node/peer_manager,
../../../waku/v2/node/waku_node,
../../../waku/v2/protocol/waku_message,
../../../waku/v2/protocol/waku_discv5,
../../../waku/v2/utils/wakuenr
../../../waku/v2/protocol/waku_enr,
../../../waku/v2/protocol/waku_discv5
# An accesible bootstrap node. See wakuv2.prod fleets.status.im
const bootstrapNodes = @["enr:-Nm4QOdTOKZJKTUUZ4O_W932CXIET-M9NamewDnL78P5u9DOGnZlK0JFZ4k0inkfe6iY-0JAaJVovZXc575VV3njeiABgmlkgnY0gmlwhAjS3ueKbXVsdGlhZGRyc7g6ADg2MW5vZGUtMDEuYWMtY24taG9uZ2tvbmctYy53YWt1djIucHJvZC5zdGF0dXNpbS5uZXQGH0DeA4lzZWNwMjU2azGhAo0C-VvfgHiXrxZi3umDiooXMGY9FvYj5_d1Q4EeS7eyg3RjcIJ2X4N1ZHCCIyiFd2FrdTIP"]

View File

@ -55,9 +55,9 @@ import
./v2/test_peer_manager,
./v2/test_peer_storage,
./v2/test_waku_keepalive,
./v2/test_waku_enr,
./v2/test_waku_dnsdisc,
./v2/test_waku_discv5,
./v2/test_enr_utils,
./v2/test_peer_exchange,
./v2/test_waku_noise,
./v2/test_waku_noise_sessions,

View File

@ -2,14 +2,13 @@
import
std/[options, sequtils],
chronos,
stew/byteutils,
testutils/unittests
import
../../waku/v2/utils/wakuenr,
../../waku/v2/protocol/waku_enr,
./testlib/waku2
procSuite "ENR utils":
suite "Waku ENR":
test "Parse multiaddr field":
let

View File

@ -23,10 +23,10 @@ import
../../waku/v2/node/peer_manager,
../../waku/v2/node/waku_node,
../../waku/v2/protocol/waku_message,
../../waku/v2/protocol/waku_enr,
../../waku/v2/protocol/waku_discv5,
../../waku/v2/protocol/waku_dnsdisc,
../../waku/v2/utils/peers,
../../waku/v2/utils/wakuenr,
./networkmonitor_metrics,
./networkmonitor_config,
./networkmonitor_utils

View File

@ -35,11 +35,11 @@ import
../protocol/waku_filter/client as filter_client,
../protocol/waku_lightpush,
../protocol/waku_lightpush/client as lightpush_client,
../protocol/waku_enr,
../protocol/waku_dnsdisc,
../protocol/waku_discv5,
../protocol/waku_peer_exchange,
../utils/peers,
../utils/wakuenr,
../utils/time,
./peer_manager,
./wakuswitch

View File

@ -15,9 +15,9 @@ import
eth/p2p/discoveryv5/protocol
import
../utils/peers,
../utils/wakuenr
./waku_enr
export protocol, wakuenr
export protocol, waku_enr
declarePublicGauge waku_discv5_discovered, "number of nodes discovered"

View File

@ -2,17 +2,19 @@
## Implemented according to the specified Waku v2 ENR usage
## More at https://rfc.vac.dev/spec/31/
{.push raises: [Defect]}
when (NimMajor, NimMinor) < (1, 4):
{.push raises: [Defect].}
else:
{.push raises: [].}
import
std/[bitops, sequtils],
stew/[endians2, results],
stew/shims/net,
eth/keys,
eth/p2p/discoveryv5/enr,
libp2p/[multiaddress, multicodec],
libp2p/crypto/crypto,
stew/[endians2, results],
stew/shims/net,
std/bitops
libp2p/crypto/crypto
export enr, crypto, multiaddress, net