Skip to content

Commit

Permalink
Force captive core on-disk mode
Browse files Browse the repository at this point in the history
  • Loading branch information
stellarsaur committed Nov 20, 2023
1 parent 733ce06 commit e1b9924
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion cmd/soroban-rpc/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Config struct {
Strict bool

StellarCoreURL string
CaptiveCoreUseDB bool
CaptiveCoreStoragePath string
StellarCoreBinaryPath string
CaptiveCoreConfigPath string
Expand Down
6 changes: 0 additions & 6 deletions cmd/soroban-rpc/internal/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@ func (cfg *Config) options() ConfigOptions {
}
},
},
{
Name: "captive-core-use-db",
Usage: "informs captive core to use on disk mode. the db will by default be created in current runtime directory of soroban-rpc, unless DATABASE=<path> setting is present in captive core config file.",
ConfigKey: &cfg.CaptiveCoreUseDB,
DefaultValue: false,
},
{
Name: "history-archive-urls",
Usage: "comma-separated list of stellar history archives to connect with",
Expand Down
1 change: 0 additions & 1 deletion cmd/soroban-rpc/internal/config/toml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func TestBasicTomlReading(t *testing.T) {
// Check the fields got read correctly
assert.Equal(t, []string{"http://history-futurenet.stellar.org"}, cfg.HistoryArchiveURLs)
assert.Equal(t, network.FutureNetworkPassphrase, cfg.NetworkPassphrase)
assert.Equal(t, true, cfg.CaptiveCoreUseDB)
assert.Equal(t, "/etc/stellar/soroban-rpc", cfg.CaptiveCoreStoragePath)
assert.Equal(t, "/etc/stellar/soroban-rpc/captive-core.cfg", cfg.CaptiveCoreConfigPath)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/soroban-rpc/internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func newCaptiveCore(cfg *config.Config, logger *supportlog.Entry) (*ledgerbacken
HistoryArchiveURLs: cfg.HistoryArchiveURLs,
NetworkPassphrase: cfg.NetworkPassphrase,
Strict: true,
UseDB: cfg.CaptiveCoreUseDB,
UseDB: true,
EnforceSorobanDiagnosticEvents: true,
}
captiveCoreToml, err := ledgerbackend.NewCaptiveCoreTomlFromFile(cfg.CaptiveCoreConfigPath, captiveCoreTomlParams)
Expand All @@ -122,7 +122,7 @@ func newCaptiveCore(cfg *config.Config, logger *supportlog.Entry) (*ledgerbacken
Log: logger.WithField("subservice", "stellar-core"),
Toml: captiveCoreToml,
UserAgent: "captivecore",
UseDB: cfg.CaptiveCoreUseDB,
UseDB: true,
}
return ledgerbackend.NewCaptive(captiveConfig)

Expand Down
1 change: 0 additions & 1 deletion cmd/soroban-rpc/internal/test/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func (i *Test) launchDaemon(coreBinaryPath string) {
config.CaptiveCoreConfigPath = path.Join(i.composePath, "captive-core-integration-tests.cfg")
config.CaptiveCoreStoragePath = i.t.TempDir()
config.CaptiveCoreHTTPPort = 0
config.CaptiveCoreUseDB = true
config.FriendbotURL = friendbotURL
config.NetworkPassphrase = StandaloneNetworkPassphrase
config.HistoryArchiveURLs = []string{"http://localhost:1570"}
Expand Down

0 comments on commit e1b9924

Please sign in to comment.