diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-01-24 19:02:18 +0800 |
---|---|---|
committer | Rafael Matias <rafael@skyle.net> | 2019-02-19 19:56:30 +0800 |
commit | 4976fcc91a43b5c7047c51a03985887b694f0fbb (patch) | |
tree | c2aef8ce616498f44d38a6a830c211112e0a6d71 /swarm/network/protocol.go | |
parent | 878aa58ec66ffc541a80aa65ee35261efa086c9c (diff) | |
download | dexon-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar dexon-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.gz dexon-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.bz2 dexon-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.lz dexon-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.xz dexon-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.zst dexon-4976fcc91a43b5c7047c51a03985887b694f0fbb.zip |
swarm: bootnode-mode, new bootnodes and no p2p package discovery (#18498)
(cherry picked from commit bbd120354a8d226b446591eeda9f9462cb9b690a)
Diffstat (limited to 'swarm/network/protocol.go')
-rw-r--r-- | swarm/network/protocol.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/swarm/network/protocol.go b/swarm/network/protocol.go index 74e7de126..6f8eadad2 100644 --- a/swarm/network/protocol.go +++ b/swarm/network/protocol.go @@ -67,6 +67,7 @@ type BzzConfig struct { HiveParams *HiveParams NetworkID uint64 LightNode bool + BootnodeMode bool } // Bzz is the swarm protocol bundle @@ -87,7 +88,7 @@ type Bzz struct { // * overlay driver // * peer store func NewBzz(config *BzzConfig, kad *Kademlia, store state.Store, streamerSpec *protocols.Spec, streamerRun func(*BzzPeer) error) *Bzz { - return &Bzz{ + bzz := &Bzz{ Hive: NewHive(config.HiveParams, kad, store), NetworkID: config.NetworkID, LightNode: config.LightNode, @@ -96,6 +97,13 @@ func NewBzz(config *BzzConfig, kad *Kademlia, store state.Store, streamerSpec *p streamerRun: streamerRun, streamerSpec: streamerSpec, } + + if config.BootnodeMode { + bzz.streamerRun = nil + bzz.streamerSpec = nil + } + + return bzz } // UpdateLocalAddr updates underlayaddress of the running node |