From 2817d71fea17818dc411beb7b8624f6396e4618e Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 28 Feb 2022 14:28:09 -0400 Subject: [PATCH] feat: use `d5waku` as ProtocolID for DiscV5 (#196) --- examples/basic2/go.sum | 4 ++-- examples/chat2/go.sum | 4 ++-- examples/filter2/go.sum | 4 ++-- go.mod | 2 +- go.sum | 2 ++ waku/v2/discv5/discover.go | 3 +++ 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/basic2/go.sum b/examples/basic2/go.sum index 301b2325..1eb88231 100644 --- a/examples/basic2/go.sum +++ b/examples/basic2/go.sum @@ -1054,8 +1054,8 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= -github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429 h1:9WvvSmX33Cng0sldAFmnkB9yzsfs5tSHP4BpM2NFTB0= -github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe h1:Wz82CcseYsvh71f5tbomwjOc3lMohohqjyvfOhplLsI= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432 h1:cbNFU38iimo9fY4B7CdF/fvIF6tNPJIZjBbpfmW2EY4= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432/go.mod h1:A8t3i0CUGtXCA0aiLsP7iyikmk/KaD/2XVvNJqGCU20= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= diff --git a/examples/chat2/go.sum b/examples/chat2/go.sum index 1a5ccdea..99d21a25 100644 --- a/examples/chat2/go.sum +++ b/examples/chat2/go.sum @@ -1071,8 +1071,8 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= -github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429 h1:9WvvSmX33Cng0sldAFmnkB9yzsfs5tSHP4BpM2NFTB0= -github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe h1:Wz82CcseYsvh71f5tbomwjOc3lMohohqjyvfOhplLsI= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432 h1:cbNFU38iimo9fY4B7CdF/fvIF6tNPJIZjBbpfmW2EY4= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432/go.mod h1:A8t3i0CUGtXCA0aiLsP7iyikmk/KaD/2XVvNJqGCU20= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= diff --git a/examples/filter2/go.sum b/examples/filter2/go.sum index 301b2325..1eb88231 100644 --- a/examples/filter2/go.sum +++ b/examples/filter2/go.sum @@ -1054,8 +1054,8 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= -github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429 h1:9WvvSmX33Cng0sldAFmnkB9yzsfs5tSHP4BpM2NFTB0= -github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe h1:Wz82CcseYsvh71f5tbomwjOc3lMohohqjyvfOhplLsI= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432 h1:cbNFU38iimo9fY4B7CdF/fvIF6tNPJIZjBbpfmW2EY4= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432/go.mod h1:A8t3i0CUGtXCA0aiLsP7iyikmk/KaD/2XVvNJqGCU20= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= diff --git a/go.mod b/go.mod index 883822bd..b63a1362 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/mattn/go-sqlite3 v1.14.6 github.com/minio/sha256-simd v1.0.0 github.com/multiformats/go-multiaddr v0.4.0 - github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429 + github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/go.sum b/go.sum index fa8e30c9..03bc3580 100644 --- a/go.sum +++ b/go.sum @@ -1078,6 +1078,8 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429 h1:9WvvSmX33Cng0sldAFmnkB9yzsfs5tSHP4BpM2NFTB0= github.com/status-im/go-discover v0.0.0-20211207185514-87bd8c3fe429/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe h1:Wz82CcseYsvh71f5tbomwjOc3lMohohqjyvfOhplLsI= +github.com/status-im/go-discover v0.0.0-20220220162124-91b97a3e0efe/go.mod h1:sfq3nyUDYY7Z4SnmDZ/KxTNj/7vu+Eyp4bsm1Hfj1QQ= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432 h1:cbNFU38iimo9fY4B7CdF/fvIF6tNPJIZjBbpfmW2EY4= github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432/go.mod h1:A8t3i0CUGtXCA0aiLsP7iyikmk/KaD/2XVvNJqGCU20= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= diff --git a/waku/v2/discv5/discover.go b/waku/v2/discv5/discover.go index b7a4a396..0f4de41c 100644 --- a/waku/v2/discv5/discover.go +++ b/waku/v2/discv5/discover.go @@ -132,6 +132,9 @@ func NewDiscoveryV5(host host.Host, ipAddr net.IP, tcpPort int, priv *ecdsa.Priv // TODO: track https://github.com/status-im/nim-waku/issues/770 for improvements over validation func return evaluateNode(&n) }, + V5Config: discover.V5Config{ + ProtocolID: [6]byte{'d', '5', 'w', 'a', 'k', 'u'}, + }, }, udpAddr: &net.UDPAddr{ IP: net.IPv4zero,