Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e386677
refactor: replace full-node flag with explicit node-mode config
martinconic Apr 9, 2026
b58c43a
fix: restore legacy mode detection in resolveNodeMode
martinconic Apr 14, 2026
9d736a0
test: add table-driven tests for resolveNodeMode
martinconic Apr 22, 2026
7e68799
fix: tighten node-mode validation to prevent silent upgrade regressions
martinconic Apr 30, 2026
6abfcc3
Merge branch 'master' into refactor/node-mode-config
martinconic May 19, 2026
5c691ce
Merge branch 'master' into refactor/node-mode-config
martinconic May 21, 2026
fdf799c
Merge branch 'master' into refactor/node-mode-config
martinconic May 28, 2026
479c759
fix(node-mode): keep legacy --full-node configs starting after upgrade
martinconic Jun 3, 2026
6a0c78e
Merge remote-tracking branch 'origin/master' into refactor/node-mode-…
martinconic Jul 13, 2026
98be0b4
Merge remote-tracking branch 'origin/master' into refactor/node-mode-…
martinconic Aug 27, 2026
ebc5f4a
test(cmd): add edge-case and precedence tests for resolveNodeMode
martinconic Aug 27, 2026
8b061de
fix(cmd): reject storage incentives in light and ultra-light modes
martinconic Sep 2, 2026
5ef43da
refactor(cmd): resolve node-mode in two regimes
martinconic Sep 3, 2026
1bf0f0c
fix(packaging): pass BEE_NODE_MODE through docker compose and refresh…
martinconic Sep 3, 2026
d8086ba
ci: point Beekeeper job at the refactor/node-mode-two-regimes compani…
martinconic Sep 3, 2026
e00782d
fix(cmd): preserve flag defaults and apply mode overrides when node-m…
martinconic Sep 11, 2026
0c39887
Merge remote-tracking branch 'origin/master' into refactor/node-mode-…
martinconic Sep 28, 2026
a7f1055
Merge remote-tracking branch 'origin/master' into refactor/node-mode-…
martinconic Oct 15, 2026
909ac03
test(cmd): move node-mode resolution tests to cmd_test
martinconic Oct 15, 2026
2b8338d
fix(cmd): disable unset chequebook and incentives on full bootnodes
martinconic Oct 15, 2026
3ef5392
fix(cmd): exit with an error on invalid node-mode configuration
martinconic Oct 15, 2026
bacbce6
fix(node): enable the chain backend only for full and light modes
martinconic Oct 15, 2026
32f97e4
chore(lint): remove unused staticcheck exclusion for cmd/bee/cmd
martinconic Oct 15, 2026
e289cf5
docs(packaging): show node-mode as unset by default
martinconic Oct 15, 2026
610f34b
fix(cmd): let unset chequebook-enable follow swap-enable with node-mode
martinconic Oct 15, 2026
7e91e18
fix(cmd): list the exact node-mode migration and validate modes early
martinconic Oct 15, 2026
bf279f9
feat(cmd): explain the pseudosettle limit of light nodes without swap
martinconic Oct 16, 2026
e31a6ce
fix(cmd): report explicitly disabled implied options at info level
martinconic Oct 16, 2026
e289384
ci: run beekeeper from master
martinconic Oct 16, 2026
1b4931c
Merge remote-tracking branch 'origin/master' into refactor/node-mode-…
martinconic Oct 28, 2026
96ecdb9
Merge remote-tracking branch 'origin/master' into refactor/node-mode-…
martinconic Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cmd/bee/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ const (
optionNameBzzTokenAddress = "bzz-token-address"
optionNameSwapFactoryAddress = "swap-factory-address"
optionNameSwapInitialDeposit = "swap-initial-deposit"
optionNameNodeMode = "node-mode"
optionNameSwapEnable = "swap-enable"
optionNameChequebookEnable = "chequebook-enable"
optionNameChequebookVerification = "chequebook-verification"
optionNameChequebookMinBalance = "chequebook-min-balance"
optionNameFullNode = "full-node"
optionNameFullNode = "full-node" // Deprecated: use node-mode instead.
optionNameLightNodeLimit = "light-node-limit"
optionNamePostageContractAddress = "postage-stamp-address"
optionNamePostageContractStartBlock = "postage-stamp-start-block"
Expand Down Expand Up @@ -360,11 +361,13 @@ func (c *command) setAllFlags(cmd *cobra.Command) {
cmd.Flags().String(optionNameSwapFactoryAddress, "", "swap factory addresses")
cmd.Flags().String(optionNameBzzTokenAddress, "", "bzz token contract address")
cmd.Flags().String(optionNameSwapInitialDeposit, "0", "initial deposit if deploying a new chequebook")
cmd.Flags().String(optionNameNodeMode, "", "node operational mode: full, light, or ultra-light (unset: inferred from deprecated full-node and blockchain-rpc-endpoint)")
cmd.Flags().Bool(optionNameSwapEnable, false, "enable swap")
cmd.Flags().Bool(optionNameChequebookEnable, true, "enable chequebook")
cmd.Flags().Bool(optionNameChequebookVerification, false, "reject full-node hive/handshake records that carry no chequebook address")
cmd.Flags().String(optionNameChequebookMinBalance, "110000000000000000", "minimum chequebook token balance required for verification, in token small units (default 11 BZZ)")
cmd.Flags().Bool(optionNameFullNode, false, "cause the node to start in full mode")
cmd.Flags().Bool(optionNameFullNode, false, "cause the node to start in full mode (deprecated: use --node-mode=full)")
_ = cmd.Flags().MarkDeprecated(optionNameFullNode, "use --node-mode=full instead")
cmd.Flags().Int(optionNameLightNodeLimit, 100, "light node limit")
cmd.Flags().String(optionNamePostageContractAddress, "", "postage stamp contract address")
cmd.Flags().Uint64(optionNamePostageContractStartBlock, 0, "postage stamp contract start block number")
Expand Down
54 changes: 54 additions & 0 deletions cmd/bee/cmd/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ package cmd
import (
"io"

"github.com/ethersphere/bee/v2/pkg/log"
"github.com/ethersphere/bee/v2/pkg/node"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

type (
Expand Down Expand Up @@ -89,3 +92,54 @@ func WithPasswordReader(r PasswordReader) func(c *Command) {
func (c *Command) SetCfgFileForTest(f string) {
c.cfgFile = f
}

// Config keys read by node-mode resolution.
const (
OptionNameNodeMode = optionNameNodeMode
OptionNameFullNode = optionNameFullNode
OptionNameBootnodeMode = optionNameBootnodeMode
OptionNameSwapEnable = optionNameSwapEnable
OptionNameChequebookEnable = optionNameChequebookEnable
OptionNameStorageIncentivesEnable = optionNameStorageIncentivesEnable
OptionNameChequebookVerification = optionNameChequebookVerification
OptionNameReserveCapacityDoubling = optionReserveCapacityDoubling
ConfigKeyBlockchainRpcEndpoint = configKeyBlockchainRpcEndpoint
)

// ResolveNodeModeForTest runs node-mode resolution against cfg, leaving the
// resolved option values in cfg.
func ResolveNodeModeForTest(cfg *viper.Viper) (node.NodeMode, error) {
return ResolveNodeModeWithLoggerForTest(cfg, log.Noop)
}

// ResolveNodeModeWithLoggerForTest is ResolveNodeModeForTest with a logger, for
// tests that assert on the warnings resolution emits.
func ResolveNodeModeWithLoggerForTest(cfg *viper.Viper, logger log.Logger) (node.NodeMode, error) {
c := &command{config: cfg, logger: logger}
return c.resolveNodeMode(c.logger)
}

// BindStartFlagsForTest mirrors the start command's PreRunE: it binds cfg to
// the command flags, then maps the flat blockchain-rpc-* flags onto their
// nested config keys.
func BindStartFlagsForTest(cfg *viper.Viper, startCmd *cobra.Command) error {
if err := cfg.BindPFlags(startCmd.Flags()); err != nil {
return err
}
c := &command{config: cfg}
c.bindBlockchainRpcConfig(startCmd)
return nil
}

// LegacyMigrationForTest resolves a config without node-mode through the
// production path and returns the inferred mode with the migration the
// deprecation warning lists.
func LegacyMigrationForTest(cfg *viper.Viper) (mode node.NodeMode, set, remove, notes []string, err error) {
c := &command{config: cfg, logger: log.Noop}
mode, err = c.resolveNodeMode(c.logger)
if err != nil {
return "", nil, nil, nil, err
}
m := c.legacyMigration(mode)
return mode, m.set, m.remove, m.notes, nil
}
Loading
Loading