aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/config.go
diff options
context:
space:
mode:
authorLewis Marshall <lewis@lmars.net>2017-05-22 14:56:40 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2017-05-22 14:56:40 +0800
commit4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5 (patch)
tree4a9a0867f1634acbd342c4cc9720ed4798355f06 /swarm/api/config.go
parentbc75351edfd820235c7609eefc8b0035e01215b8 (diff)
downloadgo-tangerine-4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5.tar
go-tangerine-4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5.tar.gz
go-tangerine-4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5.tar.bz2
go-tangerine-4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5.tar.lz
go-tangerine-4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5.tar.xz
go-tangerine-4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5.tar.zst
go-tangerine-4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5.zip
cmd/swarm: Add --httpaddr flag (#14475)
Fixes #14474. Signed-off-by: Lewis Marshall <lewis@lmars.net>
Diffstat (limited to 'swarm/api/config.go')
-rw-r--r--swarm/api/config.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/swarm/api/config.go b/swarm/api/config.go
index 23a855500..647c153ed 100644
--- a/swarm/api/config.go
+++ b/swarm/api/config.go
@@ -32,7 +32,8 @@ import (
)
const (
- port = "8500"
+ DefaultHTTPListenAddr = "127.0.0.1"
+ DefaultHTTPPort = "8500"
)
var (
@@ -48,12 +49,13 @@ type Config struct {
*network.HiveParams
Swap *swap.SwapParams
*network.SyncParams
- Path string
- Port string
- PublicKey string
- BzzKey string
- EnsRoot common.Address
- NetworkId uint64
+ Path string
+ ListenAddr string
+ Port string
+ PublicKey string
+ BzzKey string
+ EnsRoot common.Address
+ NetworkId uint64
}
// config is agnostic to where private key is coming from
@@ -76,7 +78,8 @@ func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey, n
HiveParams: network.NewHiveParams(dirpath),
ChunkerParams: storage.NewChunkerParams(),
StoreParams: storage.NewStoreParams(dirpath),
- Port: port,
+ ListenAddr: DefaultHTTPListenAddr,
+ Port: DefaultHTTPPort,
Path: dirpath,
Swap: swap.DefaultSwapParams(contract, prvKey),
PublicKey: pubkeyhex,