From fb54640823055d6a89b592b982c189a29e172277 Mon Sep 17 00:00:00 2001 From: i-norden Date: Wed, 24 Nov 2021 11:26:33 -0600 Subject: [PATCH] add some missing ENVs --- cmd/env.go | 12 ++++++++++++ cmd/root.go | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/cmd/env.go b/cmd/env.go index c2f8b8a..deddea1 100644 --- a/cmd/env.go +++ b/cmd/env.go @@ -49,6 +49,12 @@ const ( PRERUN_ONLY = "PRERUN_ONLY" PRERUN_RANGE_START = "PRERUN_RANGE_START" PRERUN_RANGE_STOP = "PRERUN_RANGE_STOP" + PRERUN_INTERMEDIATE_STATE_NODES = "PRERUN_INTERMEDIATE_STATE_NODES" + PRERUN_INTERMEDIATE_STORAGE_NODES = "PRERUN_INTERMEDIATE_STORAGE_NODES" + PRERUN_INCLUDE_BLOCK = "PRERUN_INCLUDE_BLOCK" + PRERUN_INCLUDE_RECEIPTS = "PRERUN_INCLUDE_RECEIPTS" + PRERUN_INCLUDE_TD = "PRERUN_INCLUDE_TD" + PRERUN_INCLUDE_CODE = "PRERUN_INCLUDE_CODE" LOG_LEVEL = "LOG_LEVEL" LOG_FILE_PATH = "LOG_FILE_PATH" @@ -121,6 +127,12 @@ func init() { viper.BindEnv("prerun.only", PRERUN_ONLY) viper.BindEnv("prerun.start", PRERUN_RANGE_START) viper.BindEnv("prerun.stop", PRERUN_RANGE_STOP) + viper.BindEnv("prerun.params.intermediateStateNodes", PRERUN_INTERMEDIATE_STATE_NODES) + viper.BindEnv("prerun.params.intermediateStorageNodes", PRERUN_INTERMEDIATE_STORAGE_NODES) + viper.BindEnv("prerun.params.includeBlock", PRERUN_INCLUDE_BLOCK) + viper.BindEnv("prerun.params.includeReceipts", PRERUN_INCLUDE_RECEIPTS) + viper.BindEnv("prerun.params.includeTD", PRERUN_INCLUDE_TD) + viper.BindEnv("prerun.params.includeCode", PRERUN_INCLUDE_CODE) viper.BindEnv("log.level", LOG_LEVEL) viper.BindEnv("log.file", LOG_FILE_PATH) diff --git a/cmd/root.go b/cmd/root.go index 5b2e438..c436c23 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -159,6 +159,13 @@ func init() { rootCmd.PersistentFlags().Bool("prerun-only", false, "only process pre-configured ranges; exit afterwards") rootCmd.PersistentFlags().Int("prerun-start", 0, "start height for a prerun range") rootCmd.PersistentFlags().Int("prerun-stop", 0, "stop height for a prerun range") + rootCmd.PersistentFlags().Bool("prerun-intermediate-state-nodes", true, "include intermediate state nodes in state diff") + rootCmd.PersistentFlags().Bool("prerun-intermediate-storage-nodes", true, "include intermediate storage nodes in state diff") + rootCmd.PersistentFlags().Bool("prerun-include-block", true, "include block data in the statediff payload") + rootCmd.PersistentFlags().Bool("prerun-include-receipts", true, "include receipts in the statediff payload") + rootCmd.PersistentFlags().Bool("prerun-include-td", true, "include td in the statediff payload") + rootCmd.PersistentFlags().Bool("prerun-include-code", true, "include code and codehash mappings in statediff payload") + viper.BindPFlag("server.httpPath", rootCmd.PersistentFlags().Lookup("http-path")) viper.BindPFlag("server.ipcPath", rootCmd.PersistentFlags().Lookup("ipc-path")) @@ -208,6 +215,12 @@ func init() { viper.BindPFlag("prerun.only", rootCmd.PersistentFlags().Lookup("prerun-only")) viper.BindPFlag("prerun.start", rootCmd.PersistentFlags().Lookup("prerun-start")) viper.BindPFlag("prerun.stop", rootCmd.PersistentFlags().Lookup("prerun-stop")) + viper.BindPFlag("prerun.params.intermediateStateNodes", rootCmd.PersistentFlags().Lookup("prerun-intermediate-state-nodes")) + viper.BindPFlag("prerun.params.intermediateStorageNodes", rootCmd.PersistentFlags().Lookup("prerun-intermediate-storage-nodes")) + viper.BindPFlag("prerun.params.includeBlock", rootCmd.PersistentFlags().Lookup("prerun-include-block")) + viper.BindPFlag("prerun.params.includeReceipts", rootCmd.PersistentFlags().Lookup("prerun-include-receipts")) + viper.BindPFlag("prerun.params.includeTD", rootCmd.PersistentFlags().Lookup("prerun-include-td")) + viper.BindPFlag("prerun.params.includeCode", rootCmd.PersistentFlags().Lookup("prerun-include-code")) rand.Seed(time.Now().UnixNano()) }