diff options
author | holisticode <holistic.computing@gmail.com> | 2017-12-12 05:56:06 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-12-12 05:56:06 +0800 |
commit | 32516c768ec09e2a71cab5983d2c8b8ae5d92fc7 (patch) | |
tree | 9f02126fd6f219163776ad1ab8a8b924a32811a4 /swarm/network/kademlia/kademlia_test.go | |
parent | 1a32bdf92cceb7a42e5636e12d95609e17b8f786 (diff) | |
download | go-tangerine-32516c768ec09e2a71cab5983d2c8b8ae5d92fc7.tar.gz go-tangerine-32516c768ec09e2a71cab5983d2c8b8ae5d92fc7.tar.zst go-tangerine-32516c768ec09e2a71cab5983d2c8b8ae5d92fc7.zip |
cmd/swarm: add config file (#15548)
This commit adds a TOML configuration option to swarm. It reuses
the TOML configuration structure used in geth with swarm
customized items.
The commit:
* Adds a "dumpconfig" command to the swarm executable which
allows printing the (default) configuration to stdout, which
then can be redirected to a file in order to customize it.
* Adds a "--config <file>" option to the swarm executable which will
allow to load a configuration file in TOML format from the
specified location in order to initialize the Swarm node The
override priorities are like follows: environment variables
override command line arguments override config file override
default config.
Diffstat (limited to 'swarm/network/kademlia/kademlia_test.go')
-rw-r--r-- | swarm/network/kademlia/kademlia_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/swarm/network/kademlia/kademlia_test.go b/swarm/network/kademlia/kademlia_test.go index 417ccecae..88858908a 100644 --- a/swarm/network/kademlia/kademlia_test.go +++ b/swarm/network/kademlia/kademlia_test.go @@ -63,7 +63,7 @@ func TestOn(t *testing.T) { if !ok1 || !ok2 { t.Errorf("oops") } - kad := New(addr, NewKadParams()) + kad := New(addr, NewDefaultKadParams()) err := kad.On(&testNode{addr: other}, nil) _ = err } @@ -72,7 +72,7 @@ func TestBootstrap(t *testing.T) { test := func(test *bootstrapTest) bool { // for any node kad.le, Target and N - params := NewKadParams() + params := NewDefaultKadParams() params.MaxProx = test.MaxProx params.BucketSize = test.BucketSize params.ProxBinSize = test.BucketSize @@ -127,7 +127,7 @@ func TestFindClosest(t *testing.T) { test := func(test *FindClosestTest) bool { // for any node kad.le, Target and N - params := NewKadParams() + params := NewDefaultKadParams() params.MaxProx = 7 kad := New(test.Self, params) var err error @@ -198,7 +198,7 @@ var ( func TestProxAdjust(t *testing.T) { r := rand.New(rand.NewSource(time.Now().UnixNano())) self := gen(Address{}, r).(Address) - params := NewKadParams() + params := NewDefaultKadParams() params.MaxProx = 7 kad := New(self, params) @@ -232,7 +232,7 @@ func TestSaveLoad(t *testing.T) { r := rand.New(rand.NewSource(time.Now().UnixNano())) addresses := gen([]Address{}, r).([]Address) self := RandomAddress() - params := NewKadParams() + params := NewDefaultKadParams() params.MaxProx = 7 kad := New(self, params) |