Skip to content

Commit 62d5960

Browse files
fix: use blockchain-rpc-endpoint for bee config (#470)
* fix: use blockchain-rpc-endpoint instead of swap-endpoint in bee config * chore(config): sort bee config params
1 parent 2c6e7b5 commit 62d5960

File tree

8 files changed

+67
-59
lines changed

8 files changed

+67
-59
lines changed

config/config.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,46 +89,46 @@ node-groups:
8989
bee-configs:
9090
default:
9191
_inherit: ""
92+
allow-private-cidrs: true
9293
api-addr: ":1633"
9394
block-time: 1
94-
bootnodes: ""
95+
blockchain-rpc-endpoint: "ws://geth-swap.bee-playground.svc.swarm1.local:8546"
9596
bootnode-mode: false
97+
bootnodes: ""
9698
cache-capacity: 1000000
99+
chequebook-enable: true
97100
cors-allowed-origins: ""
98101
data-dir: "/home/bee/.bee"
99-
db-open-files-limit: 200
100102
db-block-cache-capacity: 33554432
101-
db-write-buffer-size: 33554432
102103
db-disable-seeks-compaction: false
104+
db-open-files-limit: 200
105+
db-write-buffer-size: 33554432
103106
full-node: true
104-
nat-addr: ""
105107
mainnet: false
108+
nat-addr: ""
106109
network-id: 12345
107110
p2p-addr: ":1634"
108111
p2p-ws-enable: false
109112
password: "beekeeper"
110113
payment-early-percent: 50
111114
payment-threshold: 13500000
112115
payment-tolerance-percent: 25
113-
storage-incentives-enable: true
114-
postage-stamp-start-block: 1
115116
postage-stamp-address: "0x657241f4494A2F15Ba75346E691d753A978C72Df"
117+
postage-stamp-start-block: 1
116118
price-oracle-address: "0x5aFE06fcC0855a76a15c3544b0886EDBE3294d62"
117-
staking-address: "0xfc28330f1ecE0ef2371B724E0D19c1EE60B728b2"
118119
redistribution-address: "0x09Ad42a7d020244920309FfA14EA376dd2D3b7d5"
119120
resolver-options: ""
120-
chequebook-enable: true
121+
staking-address: "0xfc28330f1ecE0ef2371B724E0D19c1EE60B728b2"
122+
storage-incentives-enable: true
121123
swap-enable: true
122-
swap-endpoint: "ws://geth-swap.bee-playground.svc.swarm1.local:8546"
123124
swap-factory-address: "0xdD661f2500bA5831e3d1FEbAc379Ea1bF80773Ac"
124125
swap-initial-deposit: 500000000000000000
125126
tracing-enabled: true
126127
tracing-endpoint: "10.10.11.199:6831"
127128
tracing-service-name: "bee"
128129
verbosity: 5 # 1=error, 2=warn, 3=info, 4=debug, 5=trace
129-
welcome-message: "Welcome to the Swarm, you are Bee-ing connected!"
130130
warmup-time: 0s
131-
allow-private-cidrs: true
131+
welcome-message: "Welcome to the Swarm, you are Bee-ing connected!"
132132
withdrawal-addresses-whitelist: "0xec44cb15b1b033e74d55ac5d0e24d861bde54532"
133133
bootnode:
134134
_inherit: "default"

config/local.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,20 @@ node-groups:
109109
bee-configs:
110110
bee-local:
111111
_inherit: ""
112+
allow-private-cidrs: true
112113
api-addr: ":1633"
113114
block-time: 1
114-
bootnodes: ""
115+
blockchain-rpc-endpoint: "ws://geth-swap:8546"
115116
bootnode-mode: false
117+
bootnodes: ""
116118
cache-capacity: 20000
119+
chequebook-enable: true
117120
cors-allowed-origins: ""
118121
data-dir: "/home/bee/.bee"
119-
db-open-files-limit: 200
120122
db-block-cache-capacity: 33554432
121-
db-write-buffer-size: 33554432
122123
db-disable-seeks-compaction: false
124+
db-open-files-limit: 200
125+
db-write-buffer-size: 33554432
123126
full-node: true
124127
mainnet: false
125128
nat-addr: ""
@@ -130,22 +133,19 @@ bee-configs:
130133
payment-early-percent: 50
131134
payment-threshold: 13500000
132135
payment-tolerance-percent: 25
133-
storage-incentives-enable: true
134-
postage-stamp-start-block: 1
135136
postage-stamp-address: "0x657241f4494A2F15Ba75346E691d753A978C72Df"
137+
postage-stamp-start-block: 1
136138
price-oracle-address: "0x5aFE06fcC0855a76a15c3544b0886EDBE3294d62"
137-
staking-address: "0xfc28330f1ecE0ef2371B724E0D19c1EE60B728b2"
138139
redistribution-address: "0x09Ad42a7d020244920309FfA14EA376dd2D3b7d5"
139140
resolver-options: ""
140-
chequebook-enable: true
141+
staking-address: "0xfc28330f1ecE0ef2371B724E0D19c1EE60B728b2"
142+
storage-incentives-enable: true
141143
swap-enable: true
142-
swap-endpoint: "ws://geth-swap:8546"
143144
swap-factory-address: "0xdD661f2500bA5831e3d1FEbAc379Ea1bF80773Ac"
144145
swap-initial-deposit: 500000000000000000
145146
verbosity: 5
146-
welcome-message: "Welcome to the Swarm, this is a local cluster!"
147147
warmup-time: 0s
148-
allow-private-cidrs: true
148+
welcome-message: "Welcome to the Swarm, this is a local cluster!"
149149
withdrawal-addresses-whitelist: "0xec44cb15b1b033e74d55ac5d0e24d861bde54532"
150150

151151
bootnode-local:

config/staging.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ bee-configs:
3333
staging:
3434
_inherit: ""
3535
api-addr: ":1633"
36+
blockchain-rpc-endpoint: http://rpc-sepolia-haproxy.default.svc.swarm1.local
3637
bootnodes: /dnsaddr/testnet.ethswarm.org
3738
full-node: true
3839
mainnet: false
3940
network-id: 10
4041
p2p-addr: ":1634"
4142
password: "beekeeper"
4243
swap-enable: true
43-
swap-endpoint: http://rpc-sepolia-haproxy.default.svc.swarm1.local
4444
tracing-enabled: true
4545
tracing-endpoint: "10.10.11.199:6831"
4646
tracing-service-name: "bee"

config/testnet-giant.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,20 @@ node-groups:
6969
bee-configs:
7070
testnet-giant:
7171
_inherit: ""
72+
allow-private-cidrs: true
7273
api-addr: ":1633"
7374
block-time: 15
74-
bootnodes: ""
75+
blockchain-rpc-endpoint: "ws://private-goerli-geth.private-goerli-geth:8546"
7576
bootnode-mode: false
77+
bootnodes: ""
7678
cache-capacity: 1000000
79+
chequebook-enable: true
7780
cors-allowed-origins: ""
7881
data-dir: "/home/bee/.bee"
79-
db-open-files-limit: 200
8082
db-block-cache-capacity: 33554432
81-
db-write-buffer-size: 33554432
8283
db-disable-seeks-compaction: false
84+
db-open-files-limit: 200
85+
db-write-buffer-size: 33554432
8386
full-node: true
8487
mainnet: false
8588
nat-addr: ""
@@ -93,17 +96,14 @@ bee-configs:
9396
postage-stamp-address: ""
9497
price-oracle-address: ""
9598
resolver-options: "https://cloudflare-eth.com"
96-
chequebook-enable: true
9799
swap-enable: true
98-
swap-endpoint: "ws://private-goerli-geth.private-goerli-geth:8546"
99100
swap-factory-address: ""
100101
swap-initial-deposit: 10000000000000000
101102
tracing-enabled: false
102103
tracing-endpoint: "tempo-tempo-distributed-distributor.observability:6831"
103104
tracing-service-name: "bee"
104105
verbosity: 5
105106
welcome-message: "Welcome to the giant!"
106-
allow-private-cidrs: true
107107
bootnode-giant:
108108
_inherit: "testnet-giant"
109109
bootnode-mode: true

config/testnet.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,23 @@ node-groups:
7171
bee-configs:
7272
testnet:
7373
_inherit: ""
74+
allow-private-cidrs: true
7475
api-addr: ":1633"
7576
block-time: 15
76-
bootnodes: "/dnsaddr/testnet.ethswarm.org"
77+
blockchain-rpc-endpoint: "ws://private-goerli-geth.private-goerli-geth:8546"
7778
bootnode-mode: false
79+
bootnodes: "/dnsaddr/testnet.ethswarm.org"
7880
cache-capacity: 1000000
81+
chequebook-enable: true
7982
cors-allowed-origins: ""
8083
data-dir: "/home/bee/.bee"
81-
db-open-files-limit: 200
8284
db-block-cache-capacity: 33554432
83-
db-write-buffer-size: 33554432
8485
db-disable-seeks-compaction: false
86+
db-open-files-limit: 200
87+
db-write-buffer-size: 33554432
8588
full-node: true
86-
nat-addr: ""
8789
mainnet: false
90+
nat-addr: ""
8891
network-id: 10
8992
p2p-addr: ":1634"
9093
p2p-ws-enable: false
@@ -95,17 +98,14 @@ bee-configs:
9598
postage-stamp-address: ""
9699
price-oracle-address: ""
97100
resolver-options: "https://cloudflare-eth.com"
98-
chequebook-enable: true
99101
swap-enable: true
100-
swap-endpoint: "ws://private-goerli-geth.private-goerli-geth:8546"
101102
swap-factory-address: ""
102103
swap-initial-deposit: 10000000000000000
103104
tracing-enabled: false
104105
tracing-endpoint: "tempo-tempo-distributed-distributor.observability:6831"
105106
tracing-service-name: "bee"
106107
verbosity: 5
107108
welcome-message: "Welcome to the Testnet!"
108-
allow-private-cidrs: true
109109
testnet-light-node:
110110
_inherit: testnet
111111
full-node: false

pkg/config/bee.go

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,46 @@ type BeeConfig struct {
1818
// Bee configuration
1919
AllowPrivateCIDRs *bool `yaml:"allow-private-cidrs"`
2020
APIAddr *string `yaml:"api-addr"`
21+
BlockchainRPCEndpoint *string `yaml:"blockchain-rpc-endpoint"`
2122
BlockTime *uint64 `yaml:"block-time"`
22-
Bootnodes *string `yaml:"bootnodes"`
2323
BootnodeMode *bool `yaml:"bootnode-mode"`
24+
Bootnodes *string `yaml:"bootnodes"`
2425
CacheCapacity *uint64 `yaml:"cache-capacity"`
26+
ChequebookEnable *bool `yaml:"chequebook-enable"`
2527
CORSAllowedOrigins *string `yaml:"cors-allowed-origins"`
2628
DataDir *string `yaml:"data-dir"`
27-
DbOpenFilesLimit *int `yaml:"db-open-files-limit"`
2829
DbBlockCacheCapacity *int `yaml:"db-block-cache-capacity"`
29-
DbWriteBufferSize *int `yaml:"db-write-buffer-size"`
3030
DbDisableSeeksCompaction *bool `yaml:"db-disable-seeks-compaction"`
31+
DbOpenFilesLimit *int `yaml:"db-open-files-limit"`
32+
DbWriteBufferSize *int `yaml:"db-write-buffer-size"`
3133
FullNode *bool `yaml:"full-node"`
32-
NATAddr *string `yaml:"nat-addr"`
3334
Mainnet *bool `yaml:"mainnet"`
35+
NATAddr *string `yaml:"nat-addr"`
3436
NetworkID *uint64 `yaml:"network-id"`
3537
P2PAddr *string `yaml:"p2p-addr"`
3638
P2PWSEnable *bool `yaml:"pwp-ws-enable"`
3739
Password *string `yaml:"password"`
3840
PaymentEarly *uint64 `yaml:"payment-early-percent"`
3941
PaymentThreshold *uint64 `yaml:"payment-threshold"`
4042
PaymentTolerance *uint64 `yaml:"payment-tolerance-percent"`
41-
PostageStampAddress *string `yaml:"postage-stamp-address"`
4243
PostageContractStartBlock *uint64 `yaml:"postage-stamp-start-block"`
44+
PostageStampAddress *string `yaml:"postage-stamp-address"`
4345
PriceOracleAddress *string `yaml:"price-oracle-address"`
4446
RedistributionAddress *string `yaml:"redistribution-address"`
47+
ResolverOptions *string `yaml:"resolver-options"`
4548
StakingAddress *string `yaml:"staking-address"`
4649
StorageIncentivesEnable *string `yaml:"storage-incentives-enable"`
47-
ResolverOptions *string `yaml:"resolver-options"`
48-
ChequebookEnable *bool `yaml:"chequebook-enable"`
49-
SwapEnable *bool `yaml:"swap-enable"`
50-
SwapEndpoint *string `yaml:"swap-endpoint"`
5150
SwapDeploymentGasPrice *string `yaml:"swap-deployment-gas-price"`
51+
SwapEnable *bool `yaml:"swap-enable"`
52+
SwapEndpoint *string `yaml:"swap-endpoint"` // deprecated: use blockchain-rpc-endpoint
5253
SwapFactoryAddress *string `yaml:"swap-factory-address"`
5354
SwapInitialDeposit *uint64 `yaml:"swap-initial-deposit"`
5455
TracingEnabled *bool `yaml:"tracing-enabled"`
5556
TracingEndpoint *string `yaml:"tracing-endpoint"`
5657
TracingServiceName *string `yaml:"tracing-service-name"`
5758
Verbosity *uint64 `yaml:"verbosity"`
58-
WelcomeMessage *string `yaml:"welcome-message"`
5959
WarmupTime *time.Duration `yaml:"warmup-time"`
60+
WelcomeMessage *string `yaml:"welcome-message"`
6061
WithdrawAddress *string `yaml:"withdrawal-addresses-whitelist"`
6162
}
6263

@@ -68,12 +69,12 @@ func (b BeeConfig) GetParentName() string {
6869
}
6970

7071
// Export exports BeeConfig to orchestration.Config
71-
func (b *BeeConfig) Export() (o orchestration.Config) {
72+
func (b *BeeConfig) Export() (config orchestration.Config) {
7273
localVal := reflect.ValueOf(b).Elem()
7374
localType := reflect.TypeOf(b).Elem()
74-
remoteVal := reflect.ValueOf(&o).Elem()
75+
remoteVal := reflect.ValueOf(&config).Elem()
7576

76-
for i := 0; i < localVal.NumField(); i++ {
77+
for i := range localVal.NumField() {
7778
localField := localVal.Field(i)
7879
if localField.IsValid() && !localField.IsNil() {
7980
localFieldVal := localVal.Field(i).Elem()
@@ -86,5 +87,11 @@ func (b *BeeConfig) Export() (o orchestration.Config) {
8687
}
8788
}
8889

89-
return remoteVal.Interface().(orchestration.Config)
90+
config = remoteVal.Interface().(orchestration.Config)
91+
92+
if config.BlockchainRPCEndpoint == "" && b.SwapEndpoint != nil {
93+
config.BlockchainRPCEndpoint = *b.SwapEndpoint
94+
}
95+
96+
return config
9097
}

pkg/orchestration/k8s/helpers.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@ import (
1111
)
1212

1313
const (
14-
configTemplate = `api-addr: {{.APIAddr}}
14+
configTemplate = `
1515
allow-private-cidrs: {{ .AllowPrivateCIDRs }}
16+
api-addr: {{.APIAddr}}
1617
block-time: {{ .BlockTime }}
17-
bootnode: {{.Bootnodes}}
18+
blockchain-rpc-endpoint: {{.BlockchainRPCEndpoint}}
1819
bootnode-mode: {{.BootnodeMode}}
20+
bootnode: {{.Bootnodes}}
1921
cache-capacity: {{.CacheCapacity}}
22+
chequebook-enable: {{.ChequebookEnable}}
2023
cors-allowed-origins: {{.CORSAllowedOrigins}}
2124
data-dir: {{.DataDir}}
22-
db-open-files-limit: {{.DbOpenFilesLimit}}
2325
db-block-cache-capacity: {{.DbBlockCacheCapacity}}
24-
db-write-buffer-size: {{.DbWriteBufferSize}}
2526
db-disable-seeks-compaction: {{.DbDisableSeeksCompaction}}
27+
db-open-files-limit: {{.DbOpenFilesLimit}}
28+
db-write-buffer-size: {{.DbWriteBufferSize}}
2629
full-node: {{.FullNode}}
2730
mainnet: {{.Mainnet}}
2831
nat-addr: {{.NATAddr}}
@@ -37,21 +40,19 @@ postage-stamp-address: {{ .PostageStampAddress }}
3740
postage-stamp-start-block: {{ .PostageContractStartBlock }}
3841
price-oracle-address: {{ .PriceOracleAddress }}
3942
redistribution-address: {{ .RedistributionAddress }}
43+
resolver-options: {{.ResolverOptions}}
4044
staking-address: {{ .StakingAddress }}
4145
storage-incentives-enable: {{ .StorageIncentivesEnable }}
42-
resolver-options: {{.ResolverOptions}}
43-
chequebook-enable: {{.ChequebookEnable}}
44-
swap-enable: {{.SwapEnable}}
45-
swap-endpoint: {{.SwapEndpoint}}
4646
swap-deployment-gas-price: {{.SwapDeploymentGasPrice}}
47+
swap-enable: {{.SwapEnable}}
4748
swap-factory-address: {{.SwapFactoryAddress}}
4849
swap-initial-deposit: {{.SwapInitialDeposit}}
4950
tracing-enable: {{.TracingEnabled}}
5051
tracing-endpoint: {{.TracingEndpoint}}
5152
tracing-service-name: {{.TracingServiceName}}
5253
verbosity: {{.Verbosity}}
53-
welcome-message: {{.WelcomeMessage}}
5454
warmup-time: {{.WarmupTime}}
55+
welcome-message: {{.WelcomeMessage}}
5556
withdrawal-addresses-whitelist: {{.WithdrawAddress}}
5657
`
5758
)

pkg/orchestration/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ type Config struct {
102102
ResolverOptions string // ENS compatible API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url
103103
ChequebookEnable bool // enable chequebook
104104
SwapEnable bool // enable swap
105-
SwapEndpoint string // swap ethereum blockchain endpoint
105+
BlockchainRPCEndpoint string // blockchain RPC endpoint
106106
SwapDeploymentGasPrice string // gas price in wei to use for deployment and funding
107107
SwapFactoryAddress string // swap factory address
108108
RedistributionAddress string // redistribution address

0 commit comments

Comments
 (0)