From ed84b58af57809a743e5be6f6ea53c079c50b765 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 6 Mar 2015 16:58:52 +0100 Subject: Debug option for VM & command line flag --- cmd/utils/flags.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cmd/utils') diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index fb80ac708..d363ef280 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -26,9 +26,15 @@ import ( var ( // General settings - VMTypeFlag = cli.IntFlag{ - Name: "vm", - Usage: "Virtual Machine type: 0 is standard VM, 1 is debug VM", + /* + VMTypeFlag = cli.IntFlag{ + Name: "vm", + Usage: "Virtual Machine type: 0 is standard VM, 1 is debug VM", + } + */ + VMDebugFlag = cli.BoolFlag{ + Name: "vmdebug", + Usage: "Virtual Machine debug output", } KeyRingFlag = cli.StringFlag{ Name: "keyring", @@ -152,6 +158,7 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum { LogLevel: ctx.GlobalInt(LogLevelFlag.Name), LogFormat: ctx.GlobalString(LogFormatFlag.Name), MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name), + VmDebug: ctx.GlobalBool(VMDebugFlag.Name), MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name), Port: ctx.GlobalString(ListenPortFlag.Name), -- cgit From cd856cb2133d390758bb24b88fa3b538bb7bc306 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 6 Mar 2015 18:26:16 +0100 Subject: Separated block db from state db. Partial fix for #416 --- cmd/utils/cmd.go | 2 +- cmd/utils/flags.go | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'cmd/utils') diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 3c3d3955d..99e60ff9e 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -197,7 +197,7 @@ func BlockDo(ethereum *eth.Ethereum, hash []byte) error { parent := ethereum.ChainManager().GetBlock(block.ParentHash()) - statedb := state.New(parent.Root(), ethereum.Db()) + statedb := state.New(parent.Root(), ethereum.StateDb()) _, err := ethereum.BlockProcessor().TransitionState(statedb, parent, block, true) if err != nil { return err diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index d363ef280..88ff3558d 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -175,11 +175,16 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum { return ethereum } -func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database) { +func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database, ethutil.Database) { dataDir := ctx.GlobalString(DataDirFlag.Name) - db, err := ethdb.NewLDBDatabase(path.Join(dataDir, "blockchain")) + blockDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "blockchain")) if err != nil { Fatalf("Could not open database: %v", err) } - return core.NewChainManager(db, new(event.TypeMux)), db + + stateDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "state")) + if err != nil { + Fatalf("Could not open database: %v", err) + } + return core.NewChainManager(blockDb, stateDb, new(event.TypeMux)), blockDb, stateDb } -- cgit From 20741a96ac6dc824bcc7d67e7c966fa65cbb2faf Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 9 Mar 2015 13:50:05 +0100 Subject: Updated xeth instances to take extra param for ui.Interface Please be aware that if any of the instances on xeth.frontend are called the program will crash due to the default, temporarily, frontend interface. --- cmd/utils/cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/utils') diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 99e60ff9e..a77c6ad4d 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -167,7 +167,7 @@ func KeyTasks(keyManager *crypto.KeyManager, KeyRing string, GenAddr bool, Secre func StartRpc(ethereum *eth.Ethereum, RpcListenAddress string, RpcPort int) { var err error - ethereum.RpcServer, err = rpchttp.NewRpcHttpServer(xeth.New(ethereum), RpcListenAddress, RpcPort) + ethereum.RpcServer, err = rpchttp.NewRpcHttpServer(xeth.New(ethereum, nil), RpcListenAddress, RpcPort) if err != nil { clilogger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err) } else { -- cgit