Skip to content

Commit

Permalink
Remove --stellar-core-url check when DISABLE_TX_SUB=true, INGEST=false (
Browse files Browse the repository at this point in the history
#5126)

* remove --stellar-core-url check

* Update parameters_test.go
  • Loading branch information
aditya1702 authored Nov 28, 2023
1 parent eb5054f commit ee5c26f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions services/horizon/internal/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ func isLocalAddress(url string, port uint) bool {
func (a *App) UpdateCoreLedgerState(ctx context.Context) {
var next ledger.CoreStatus

if a.config.StellarCoreURL == "" {
return
}
// #4446 If the ingestion state machine is in the build state, the query can time out
// because the captive-core buffer may be full. In this case, skip the check.
if a.config.CaptiveCoreToml != nil &&
Expand Down
2 changes: 1 addition & 1 deletion services/horizon/internal/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ func NewAppFromFlags(config *Config, flags support.ConfigOptions) (*App, error)
return nil, err
}
// Validate app-specific arguments
if config.StellarCoreURL == "" {
if (!config.DisableTxSub || config.Ingest) && config.StellarCoreURL == "" {
return nil, fmt.Errorf("flag --%s cannot be empty", StellarCoreURLFlagName)
}

Expand Down
14 changes: 14 additions & 0 deletions services/horizon/internal/integration/parameters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,20 @@ func TestDisableTxSub(t *testing.T) {
test.WaitForHorizon()
test.Shutdown()
})
t.Run("do not require stellar-core-url when both DISABLE_TX_SUB=true and INGEST=false", func(t *testing.T) {
localParams := integration.MergeMaps(networkParamArgs, map[string]string{
horizon.NetworkFlagName: "testnet",
horizon.IngestFlagName: "false",
horizon.DisableTxSubFlagName: "true",
})
testConfig := integration.GetTestConfig()
testConfig.HorizonIngestParameters = localParams
testConfig.SkipCoreContainerCreation = true
test := integration.NewTest(t, *testConfig)
err := test.StartHorizon()
assert.NoError(t, err)
test.Shutdown()
})
}

func TestDeprecatedOutputs(t *testing.T) {
Expand Down

0 comments on commit ee5c26f

Please sign in to comment.