Skip to content

Commit

Permalink
Add a horizon flag for --captive-core-enable-soroban-diagnostic-events
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Bellamy committed Mar 16, 2023
1 parent 65d8b5e commit fd5845c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
23 changes: 12 additions & 11 deletions services/horizon/internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ type Config struct {
Port uint
AdminPort uint

EnableCaptiveCoreIngestion bool
EnableIngestionFiltering bool
UsingDefaultPubnetConfig bool
CaptiveCoreBinaryPath string
RemoteCaptiveCoreURL string
CaptiveCoreConfigPath string
CaptiveCoreTomlParams ledgerbackend.CaptiveCoreTomlParams
CaptiveCoreToml *ledgerbackend.CaptiveCoreToml
CaptiveCoreStoragePath string
CaptiveCoreReuseStoragePath bool
CaptiveCoreConfigUseDB bool
EnableCaptiveCoreIngestion bool
EnableIngestionFiltering bool
UsingDefaultPubnetConfig bool
CaptiveCoreBinaryPath string
RemoteCaptiveCoreURL string
CaptiveCoreConfigPath string
CaptiveCoreTomlParams ledgerbackend.CaptiveCoreTomlParams
CaptiveCoreToml *ledgerbackend.CaptiveCoreToml
CaptiveCoreStoragePath string
CaptiveCoreReuseStoragePath bool
CaptiveCoreConfigUseDB bool
CaptiveCoreConfigEnableSorobanDiagnosticEvents bool

StellarCoreDatabaseURL string
StellarCoreURL string
Expand Down
18 changes: 18 additions & 0 deletions services/horizon/internal/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const (
CaptiveCoreConfigPathName = "captive-core-config-path"
// captive-core-use-db is the command line flag for enabling captive core runtime to use an external db url connection rather than RAM for ledger states
CaptiveCoreConfigUseDB = "captive-core-use-db"
// captive-core-enable-soroban-diagnostic-events is the command line flag for enabling soroban diagnostic events in captive core
CaptiveCoreConfigEnableSorobanDiagnosticEvents = "captive-core-enable-soroban-diagnostic-events"

captiveCoreMigrationHint = "If you are migrating from Horizon 1.x.y, start with the Migration Guide here: https://developers.stellar.org/docs/run-api-server/migrating/"
)
Expand Down Expand Up @@ -193,6 +195,22 @@ func Flags() (*Config, support.ConfigOptions) {
},
ConfigKey: &config.CaptiveCoreConfigUseDB,
},
&support.ConfigOption{
Name: CaptiveCoreConfigEnableSorobanDiagnosticEvents,
OptType: types.Bool,
FlagDefault: false,
Required: false,
Usage: `when enabled, Horizon ingestion will instruct the captive
core invocation to emit Soroban diagnostic events.`,
CustomSetValue: func(opt *support.ConfigOption) error {
if val := viper.GetBool(opt.Name); val {
config.CaptiveCoreConfigEnableSorobanDiagnosticEvents = val
config.CaptiveCoreTomlParams.EnableSorobanDiagnosticEvents = val
}
return nil
},
ConfigKey: &config.CaptiveCoreConfigEnableSorobanDiagnosticEvents,
},
&support.ConfigOption{
Name: "enable-captive-core-ingestion",
OptType: types.Bool,
Expand Down

0 comments on commit fd5845c

Please sign in to comment.