aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
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 /cmd
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 'cmd')
-rw-r--r--cmd/swarm/config.go8
-rw-r--r--cmd/swarm/main.go5
2 files changed, 10 insertions, 3 deletions
diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go
index a941b3757..32cd442a0 100644
--- a/cmd/swarm/config.go
+++ b/cmd/swarm/config.go
@@ -123,18 +123,22 @@ func buildConfig(ctx *cli.Context) (config *bzzapi.Config, err error) {
}
//finally, after the configuration build phase is finished, initialize
-func initSwarmNode(config *bzzapi.Config, stack *node.Node, ctx *cli.Context) {
+func initSwarmNode(config *bzzapi.Config, stack *node.Node, ctx *cli.Context, nodeconfig *node.Config) error {
//at this point, all vars should be set in the Config
//get the account for the provided swarm account
prvkey := getAccount(config.BzzAccount, ctx, stack)
//set the resolved config path (geth --datadir)
config.Path = expandPath(stack.InstanceDir())
//finally, initialize the configuration
- config.Init(prvkey)
+ err := config.Init(prvkey, nodeconfig.NodeKey())
+ if err != nil {
+ return err
+ }
//configuration phase completed here
log.Debug("Starting Swarm with the following parameters:")
//after having created the config, print it to screen
log.Debug(printConfig(config))
+ return nil
}
//configFileOverride overrides the current config with the config file, if a config file has been provided
diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go
index 06d5b0bb2..a4041eb3d 100644
--- a/cmd/swarm/main.go
+++ b/cmd/swarm/main.go
@@ -298,7 +298,10 @@ func bzzd(ctx *cli.Context) error {
//a few steps need to be done after the config phase is completed,
//due to overriding behavior
- initSwarmNode(bzzconfig, stack, ctx)
+ err = initSwarmNode(bzzconfig, stack, ctx, &cfg)
+ if err != nil {
+ return err
+ }
//register BZZ as node.Service in the ethereum node
registerBzzService(bzzconfig, stack)
//start the node