From 4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5 Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Sun, 21 May 2017 23:56:40 -0700 Subject: cmd/swarm: Add --httpaddr flag (#14475) Fixes #14474. Signed-off-by: Lewis Marshall --- cmd/swarm/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmd/swarm') diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 26aa3e50f..71149c310 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -67,6 +67,10 @@ var ( Name: "bzzaccount", Usage: "Swarm account key file", } + SwarmListenAddrFlag = cli.StringFlag{ + Name: "httpaddr", + Usage: "Swarm HTTP API listening interface", + } SwarmPortFlag = cli.StringFlag{ Name: "bzzport", Usage: "Swarm local http api port", @@ -249,6 +253,7 @@ Cleans database of corrupted entries. SwarmConfigPathFlag, SwarmSwapEnabledFlag, SwarmSyncEnabledFlag, + SwarmListenAddrFlag, SwarmPortFlag, SwarmAccountFlag, SwarmNetworkIdFlag, @@ -345,6 +350,9 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) { if len(bzzport) > 0 { bzzconfig.Port = bzzport } + if bzzaddr := ctx.GlobalString(SwarmListenAddrFlag.Name); bzzaddr != "" { + bzzconfig.ListenAddr = bzzaddr + } swapEnabled := ctx.GlobalBool(SwarmSwapEnabledFlag.Name) syncEnabled := ctx.GlobalBoolT(SwarmSyncEnabledFlag.Name) -- cgit v1.2.3