mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
swarm/network/simulations: overlay
This commit is contained in:
parent
45769c54d9
commit
02f6b66e8b
1 changed files with 6 additions and 4 deletions
|
|
@ -46,13 +46,15 @@ func (s *Simulation) NewService(id *adapters.NodeId, snapshot []byte) []node.Ser
|
||||||
|
|
||||||
kp := network.NewKadParams()
|
kp := network.NewKadParams()
|
||||||
kp.MinProxBinSize = 2
|
kp.MinProxBinSize = 2
|
||||||
kp.MaxBinSize = 8
|
kp.MaxBinSize = 4
|
||||||
kp.MinBinSize = 2
|
kp.MinBinSize = 1
|
||||||
kp.MaxRetries = 1000
|
kp.MaxRetries = 1000
|
||||||
kp.RetryExponent = 2
|
kp.RetryExponent = 2
|
||||||
kp.RetryInterval = 1000
|
kp.RetryInterval = 1000
|
||||||
|
kp.PruneInterval = 2000
|
||||||
kad := network.NewKademlia(addr.Over(), kp)
|
kad := network.NewKademlia(addr.Over(), kp)
|
||||||
|
ticker := time.NewTicker(time.Duration(kad.PruneInterval) * time.Millisecond)
|
||||||
|
kad.Prune(ticker.C)
|
||||||
hp := network.NewHiveParams()
|
hp := network.NewHiveParams()
|
||||||
hp.KeepAliveInterval = 3 * time.Second
|
hp.KeepAliveInterval = 3 * time.Second
|
||||||
|
|
||||||
|
|
@ -94,7 +96,7 @@ func setupMocker(net *simulations.Network) []*adapters.NodeId {
|
||||||
conf := net.Config()
|
conf := net.Config()
|
||||||
conf.DefaultService = "overlay"
|
conf.DefaultService = "overlay"
|
||||||
|
|
||||||
nodeCount := 50
|
nodeCount := 60
|
||||||
ids := make([]*adapters.NodeId, nodeCount)
|
ids := make([]*adapters.NodeId, nodeCount)
|
||||||
for i := 0; i < nodeCount; i++ {
|
for i := 0; i < nodeCount; i++ {
|
||||||
node, err := net.NewNode()
|
node, err := net.NewNode()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue