Skip to content

Commit

Permalink
services/horizon: clean up duplicate captive-core default config files (
Browse files Browse the repository at this point in the history
  • Loading branch information
urvisavla authored May 9, 2024
1 parent 18dee5c commit 64cb187
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 234 deletions.
195 changes: 0 additions & 195 deletions services/horizon/internal/configs/captive-core-pubnet.cfg

This file was deleted.

28 changes: 0 additions & 28 deletions services/horizon/internal/configs/captive-core-testnet.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion services/horizon/internal/docs/GUIDE_FOR_DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Add a debug configuration in your IDE to attach a debugger to the local Horizon
"program": "${workspaceRoot}/services/horizon/main.go",
"env": {
"DATABASE_URL": "postgres://postgres@localhost:5432/horizon?sslmode=disable",
"CAPTIVE_CORE_CONFIG_APPEND_PATH": "./services/horizon/internal/configs/captive-core-testnet.cfg",
"CAPTIVE_CORE_CONFIG_APPEND_PATH": "./ingest/ledgerbackend/configs/captive-core-testnet.cfg",
"HISTORY_ARCHIVE_URLS": "https://history.stellar.org/prd/core-testnet/core_testnet_001,https://history.stellar.org/prd/core-testnet/core_testnet_002",
"NETWORK_PASSPHRASE": "Test SDF Network ; September 2015",
"PER_HOUR_RATE_LIMIT": "0"
Expand Down
10 changes: 2 additions & 8 deletions services/horizon/internal/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,20 +835,14 @@ type networkConfig struct {
}

var (
//go:embed configs/captive-core-pubnet.cfg
PubnetDefaultConfig []byte

//go:embed configs/captive-core-testnet.cfg
TestnetDefaultConfig []byte

PubnetConf = networkConfig{
defaultConfig: PubnetDefaultConfig,
defaultConfig: ledgerbackend.PubnetDefaultConfig,
HistoryArchiveURLs: network.PublicNetworkhistoryArchiveURLs,
NetworkPassphrase: network.PublicNetworkPassphrase,
}

TestnetConf = networkConfig{
defaultConfig: TestnetDefaultConfig,
defaultConfig: ledgerbackend.TestnetDefaultConfig,
HistoryArchiveURLs: network.TestNetworkhistoryArchiveURLs,
NetworkPassphrase: network.TestNetworkPassphrase,
}
Expand Down
4 changes: 2 additions & 2 deletions services/horizon/internal/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func Test_createCaptiveCoreConfig(t *testing.T) {
config: Config{
NetworkPassphrase: PubnetConf.NetworkPassphrase,
HistoryArchiveURLs: PubnetConf.HistoryArchiveURLs,
CaptiveCoreConfigPath: "configs/captive-core-pubnet.cfg",
CaptiveCoreConfigPath: "../../../ingest/ledgerbackend/configs/captive-core-pubnet.cfg",
CaptiveCoreBinaryPath: "/path/to/captive-core/binary",
},
networkPassphrase: PubnetConf.NetworkPassphrase,
Expand Down Expand Up @@ -171,7 +171,7 @@ func Test_createCaptiveCoreConfig(t *testing.T) {
config: Config{
NetworkPassphrase: PubnetConf.NetworkPassphrase,
HistoryArchiveURLs: PubnetConf.HistoryArchiveURLs,
CaptiveCoreConfigPath: "configs/captive-core-testnet.cfg",
CaptiveCoreConfigPath: "../../../ingest/ledgerbackend/configs/captive-core-testnet.cfg",
CaptiveCoreBinaryPath: "/path/to/captive-core/binary",
},
errStr: fmt.Sprintf("invalid captive core toml file: invalid captive core toml: "+
Expand Down

0 comments on commit 64cb187

Please sign in to comment.