Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bee-configs:
db-disable-seeks-compaction: false
db-open-files-limit: 200
db-write-buffer-size: 33554432
full-node: true
node-mode: full
mainnet: false
nat-addr: ""
network-id: 12345
Expand Down
2 changes: 1 addition & 1 deletion config/light-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
bee-configs:
light-node:
_inherit: default
full-node: false
node-mode: light

# node groups for light nodes
node-groups:
Expand Down
7 changes: 4 additions & 3 deletions config/local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ bee-configs:
db-disable-seeks-compaction: false
db-open-files-limit: 200
db-write-buffer-size: 33554432
full-node: true
node-mode: full
mainnet: false
nat-addr: ""
nat-wss-addr: ""
Expand Down Expand Up @@ -206,9 +206,10 @@ bee-configs:
p2p-wss-enable: true
bee-local-ultralight-autotls:
_inherit: "bee-local-dns"
full-node: false
node-mode: ultra-light
p2p-wss-enable: true
blockchain-rpc-endpoint: # ultralight nodes don't connect to the blockchain
swap-enable: false
bootnode-local:
_inherit: "bee-local"
bootnode-mode: true
Expand All @@ -222,7 +223,7 @@ bee-configs:
bee-local-light:
_inherit: "bee-local"
bootnode: /dnsaddr/localhost
full-node: false
node-mode: light
bee-local-gc:
_inherit: "bee-local"
cache-capacity: 10
Expand Down
2 changes: 1 addition & 1 deletion config/public-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bee-configs:
sepolia:
_inherit: ""
bootnodes: "/dnsaddr/testnet.ethswarm.org"
full-node: true
node-mode: full

checks:
pt-pingpong:
Expand Down
2 changes: 1 addition & 1 deletion config/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bee-configs:
api-addr: ":1633"
blockchain-rpc-endpoint: http://rpc-sepolia-haproxy.default.svc.swarm1.local
bootnodes: /dnsaddr/testnet.ethswarm.org
full-node: true
node-mode: full
mainnet: false
network-id: 10
p2p-addr: ":1634"
Expand Down
2 changes: 1 addition & 1 deletion config/testnet-bee-playground.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bee-configs:
db-disable-seeks-compaction: true
db-open-files-limit: 200
db-write-buffer-size: 33554432
full-node: true
node-mode: full
mainnet: false
nat-addr: ""
network-id: 5
Expand Down
3 changes: 2 additions & 1 deletion pkg/config/bee.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ type BeeConfig struct {
DbDisableSeeksCompaction *bool `yaml:"db-disable-seeks-compaction"`
DbOpenFilesLimit *int `yaml:"db-open-files-limit"`
DbWriteBufferSize *int `yaml:"db-write-buffer-size"`
FullNode *bool `yaml:"full-node"`
FullNode *bool `yaml:"full-node"` // Deprecated: use NodeMode
NodeMode *string `yaml:"node-mode"`
Mainnet *bool `yaml:"mainnet"`
NATAddr *string `yaml:"nat-addr"`
NATWSSAddr *string `yaml:"nat-wss-addr"`
Expand Down
8 changes: 4 additions & 4 deletions pkg/orchestration/k8s/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (c *Cluster) NodeNames() (names []string) {
// LightNodeNames returns a list of light node names
func (c *Cluster) LightNodeNames() (names []string) {
for name, node := range c.Nodes() {
if !node.Config().FullNode {
if node.Config().IsLightNode() {
names = append(names, name)
}
}
Expand All @@ -237,7 +237,7 @@ func (c *Cluster) LightNodeNames() (names []string) {
func (c *Cluster) FullNodeNames() (names []string) {
for name, node := range c.Nodes() {
cfg := node.Config()
if cfg.FullNode && !cfg.BootnodeMode {
if cfg.IsFullNode() && !cfg.BootnodeMode {
names = append(names, name)
}
}
Expand All @@ -249,7 +249,7 @@ func (c *Cluster) ShuffledFullNodeClients(ctx context.Context, r *rand.Rand) (or
var res orchestration.ClientList
for _, node := range c.Nodes() {
cfg := node.Config()
if cfg.FullNode && !cfg.BootnodeMode {
if cfg.IsFullNode() && !cfg.BootnodeMode {
res = append(res, node.Client())
}
}
Expand Down Expand Up @@ -464,7 +464,7 @@ func (c *Cluster) ClosestFullNodeClient(ctx context.Context, s *bee.Client) (*be
}
cfg := node.Config()
// closet peer is not a full node. Check other peers in the same bin
if !cfg.FullNode || cfg.BootnodeMode {
if !cfg.IsFullNode() || cfg.BootnodeMode {
skipList = append(skipList, addr)
b--
continue
Expand Down
1 change: 1 addition & 0 deletions pkg/orchestration/k8s/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ db-disable-seeks-compaction: {{.DbDisableSeeksCompaction}}
db-open-files-limit: {{.DbOpenFilesLimit}}
db-write-buffer-size: {{.DbWriteBufferSize}}
full-node: {{.FullNode}}
node-mode: {{.NodeMode}}
mainnet: {{.Mainnet}}
nat-addr: {{.NATAddr}}
nat-wss-addr: {{.NATWSSAddr}}
Expand Down
20 changes: 19 additions & 1 deletion pkg/orchestration/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ type Config struct {
DbDisableSeeksCompaction bool // disables DB compactions triggered by seeks
DbOpenFilesLimit int // number of open files allowed by database
DbWriteBufferSize int // size of the database write buffer in bytes
FullNode bool // cause the node to start in full mode
FullNode bool // cause the node to start in full mode (deprecated: use NodeMode)
NodeMode string // node operational mode: full, light, or ultra-light
Mainnet bool // enable mainnet
NATAddr string // NAT exposed address
NATWSSAddr string // NAT exposed secure WebSocket address
Expand Down Expand Up @@ -123,3 +124,20 @@ type Config struct {
WelcomeMessage string // send a welcome message string during handshakes
WithdrawAddress string // allowed addresses for wallet withdrawal
}

// IsFullNode reports whether the node is configured as a full node.
// It checks NodeMode first; falls back to the deprecated FullNode bool.
func (c Config) IsFullNode() bool {
if c.NodeMode != "" {
return c.NodeMode == "full"
}
return c.FullNode
}

// IsLightNode reports whether the node is configured as a light node.
func (c Config) IsLightNode() bool {
if c.NodeMode != "" {
return c.NodeMode == "light"
}
return !c.FullNode
}