diff options
author | Elad <theman@elad.im> | 2018-06-14 17:21:17 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-06-14 17:21:17 +0800 |
commit | 1836366ac19e30f157570e61342fae53bc6c8a57 (patch) | |
tree | a95b5027602d17315cd6462f7c08ac4123c9099d /p2p/simulations/adapters/docker.go | |
parent | 591cef17d4f1700de50057fd6988b9731a2195c9 (diff) | |
download | dexon-1836366ac19e30f157570e61342fae53bc6c8a57.tar dexon-1836366ac19e30f157570e61342fae53bc6c8a57.tar.gz dexon-1836366ac19e30f157570e61342fae53bc6c8a57.tar.bz2 dexon-1836366ac19e30f157570e61342fae53bc6c8a57.tar.lz dexon-1836366ac19e30f157570e61342fae53bc6c8a57.tar.xz dexon-1836366ac19e30f157570e61342fae53bc6c8a57.tar.zst dexon-1836366ac19e30f157570e61342fae53bc6c8a57.zip |
all: library changes for swarm-network-rewrite (#16898)
This commit adds all changes needed for the merge of swarm-network-rewrite.
The changes:
- build: increase linter timeout
- contracts/ens: export ensNode
- log: add Output method and enable fractional seconds in format
- metrics: relax test timeout
- p2p: reduced some log levels, updates to simulation packages
- rpc: increased maxClientSubscriptionBuffer to 20000
Diffstat (limited to 'p2p/simulations/adapters/docker.go')
-rw-r--r-- | p2p/simulations/adapters/docker.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/p2p/simulations/adapters/docker.go b/p2p/simulations/adapters/docker.go index 8ef5629fb..d145c46b3 100644 --- a/p2p/simulations/adapters/docker.go +++ b/p2p/simulations/adapters/docker.go @@ -28,11 +28,14 @@ import ( "strings" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p/discover" ) +var ( + ErrLinuxOnly = errors.New("DockerAdapter can only be used on Linux as it uses the current binary (which must be a Linux binary)") +) + // DockerAdapter is a NodeAdapter which runs simulation nodes inside Docker // containers. // @@ -52,7 +55,7 @@ func NewDockerAdapter() (*DockerAdapter, error) { // It is reasonable to require this because the caller can just // compile the current binary in a Docker container. if runtime.GOOS != "linux" { - return nil, errors.New("DockerAdapter can only be used on Linux as it uses the current binary (which must be a Linux binary)") + return nil, ErrLinuxOnly } if err := buildDockerImage(); err != nil { @@ -95,7 +98,10 @@ func (d *DockerAdapter) NewNode(config *NodeConfig) (Node, error) { conf.Stack.P2P.NoDiscovery = true conf.Stack.P2P.NAT = nil conf.Stack.NoUSB = true - conf.Stack.Logger = log.New("node.id", config.ID.String()) + + // listen on all interfaces on a given port, which we set when we + // initialise NodeConfig (usually a random port) + conf.Stack.P2P.ListenAddr = fmt.Sprintf(":%d", config.Port) node := &DockerNode{ ExecNode: ExecNode{ |