diff options
author | Attila Gazso <attila.gazso@prezi.com> | 2018-08-07 21:34:11 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-08-07 21:34:11 +0800 |
commit | 9df16f34689956121ebc360857f91242291b7f0c (patch) | |
tree | 338b7621b771dc0e9dc7f66c44bed551b494b5ea /cmd/swarm/config.go | |
parent | 8461fea44b140fcb04905be7acc4539f42c0444f (diff) | |
download | go-tangerine-9df16f34689956121ebc360857f91242291b7f0c.tar go-tangerine-9df16f34689956121ebc360857f91242291b7f0c.tar.gz go-tangerine-9df16f34689956121ebc360857f91242291b7f0c.tar.bz2 go-tangerine-9df16f34689956121ebc360857f91242291b7f0c.tar.lz go-tangerine-9df16f34689956121ebc360857f91242291b7f0c.tar.xz go-tangerine-9df16f34689956121ebc360857f91242291b7f0c.tar.zst go-tangerine-9df16f34689956121ebc360857f91242291b7f0c.zip |
swarm: Added lightnode flag (#17291)
* swarm: Added lightnode flag
Added --lightnode command line parameter
Added LightNode to Handshake message
* swarm/config: Fixed variable naming
* cmd/swarm: Changed BoolTFlag to BoolFlag for SwarmLightNodeEnabled
* swarm/network: Changed logging
* swarm/network: Changed protocol version testing
* swarm/network: Renamed DefaultNetworkID variable to TestProtocolNetworkID
* swarm/network: Bumped protocol version
* swarm/network: Changed LightNode handhsake test to table driven
* swarm/network: Changed back TestProtocolVersion to 5 for now
* swarm/network: Moved the test configuration inside the test function scope
Diffstat (limited to 'cmd/swarm/config.go')
-rw-r--r-- | cmd/swarm/config.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index ce2acdcc9..ff085fd94 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -68,6 +68,7 @@ const ( SWARM_ENV_SWAP_API = "SWARM_SWAP_API" SWARM_ENV_SYNC_DISABLE = "SWARM_SYNC_DISABLE" SWARM_ENV_SYNC_UPDATE_DELAY = "SWARM_ENV_SYNC_UPDATE_DELAY" + SWARM_ENV_LIGHT_NODE_ENABLE = "SWARM_LIGHT_NODE_ENABLE" SWARM_ENV_DELIVERY_SKIP_CHECK = "SWARM_DELIVERY_SKIP_CHECK" SWARM_ENV_ENS_API = "SWARM_ENS_API" SWARM_ENV_ENS_ADDR = "SWARM_ENS_ADDR" @@ -204,6 +205,10 @@ func cmdLineOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Con currentConfig.SyncUpdateDelay = d } + if ctx.GlobalIsSet(SwarmLightNodeEnabled.Name) { + currentConfig.LightNodeEnabled = true + } + if ctx.GlobalIsSet(SwarmDeliverySkipCheckFlag.Name) { currentConfig.DeliverySkipCheck = true } @@ -301,6 +306,12 @@ func envVarsOverride(currentConfig *bzzapi.Config) (config *bzzapi.Config) { } } + if lne := os.Getenv(SWARM_ENV_LIGHT_NODE_ENABLE); lne != "" { + if lightnode, err := strconv.ParseBool(lne); err != nil { + currentConfig.LightNodeEnabled = lightnode + } + } + if swapapi := os.Getenv(SWARM_ENV_SWAP_API); swapapi != "" { currentConfig.SwapAPI = swapapi } |