aboutsummaryrefslogtreecommitdiffstats
path: root/ethrpc/server.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-16 07:38:02 +0800
committerobscuren <geffobscura@gmail.com>2014-08-16 07:38:02 +0800
commit4bd6003b7fea3d6291f2ebde8b9f9264f1749985 (patch)
tree5732e90084b64b22c7a70cbc9aa728032663330f /ethrpc/server.go
parent7d95e8624a3bdca4a68b2a7ff6ed133264088cc1 (diff)
downloaddexon-4bd6003b7fea3d6291f2ebde8b9f9264f1749985.tar.gz
dexon-4bd6003b7fea3d6291f2ebde8b9f9264f1749985.tar.zst
dexon-4bd6003b7fea3d6291f2ebde8b9f9264f1749985.zip
removed pub completely in favour of pipe
Diffstat (limited to 'ethrpc/server.go')
-rw-r--r--ethrpc/server.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/ethrpc/server.go b/ethrpc/server.go
index d9d6f695b..4abe29aa9 100644
--- a/ethrpc/server.go
+++ b/ethrpc/server.go
@@ -2,11 +2,12 @@ package ethrpc
import (
"fmt"
- "github.com/ethereum/eth-go/ethlog"
- "github.com/ethereum/eth-go/ethpub"
"net"
"net/rpc"
"net/rpc/jsonrpc"
+
+ "github.com/ethereum/eth-go/ethlog"
+ "github.com/ethereum/eth-go/ethpipe"
)
var logger = ethlog.NewLogger("JSON")
@@ -14,7 +15,7 @@ var logger = ethlog.NewLogger("JSON")
type JsonRpcServer struct {
quit chan bool
listener net.Listener
- ethp *ethpub.PEthereum
+ pipe *ethpipe.JSPipe
}
func (s *JsonRpcServer) exitHandler() {
@@ -37,7 +38,7 @@ func (s *JsonRpcServer) Stop() {
func (s *JsonRpcServer) Start() {
logger.Infoln("Starting JSON-RPC server")
go s.exitHandler()
- rpc.Register(&EthereumApi{ethp: s.ethp})
+ rpc.Register(&EthereumApi{pipe: s.pipe})
rpc.HandleHTTP()
for {
@@ -51,7 +52,7 @@ func (s *JsonRpcServer) Start() {
}
}
-func NewJsonRpcServer(ethp *ethpub.PEthereum, port int) (*JsonRpcServer, error) {
+func NewJsonRpcServer(pipe *ethpipe.JSPipe, port int) (*JsonRpcServer, error) {
sport := fmt.Sprintf(":%d", port)
l, err := net.Listen("tcp", sport)
if err != nil {
@@ -61,6 +62,6 @@ func NewJsonRpcServer(ethp *ethpub.PEthereum, port int) (*JsonRpcServer, error)
return &JsonRpcServer{
listener: l,
quit: make(chan bool),
- ethp: ethp,
+ pipe: pipe,
}, nil
}