aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/simulations/adapters/exec.go
diff options
context:
space:
mode:
authorlash <nolash@users.noreply.github.com>2019-03-23 04:37:25 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2019-03-23 04:37:25 +0800
commit2f5b6cb442dd1ab20279603de938e5b60e3122fb (patch)
tree1637681558132f2b1064e7d774b9ca63047f72a4 /p2p/simulations/adapters/exec.go
parent876f3573647f9a62d94073b342bc678f380f0304 (diff)
downloadgo-tangerine-2f5b6cb442dd1ab20279603de938e5b60e3122fb.tar
go-tangerine-2f5b6cb442dd1ab20279603de938e5b60e3122fb.tar.gz
go-tangerine-2f5b6cb442dd1ab20279603de938e5b60e3122fb.tar.bz2
go-tangerine-2f5b6cb442dd1ab20279603de938e5b60e3122fb.tar.lz
go-tangerine-2f5b6cb442dd1ab20279603de938e5b60e3122fb.tar.xz
go-tangerine-2f5b6cb442dd1ab20279603de938e5b60e3122fb.tar.zst
go-tangerine-2f5b6cb442dd1ab20279603de938e5b60e3122fb.zip
swarm/network: Use different privatekey for bzz overlay in sim (#19313)
* cmd/swarm, p2p, swarm: Enable ENR in binary/execadapter * cmd/p2p/swarm: Remove comments + config.Enode nomarshal * p2p/simulations: Remove superfluous error check * p2p/simulation: Move init enode comment * swarm, p2p/simulations, cmd/swarm: Use nodekey in binary record sign * swarm/network, swarm/pss: Dervice bzzkey * swarm/pss: Remove unused function * swarm/network: Store swarm private key in simulation bucket * swarm/pss: Shorten TextProxNetwork shortrunning test timeout * swarm/pss: Increase prox test timeout * swarm/pss: Increase timeout slightly on shortrunning proxtest * swarm/network: Simplify bucket instantiation in servicectx func * p2p/simulations: Tcpport -> udpport * swarm/network, swarm/pss: Simplify + correct lock in servicefunc sim * swarm/network: Cleanup after rebase on extract swarm enode new * p2p/simulations, swarm/network: Make exec disc test pass * swarm/network: Prune ye olde comment * swarm/pss: Correct revised bzzkey method call * swarm/network: Clarify comment about privatekey generation data * swarm/pss: Fix syntax errors after rebase * swarm/network: Rename misleadingly named method (amend commit to trigger ci - attempt 5)
Diffstat (limited to 'p2p/simulations/adapters/exec.go')
-rw-r--r--p2p/simulations/adapters/exec.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go
index 6d1c13f3c..106b179e4 100644
--- a/p2p/simulations/adapters/exec.go
+++ b/p2p/simulations/adapters/exec.go
@@ -411,14 +411,13 @@ func startExecNodeStack() (*node.Node, error) {
if err := json.Unmarshal([]byte(confEnv), &conf); err != nil {
return nil, fmt.Errorf("error decoding %s: %v", envNodeConfig, err)
}
- // TODO verify that ListenAddr will contain the correct tcp addr
- // if we should start using exec adapters with other host than local
+
+ // create enode record
nodeTcpConn, err := net.ResolveTCPAddr("tcp", conf.Stack.P2P.ListenAddr)
- if err != nil {
- conf.Node.initDummyEnode()
- } else {
- conf.Node.initEnode(nodeTcpConn.IP, nodeTcpConn.Port, nodeTcpConn.Port)
+ if nodeTcpConn.IP == nil {
+ nodeTcpConn.IP = net.IPv4(127, 0, 0, 1)
}
+ conf.Node.initEnode(nodeTcpConn.IP, nodeTcpConn.Port, nodeTcpConn.Port)
conf.Stack.P2P.PrivateKey = conf.Node.PrivateKey
conf.Stack.Logger = log.New("node.id", conf.Node.ID.String())