diff options
Diffstat (limited to 'utils/cmd.go')
-rw-r--r-- | utils/cmd.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/utils/cmd.go b/utils/cmd.go index 700542cae..32aebc91e 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -19,9 +19,9 @@ import ( "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethminer" "github.com/ethereum/eth-go/ethpipe" - "github.com/ethereum/eth-go/ethrpc" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethwire" + "github.com/ethereum/eth-go/rpc" ) var logger = ethlog.NewLogger("CLI") @@ -118,9 +118,12 @@ func InitLogging(Datadir string, LogFile string, LogLevel int, DebugFile string) return sys } -func InitConfig(ConfigFile string, Datadir string, EnvPrefix string) *ethutil.ConfigManager { +func InitConfig(vmType int, ConfigFile string, Datadir string, EnvPrefix string) *ethutil.ConfigManager { InitDataDir(Datadir) - return ethutil.ReadConfig(ConfigFile, Datadir, EnvPrefix) + cfg := ethutil.ReadConfig(ConfigFile, Datadir, EnvPrefix) + cfg.VmType = vmType + + return cfg } func exit(err error) { @@ -166,7 +169,7 @@ func StartEthereum(ethereum *eth.Ethereum, UseSeed bool) { } func ShowGenesis(ethereum *eth.Ethereum) { - logger.Infoln(ethereum.BlockChain().Genesis()) + logger.Infoln(ethereum.ChainManager().Genesis()) exit(nil) } @@ -241,7 +244,7 @@ func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, Se func StartRpc(ethereum *eth.Ethereum, RpcPort int) { var err error - ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpipe.NewJSPipe(ethereum), RpcPort) + ethereum.RpcServer, err = rpc.NewJsonRpcServer(ethpipe.NewJSPipe(ethereum), RpcPort) if err != nil { logger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err) } else { @@ -307,12 +310,12 @@ func StopMining(ethereum *eth.Ethereum) bool { // Replay block func BlockDo(ethereum *eth.Ethereum, hash []byte) error { - block := ethereum.BlockChain().GetBlock(hash) + block := ethereum.ChainManager().GetBlock(hash) if block == nil { return fmt.Errorf("unknown block %x", hash) } - parent := ethereum.BlockChain().GetBlock(block.PrevHash) + parent := ethereum.ChainManager().GetBlock(block.PrevHash) _, err := ethereum.StateManager().ApplyDiff(parent.State(), parent, block) if err != nil { |