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
This commit is contained in:
@@ -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{
|
||||
|
Reference in New Issue
Block a user