network > chain_id, put in genesis.json

This commit is contained in:
Ethan Buchman
2015-05-29 14:13:45 -04:00
parent bb67fe0356
commit 8a2d9525f0
22 changed files with 139 additions and 60 deletions

View File

@ -1,6 +1,8 @@
package core
import (
"io/ioutil"
dbm "github.com/tendermint/tendermint/db"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
sm "github.com/tendermint/tendermint/state"
@ -27,7 +29,7 @@ func Status() (*ctypes.ResponseStatus, error) {
return &ctypes.ResponseStatus{
Moniker: config.GetString("moniker"),
Network: config.GetString("network"),
ChainID: config.GetString("chain_id"),
Version: config.GetString("version"),
GenesisHash: genesisHash,
PubKey: privValidator.PubKey,
@ -57,3 +59,14 @@ func NetInfo() (*ctypes.ResponseNetInfo, error) {
Peers: peers,
}, nil
}
//-----------------------------------------------------------------------------
// returns pointer because the rpc-gen code returns nil (TODO!)
func Genesis() (*string, error) {
b, err := ioutil.ReadFile(config.GetString("genesis_file"))
if err != nil {
return "", err
}
return &string(b), nil
}

View File

@ -66,7 +66,7 @@ type Receipt struct {
type ResponseStatus struct {
Moniker string `json:"moniker"`
Network string `json:"network"`
ChainID string `json:"chain_id"`
Version string `json:"version"`
GenesisHash []byte `json:"genesis_hash"`
PubKey account.PubKey `json:"pub_key"`