From 5f209ce0a446b85b1ba99d74b0e448ad0d897d58 Mon Sep 17 00:00:00 2001 From: Simon Chow Date: Thu, 31 Oct 2024 15:11:15 -0400 Subject: [PATCH] Add captive core deprecation warning --- internal/utils/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/utils/main.go b/internal/utils/main.go index 164fd563..4456f222 100644 --- a/internal/utils/main.go +++ b/internal/utils/main.go @@ -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.") @@ -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 { @@ -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 {