|
|
@ -122,28 +122,8 @@ func main() { |
|
|
|
// Set the max peers
|
|
|
|
// Set the max peers
|
|
|
|
ethereum.MaxPeers = MaxPeer |
|
|
|
ethereum.MaxPeers = MaxPeer |
|
|
|
|
|
|
|
|
|
|
|
if StartConsole { |
|
|
|
// Set Mining status
|
|
|
|
err := os.Mkdir(ethutil.Config.ExecPath, os.ModePerm) |
|
|
|
ethereum.Mining = StartMining |
|
|
|
// Error is OK if the error is ErrExist
|
|
|
|
|
|
|
|
if err != nil && !os.IsExist(err) { |
|
|
|
|
|
|
|
log.Panic("Unable to create EXECPATH:", err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console := NewConsole(ethereum) |
|
|
|
|
|
|
|
go console.Start() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if StartRpc { |
|
|
|
|
|
|
|
ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum), RpcPort) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
logger.Infoln("Could not start RPC interface:", err) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
go ethereum.RpcServer.Start() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RegisterInterrupts(ethereum) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ethereum.Start(UseSeed) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if StartMining { |
|
|
|
if StartMining { |
|
|
|
logger.Infoln("Miner started") |
|
|
|
logger.Infoln("Miner started") |
|
|
@ -168,6 +148,29 @@ func main() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if StartConsole { |
|
|
|
|
|
|
|
err := os.Mkdir(ethutil.Config.ExecPath, os.ModePerm) |
|
|
|
|
|
|
|
// Error is OK if the error is ErrExist
|
|
|
|
|
|
|
|
if err != nil && !os.IsExist(err) { |
|
|
|
|
|
|
|
log.Panic("Unable to create EXECPATH:", err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console := NewConsole(ethereum) |
|
|
|
|
|
|
|
go console.Start() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if StartRpc { |
|
|
|
|
|
|
|
ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum), RpcPort) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
logger.Infoln("Could not start RPC interface:", err) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
go ethereum.RpcServer.Start() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RegisterInterrupts(ethereum) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ethereum.Start(UseSeed) |
|
|
|
|
|
|
|
|
|
|
|
// Wait for shutdown
|
|
|
|
// Wait for shutdown
|
|
|
|
ethereum.WaitForShutdown() |
|
|
|
ethereum.WaitForShutdown() |
|
|
|
} |
|
|
|
} |
|
|
|