diff --git a/cmd/execution_config.go b/cmd/execution_config.go index 646860e238a..6c6e0033ad0 100644 --- a/cmd/execution_config.go +++ b/cmd/execution_config.go @@ -2,7 +2,6 @@ package cmd import ( "fmt" - "os" "path/filepath" "strings" "time" @@ -65,14 +64,13 @@ type ExecutionConfig struct { } func (exeConf *ExecutionConfig) SetupFlags(flags *pflag.FlagSet) { - homedir, _ := os.UserHomeDir() - datadir := filepath.Join(homedir, ".flow", "execution") + datadir := "/data" flags.StringVarP(&exeConf.rpcConf.ListenAddr, "rpc-addr", "i", "localhost:9000", "the address the gRPC server listens on") flags.UintVar(&exeConf.rpcConf.MaxMsgSize, "rpc-max-message-size", grpcutils.DefaultMaxMsgSize, "the maximum message size in bytes for messages sent or received over grpc") flags.BoolVar(&exeConf.rpcConf.RpcMetricsEnabled, "rpc-metrics-enabled", false, "whether to enable the rpc metrics") flags.StringVar(&exeConf.triedir, "triedir", datadir, "directory to store the execution State") - flags.StringVar(&exeConf.executionDataDir, "execution-data-dir", filepath.Join(homedir, ".flow", "execution_data"), "directory to use for storing Execution Data") + flags.StringVar(&exeConf.executionDataDir, "execution-data-dir", filepath.Join(datadir, "execution_data"), "directory to use for storing Execution Data") flags.Uint32Var(&exeConf.mTrieCacheSize, "mtrie-cache-size", 500, "cache size for MTrie") flags.UintVar(&exeConf.checkpointDistance, "checkpoint-distance", 20, "number of WAL segments between checkpoints") flags.UintVar(&exeConf.checkpointsToKeep, "checkpoints-to-keep", 5, "number of recent checkpoints to keep (0 to keep all)") @@ -81,7 +79,7 @@ func (exeConf *ExecutionConfig) SetupFlags(flags *pflag.FlagSet) { flags.BoolVar(&exeConf.computationConfig.ExtensiveTracing, "extensive-tracing", false, "adds high-overhead tracing to execution") flags.BoolVar(&exeConf.computationConfig.CadenceTracing, "cadence-tracing", false, "enables cadence runtime level tracing") flags.IntVar(&exeConf.computationConfig.MaxConcurrency, "computer-max-concurrency", 1, "set to greater than 1 to enable concurrent transaction execution") - flags.StringVar(&exeConf.chunkDataPackDir, "chunk-data-pack-dir", filepath.Join(homedir, ".flow", "chunk_data_packs"), "directory to use for storing chunk data packs") + flags.StringVar(&exeConf.chunkDataPackDir, "chunk-data-pack-dir", filepath.Join(datadir, "chunk_data_packs"), "directory to use for storing chunk data packs") flags.UintVar(&exeConf.chunkDataPackCacheSize, "chdp-cache", storage.DefaultCacheSize, "cache size for chunk data packs") flags.Uint32Var(&exeConf.chunkDataPackRequestsCacheSize, "chdp-request-queue", mempool.DefaultChunkDataPackRequestQueueSize, "queue size for chunk data pack requests") flags.DurationVar(&exeConf.requestInterval, "request-interval", 60*time.Second, "the interval between requests for the requester engine") diff --git a/cmd/node_builder.go b/cmd/node_builder.go index 96bbf0069c8..5b11df22a23 100644 --- a/cmd/node_builder.go +++ b/cmd/node_builder.go @@ -2,8 +2,6 @@ package cmd import ( "context" - "os" - "path/filepath" "time" "github.com/dgraph-io/badger/v2" @@ -243,8 +241,7 @@ type StateExcerptAtBoot struct { } func DefaultBaseConfig() *BaseConfig { - homedir, _ := os.UserHomeDir() - datadir := filepath.Join(homedir, ".flow", "database") + datadir := "/data/protocol" // NOTE: if the codec used in the network component is ever changed any code relying on // the message format specific to the codec must be updated. i.e: the AuthorizedSenderValidator.