Implemented new JS/EthPub methods

- getTxCountAt
- getPeerCount
- getIsMining
- getIsListening
- getCoinbase
This commit is contained in:
Maran
2014-05-13 14:43:08 +02:00
parent dd60382fc3
commit 20ea78945e
3 changed files with 66 additions and 22 deletions

View File

@ -122,28 +122,8 @@ func main() {
// Set the max peers
ethereum.MaxPeers = MaxPeer
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)
// Set Mining status
ethereum.Mining = StartMining
if StartMining {
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
ethereum.WaitForShutdown()
}