mirror of
https://github.com/status-im/go-waku.git
synced 2025-02-10 12:36:35 +00:00
Pass bootnodes to discovery
This commit is contained in:
parent
685142e7b7
commit
ebaf10601f
@ -8,9 +8,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
|
||||||
"github.com/ethereum/go-ethereum/p2p/enr"
|
|
||||||
"github.com/ethereum/go-ethereum/p2p/nat"
|
|
||||||
"github.com/libp2p/go-libp2p/core/discovery"
|
"github.com/libp2p/go-libp2p/core/discovery"
|
||||||
"github.com/libp2p/go-libp2p/core/host"
|
"github.com/libp2p/go-libp2p/core/host"
|
||||||
"github.com/libp2p/go-libp2p/core/peer"
|
"github.com/libp2p/go-libp2p/core/peer"
|
||||||
@ -18,6 +15,10 @@ import (
|
|||||||
"github.com/waku-org/go-waku/logging"
|
"github.com/waku-org/go-waku/logging"
|
||||||
"github.com/waku-org/go-waku/waku/v2/utils"
|
"github.com/waku-org/go-waku/waku/v2/utils"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||||
|
"github.com/ethereum/go-ethereum/p2p/enr"
|
||||||
|
"github.com/ethereum/go-ethereum/p2p/nat"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiscoveryV5 struct {
|
type DiscoveryV5 struct {
|
||||||
|
@ -8,11 +8,12 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/libp2p/go-libp2p"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||||
"github.com/libp2p/go-libp2p"
|
|
||||||
"go.uber.org/zap"
|
|
||||||
|
|
||||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||||
"github.com/libp2p/go-libp2p/core/event"
|
"github.com/libp2p/go-libp2p/core/event"
|
||||||
@ -673,6 +674,12 @@ func (w *WakuNode) PeerStats() PeerStats {
|
|||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the bootnodes on discv5
|
||||||
|
func (w *WakuNode) SetDiscV5Bootnodes(nodes []*enode.Node) error {
|
||||||
|
w.opts.discV5bootnodes = nodes
|
||||||
|
return w.discoveryV5.SetBootnodes(nodes)
|
||||||
|
}
|
||||||
|
|
||||||
// Peers return the list of peers, addresses, protocols supported and connection status
|
// Peers return the list of peers, addresses, protocols supported and connection status
|
||||||
func (w *WakuNode) Peers() ([]*Peer, error) {
|
func (w *WakuNode) Peers() ([]*Peer, error) {
|
||||||
var peers []*Peer
|
var peers []*Peer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user