Skip to content

Commit

Permalink
Add captive core deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
chowbao committed Oct 31, 2024
1 parent 2c5cec2 commit 5f209ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/utils/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func AddCommonFlags(flags *pflag.FlagSet) {
flags.Bool("testnet", false, "If set, will connect to Testnet instead of Mainnet.")
flags.Bool("futurenet", false, "If set, will connect to Futurenet instead of Mainnet.")
flags.StringToStringP("extra-fields", "u", map[string]string{}, "Additional fields to append to output jsons. Used for appending metadata")
flags.Bool("captive-core", false, "If set, run captive core to retrieve data. Otherwise use TxMeta file datastore.")
flags.Bool("captive-core", false, "(Deprecated; Will be removed in the Protocol 23 update) If set, run captive core to retrieve data. Otherwise use TxMeta file datastore.")
flags.String("datastore-path", "sdf-ledger-close-meta/ledgers", "Datastore bucket path to read txmeta files from.")
flags.Uint32("buffer-size", 200, "Buffer size sets the max limit for the number of txmeta files that can be held in memory.")
flags.Uint32("num-workers", 10, "Number of workers to spawn that read txmeta files from the datastore.")
Expand Down Expand Up @@ -344,6 +344,10 @@ func MustFlags(flags *pflag.FlagSet, logger *EtlLogger) FlagValues {
if err != nil {
logger.Fatal("could not get captive-core flag: ", err)
}
// Deprecation warning
if useCaptiveCore {
logger.Warn("warning: the option to run with captive-core will be deprecated in the Protocol 23 update")
}

datastorePath, err := flags.GetString("datastore-path")
if err != nil {
Expand Down Expand Up @@ -480,6 +484,9 @@ func MustCommonFlags(flags *pflag.FlagSet, logger *EtlLogger) CommonFlagValues {
if err != nil {
logger.Fatal("could not get captive-core flag: ", err)
}
if useCaptiveCore {
logger.Warn("warning: the option to run with captive-core will be deprecated in the Protocol 23 update")
}

datastorePath, err := flags.GetString("datastore-path")
if err != nil {
Expand Down

0 comments on commit 5f209ce

Please sign in to comment.