Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swarm: bootnode-mode, new bootnodes and no p2p package discovery #18498

Merged
merged 27 commits into from
Jan 24, 2019
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d843e37
cmd/swarm, swarm: add bootnode mode
nonsense Jan 18, 2019
8ca21e9
swarm: rename self to s
nonsense Jan 18, 2019
7dd37e6
p2p: disable random node dialing
nonsense Jan 18, 2019
314a180
p2p: remove further random dials
nonsense Jan 18, 2019
2131b62
swarm: enable both bzz and hive
nonsense Jan 18, 2019
1a02c4c
p2p: traces
nonsense Jan 18, 2019
dcc389a
p2p: revert back lookup discovery task
nonsense Jan 18, 2019
3551ef0
swarm: hack to always connect to bootnodes
nonsense Jan 18, 2019
537592a
p2p: revert
nonsense Jan 18, 2019
92c43bc
check for stream in caps on kademlia.On
nonsense Jan 18, 2019
160308b
swarm/network: remove stream cap check in kademlia On function
janos Jan 21, 2019
647effc
swarm/network/stream: check for peer stream cap in delivery and sync
janos Jan 21, 2019
6072822
cmd/swarm, swarm/network: always set nodiscover option
nonsense Jan 21, 2019
3029a82
swarm/network: check stream and pss caps in Hive.Run
janos Jan 21, 2019
ca93204
cmd/swarm: fix NoDiscovery setting
nonsense Jan 21, 2019
94b3b05
swarm/network: revert: check stream and pss caps in Hive.Run
janos Jan 21, 2019
6dd6fa1
cmd/swarm/swarm-smoke: add support for internal endpoints
nonsense Jan 22, 2019
425acb3
p2p/protocols, swarm/network/stream: add protocols.Peer.HasCap
janos Jan 22, 2019
653cfcb
p2p/protocols: handle possible nil Peer in HasCap
janos Jan 22, 2019
508f743
cmd/swarm: remove -nodiscovery flag from tests
janos Jan 22, 2019
c4fb3e9
cmd/swarm: add new bootnodes
nonsense Jan 22, 2019
99eea1c
p2p/protocols: fix a typo in comment
janos Jan 22, 2019
1ded87e
swarm/network: add error if we reach weird condition
nonsense Jan 22, 2019
5ebb9f1
Merge branch 'swarm-bootnode-2-no-discovery' of https://github.com/et…
nonsense Jan 22, 2019
b577b2f
cmd/swarm: add bzzkey to print-keys
nonsense Jan 23, 2019
c1cd442
swarm/storage: remove Debug calls
nonsense Jan 23, 2019
85f4cba
cmd/swarm: do not print bzz on --compressed
nonsense Jan 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
check for stream in caps on kademlia.On
nonsense committed Jan 18, 2019
commit 92c43bca9c2bca763c4dc6e977ef0534e8411e64
16 changes: 16 additions & 0 deletions swarm/network/kademlia.go
Original file line number Diff line number Diff line change
@@ -283,6 +283,22 @@ func (k *Kademlia) SuggestPeer() (suggestedPeer *BzzAddr, saturationDepth int, c
func (k *Kademlia) On(p *Peer) (uint8, bool) {
k.lock.Lock()
defer k.lock.Unlock()

caps := p.Caps()

var found bool
for _, c := range caps {
if c.Name == "stream" {
found = true
break
}
}

if !found {
depth := uint8(k.saturation())
return depth, false
}

var ins bool
k.conns, _, _, _ = pot.Swap(k.conns, p, Pof, func(v pot.Val) pot.Val {
// if not found live