aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/cmd.go2
-rw-r--r--cmd/utils/flags.go31
2 files changed, 29 insertions, 4 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index f8f7f6376..983762db8 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -21,6 +21,7 @@ import (
"bufio"
"fmt"
"io"
+ "math"
"math/big"
"os"
"os/signal"
@@ -152,6 +153,7 @@ func InitOlympic() {
params.MaximumExtraDataSize = big.NewInt(1024)
NetworkIdFlag.Value = 0
core.BlockReward = big.NewInt(1.5e+18)
+ core.ExpDiffPeriod = big.NewInt(math.MaxInt64)
}
func FormatTransactionData(data string) []byte {
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index e0ea7116d..462da9305 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -27,6 +27,7 @@ import (
"runtime"
"strconv"
+ "github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/metrics"
"github.com/codegangsta/cli"
@@ -172,6 +173,25 @@ var (
Value: "",
}
+ // vm flags
+ VMDebugFlag = cli.BoolFlag{
+ Name: "vmdebug",
+ Usage: "Virtual Machine debug output",
+ }
+ VMForceJitFlag = cli.BoolFlag{
+ Name: "forcejit",
+ Usage: "Force the JIT VM to take precedence",
+ }
+ VMJitCacheFlag = cli.IntFlag{
+ Name: "jitcache",
+ Usage: "Amount of cached JIT VM programs",
+ Value: 64,
+ }
+ VMEnableJitFlag = cli.BoolFlag{
+ Name: "jitvm",
+ Usage: "Enable the JIT VM",
+ }
+
// logging and debug settings
LogFileFlag = cli.StringFlag{
Name: "logfile",
@@ -196,10 +216,6 @@ var (
Usage: "The syntax of the argument is a comma-separated list of pattern=N, where pattern is a literal file name (minus the \".go\" suffix) or \"glob\" pattern and N is a log verbosity level.",
Value: glog.GetVModule(),
}
- VMDebugFlag = cli.BoolFlag{
- Name: "vmdebug",
- Usage: "Virtual Machine debug output",
- }
BacktraceAtFlag = cli.GenericFlag{
Name: "backtrace_at",
Usage: "If set to a file and line number (e.g., \"block.go:271\") holding a logging statement, a stack trace will be logged",
@@ -434,6 +450,13 @@ func SetupLogger(ctx *cli.Context) {
glog.SetLogDir(ctx.GlobalString(LogFileFlag.Name))
}
+// SetupVM configured the VM package's global settings
+func SetupVM(ctx *cli.Context) {
+ vm.DisableJit = !ctx.GlobalBool(VMEnableJitFlag.Name)
+ vm.ForceJit = ctx.GlobalBool(VMForceJitFlag.Name)
+ vm.SetJITCacheSize(ctx.GlobalInt(VMJitCacheFlag.Name))
+}
+
// MakeChain creates a chain manager from set command line flags.
func MakeChain(ctx *cli.Context) (chain *core.ChainManager, chainDb common.Database) {
datadir := ctx.GlobalString(DataDirFlag.Name)