Skip to content

Commit

Permalink
Merge pull request #4885 from onflow/leo/make-path-default-for-container
Browse files Browse the repository at this point in the history
[Node operation improvement] Make path configs to be usable by container by default
  • Loading branch information
zhangchiqing authored Oct 30, 2023
2 parents 98e362c + 19876c9 commit b7efb97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 3 additions & 5 deletions cmd/execution_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"fmt"
"os"
"path/filepath"
"strings"
"time"
Expand Down Expand Up @@ -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)")
Expand 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")
Expand Down
5 changes: 1 addition & 4 deletions cmd/node_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package cmd

import (
"context"
"os"
"path/filepath"
"time"

"github.com/dgraph-io/badger/v2"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit b7efb97

Please sign in to comment.