aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/simulation/node.go
diff options
context:
space:
mode:
authorlash <nolash@users.noreply.github.com>2019-03-22 12:55:47 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2019-03-22 12:55:47 +0800
commit09924cbcaab5106951fb67648315131bb4024ac5 (patch)
treeefeb2e96b97b6537ce5680a26934176567da00b3 /swarm/network/simulation/node.go
parent358535188852bd9d8e351ccbb0d1fa608284a77b (diff)
downloadgo-tangerine-09924cbcaab5106951fb67648315131bb4024ac5.tar
go-tangerine-09924cbcaab5106951fb67648315131bb4024ac5.tar.gz
go-tangerine-09924cbcaab5106951fb67648315131bb4024ac5.tar.bz2
go-tangerine-09924cbcaab5106951fb67648315131bb4024ac5.tar.lz
go-tangerine-09924cbcaab5106951fb67648315131bb4024ac5.tar.xz
go-tangerine-09924cbcaab5106951fb67648315131bb4024ac5.tar.zst
go-tangerine-09924cbcaab5106951fb67648315131bb4024ac5.zip
cmd/swarm, p2p, swarm: Enable ENR in binary/execadapter (#19309)
* 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/api: Check error in config test * swarm, p2p/simulations, cmd/swarm: Use nodekey in binary record sign * cmd/swarm: Make nodekey available for swarm api config
Diffstat (limited to 'swarm/network/simulation/node.go')
-rw-r--r--swarm/network/simulation/node.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/swarm/network/simulation/node.go b/swarm/network/simulation/node.go
index 1ab9ddfd0..2d618a29d 100644
--- a/swarm/network/simulation/node.go
+++ b/swarm/network/simulation/node.go
@@ -102,16 +102,16 @@ func (s *Simulation) AddNode(opts ...AddNodeOption) (id enode.ID, err error) {
// most importantly the bzz overlay address
//
// for now we have no way of setting bootnodes or lightnodes in sims
- // so we just set them as false
+ // so we just let them be set to false
// they should perhaps be possible to override them with AddNodeOption
- bzzKey := network.PrivateKeyToBzzKey(conf.PrivateKey)
- bzzAddr := network.NewENRAddrEntry(bzzKey)
-
- var lightnode network.ENRLightNodeEntry
- var bootnode network.ENRBootNodeEntry
- conf.Record.Set(bzzAddr)
- conf.Record.Set(&lightnode)
- conf.Record.Set(&bootnode)
+ enodeParams := &network.EnodeParams{
+ PrivateKey: conf.PrivateKey,
+ }
+ record, err := network.NewEnodeRecord(enodeParams)
+ if err != nil {
+ return enode.ID{}, err
+ }
+ conf.Record = *record
// Add the bzz address to the node config
node, err := s.Net.NewNodeWithConfig(conf)