aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-10 06:25:46 +0800
committerFelix Lange <fjl@twurst.com>2015-03-10 06:25:46 +0800
commit9bf513e99305af733110cf23a0b47c8e73359010 (patch)
treef9d36e1ae1f2f7c3eb803c7499a4e85a5cdcd5bd /cmd/utils/flags.go
parentcd51860bf024d949a09b3863c88a278a386227a7 (diff)
parent676a0de58d3d7c508b0eeeff192d2095a46f7382 (diff)
downloaddexon-9bf513e99305af733110cf23a0b47c8e73359010.tar
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.gz
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.bz2
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.lz
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.xz
dexon-9bf513e99305af733110cf23a0b47c8e73359010.tar.zst
dexon-9bf513e99305af733110cf23a0b47c8e73359010.zip
Merge ethereum/poc-9 into accounts-integration
Conflicts: cmd/utils/cmd.go cmd/utils/flags.go core/manager.go eth/backend.go rpc/http/server.go xeth/xeth.go
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go26
1 files changed, 19 insertions, 7 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 2995ebad8..ee7ea4c79 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -45,9 +45,15 @@ func NewApp(version, usage string) *cli.App {
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",
}
DataDirFlag = cli.StringFlag{
Name: "datadir",
@@ -161,6 +167,7 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum {
LogFormat: ctx.GlobalString(LogFormatFlag.Name),
MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name),
AccountManager: GetAccountManager(ctx),
+ VmDebug: ctx.GlobalBool(VMDebugFlag.Name),
MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name),
Port: ctx.GlobalString(ListenPortFlag.Name),
NAT: GetNAT(ctx),
@@ -175,13 +182,18 @@ 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)
+ }
+
+ stateDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "state"))
if err != nil {
Fatalf("Could not open database: %v", err)
}
- return core.NewChainManager(db, new(event.TypeMux)), db
+ return core.NewChainManager(blockDb, stateDb, new(event.TypeMux)), blockDb, stateDb
}
func GetAccountManager(ctx *cli.Context) *accounts.Manager {
@@ -199,5 +211,5 @@ func StartRPC(eth *eth.Ethereum, ctx *cli.Context) {
if err != nil {
Fatalf("Can't listen on %s:%d: %v", addr, port, err)
}
- go http.Serve(l, rpc.JSONRPC(xeth.New(eth), dataDir))
+ go http.Serve(l, rpc.JSONRPC(xeth.New(eth, nil), dataDir))
}