Skip to content

Commit a93fb7a

Browse files
authored
feat(cmd): add --light-node-limit CLI and config option (#5559)
1 parent 9268375 commit a93fb7a

7 files changed

Lines changed: 13 additions & 0 deletions

File tree

cmd/bee/cmd/cmd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const (
6060
optionNameChequebookVerification = "chequebook-verification"
6161
optionNameChequebookMinBalance = "chequebook-min-balance"
6262
optionNameFullNode = "full-node"
63+
optionNameLightNodeLimit = "light-node-limit"
6364
optionNamePostageContractAddress = "postage-stamp-address"
6465
optionNamePostageContractStartBlock = "postage-stamp-start-block"
6566
optionNamePriceOracleAddress = "price-oracle-address"
@@ -361,6 +362,7 @@ func (c *command) setAllFlags(cmd *cobra.Command) {
361362
cmd.Flags().Bool(optionNameChequebookVerification, false, "reject full-node hive/handshake records that carry no chequebook address")
362363
cmd.Flags().String(optionNameChequebookMinBalance, "110000000000000000", "minimum chequebook token balance required for verification, in token small units (default 11 BZZ)")
363364
cmd.Flags().Bool(optionNameFullNode, false, "cause the node to start in full mode")
365+
cmd.Flags().Int(optionNameLightNodeLimit, 100, "light node limit")
364366
cmd.Flags().String(optionNamePostageContractAddress, "", "postage stamp contract address")
365367
cmd.Flags().Uint64(optionNamePostageContractStartBlock, 0, "postage stamp contract start block number")
366368
cmd.Flags().String(optionNamePriceOracleAddress, "", "price oracle contract address")

cmd/bee/cmd/start.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ func buildBeeNode(ctx context.Context, c *command, cmd *cobra.Command, logger lo
325325
AutoTLSDomain: c.config.GetString(optionAutoTLSDomain),
326326
AutoTLSRegistrationEndpoint: c.config.GetString(optionAutoTLSRegistrationEndpoint),
327327
FullNodeMode: fullNode,
328+
LightNodeLimit: c.config.GetInt(optionNameLightNodeLimit),
328329
Logger: logger,
329330
MinimumGasTipCap: c.config.GetUint64(optionNameMinimumGasTipCap),
330331
GasLimitFallback: c.config.GetUint64(optionNameGasLimitFallback),

packaging/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,5 @@ password-file: "/var/lib/bee/password"
151151
# autotls-ca-endpoint: ""
152152
## SIMD BMT hashing opt-in flag (only available on linux amd64)
153153
# use-simd-hashing: false
154+
## limit of possible connected light nodes (default: 100)
155+
# light-node-limit: 100

packaging/homebrew-amd64/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,5 @@ password-file: "/usr/local/var/lib/swarm-bee/password"
151151
# autotls-ca-endpoint: ""
152152
## SIMD BMT hashing opt-in flag (only available on linux amd64)
153153
# use-simd-hashing: false
154+
## limit of possible connected light nodes (default: 100)
155+
# light-node-limit: 100

packaging/homebrew-arm64/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,5 @@ password-file: "/opt/homebrew/var/lib/swarm-bee/password"
151151
# autotls-ca-endpoint: ""
152152
## SIMD BMT hashing opt-in flag (only available on linux amd64)
153153
# use-simd-hashing: false
154+
## limit of possible connected light nodes (default: 100)
155+
# light-node-limit: 100

packaging/scoop/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,5 @@ password-file: "./password"
151151
# autotls-ca-endpoint: ""
152152
## SIMD BMT hashing opt-in flag (only available on linux amd64)
153153
# use-simd-hashing: false
154+
## limit of possible connected light nodes (default: 100)
155+
# light-node-limit: 100

pkg/node/node.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ type Options struct {
165165
AutoTLSDomain string
166166
AutoTLSRegistrationEndpoint string
167167
FullNodeMode bool
168+
LightNodeLimit int
168169
GasLimitFallback uint64
169170
Logger log.Logger
170171
MinimumGasTipCap uint64
@@ -733,6 +734,7 @@ func NewBee(
733734
AutoTLSCAEndpoint: o.AutoTLSCAEndpoint,
734735
WelcomeMessage: o.WelcomeMessage,
735736
FullNode: o.FullNodeMode,
737+
LightNodeLimit: o.LightNodeLimit,
736738
Nonce: nonce,
737739
AllowPrivateCIDRs: o.AllowPrivateCIDRs,
738740
Registry: registry,

0 commit comments

Comments
 (0)