rpc cleanup; tendermint init

This commit is contained in:
Jae Kwon
2015-05-12 19:03:05 -07:00
parent dd3d35f9f1
commit be90fd1e0d
7 changed files with 25 additions and 22 deletions

View File

@ -26,15 +26,21 @@ func Status() (*ctypes.ResponseStatus, error) {
latestBlockTime = latestBlockMeta.Header.Time.UnixNano()
}
return &ctypes.ResponseStatus{genesisHash, config.App().GetString("network"), latestBlockHash, latestHeight, latestBlockTime}, nil
return &ctypes.ResponseStatus{
Moniker: config.App().GetString("moniker"),
Network: config.App().GetString("network"),
Version: config.App().GetString("version"),
GenesisHash: genesisHash,
PubKey: privValidator.PubKey,
LatestBlockHash: latestBlockHash,
LatestBlockHeight: latestHeight,
LatestBlockTime: latestBlockTime}, nil
}
//-----------------------------------------------------------------------------
func NetInfo() (*ctypes.ResponseNetInfo, error) {
listening := p2pSwitch.IsListening()
moniker := config.App().GetString("moniker")
network := config.App().GetString("network")
listeners := []string{}
for _, listener := range p2pSwitch.Listeners() {
listeners = append(listeners, listener.String())
@ -47,8 +53,6 @@ func NetInfo() (*ctypes.ResponseNetInfo, error) {
})
}
return &ctypes.ResponseNetInfo{
Moniker: moniker,
Network: network,
Listening: listening,
Listeners: listeners,
Peers: peers,