Begin writing RPC HTTP Server

This commit is contained in:
Jae Kwon
2014-11-27 04:04:07 -08:00
parent ae8ef77d10
commit 8e9c060e6d
12 changed files with 475 additions and 48 deletions

View File

@ -10,6 +10,7 @@ import (
db_ "github.com/tendermint/tendermint/db"
mempool_ "github.com/tendermint/tendermint/mempool"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/rpc"
state_ "github.com/tendermint/tendermint/state"
)
@ -71,7 +72,7 @@ func NewNode() *Node {
}
func (n *Node) Start() {
log.Info("Starting node")
log.Info("Starting Node")
for _, l := range n.lz {
go n.inboundConnectionRoutine(l)
}
@ -80,7 +81,7 @@ func (n *Node) Start() {
}
func (n *Node) Stop() {
log.Info("Stopping node")
log.Info("Stopping Node")
// TODO: gracefully disconnect from peers.
n.sw.Stop()
n.book.Stop()
@ -134,6 +135,11 @@ func daemon() {
}
}
// Run the RPC server.
if config.Config.RPC.HTTPPort != 0 {
rpc.StartHTTPServer()
}
// Sleep forever and then...
trapSignal(func() {
n.Stop()