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.MinProxBinSize = 2
|
||||
kp.MaxBinSize = 8
|
||||
kp.MinBinSize = 2
|
||||
kp.MaxBinSize = 4
|
||||
kp.MinBinSize = 1
|
||||
kp.MaxRetries = 1000
|
||||
kp.RetryExponent = 2
|
||||
kp.RetryInterval = 1000
|
||||
kp.PruneInterval = 2000
|
||||
kad := network.NewKademlia(addr.Over(), kp)
|
||||
|
||||
ticker := time.NewTicker(time.Duration(kad.PruneInterval) * time.Millisecond)
|
||||
kad.Prune(ticker.C)
|
||||
hp := network.NewHiveParams()
|
||||
hp.KeepAliveInterval = 3 * time.Second
|
||||
|
||||
|
|
@ -94,7 +96,7 @@ func setupMocker(net *simulations.Network) []*adapters.NodeId {
|
|||
conf := net.Config()
|
||||
conf.DefaultService = "overlay"
|
||||
|
||||
nodeCount := 50
|
||||
nodeCount := 60
|
||||
ids := make([]*adapters.NodeId, nodeCount)
|
||||
for i := 0; i < nodeCount; i++ {
|
||||
node, err := net.NewNode()
|
||||
|
|
|
|||
Loading…
Reference in a new issue