@@ -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}
0 commit comments