aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-28 21:52:09 +0800
committerobscuren <geffobscura@gmail.com>2015-01-28 21:52:09 +0800
commitb46e1ca97e61ebfe4c37961e723142245efe5016 (patch)
tree45838760ad08592995cd1051c29c6d41d08cd24c /cmd/utils
parent159c4d56cd82d6fe721058557977f4efda31661c (diff)
parente9d017ba082bfd624267c974fa93a77da6269756 (diff)
downloadgo-tangerine-b46e1ca97e61ebfe4c37961e723142245efe5016.tar
go-tangerine-b46e1ca97e61ebfe4c37961e723142245efe5016.tar.gz
go-tangerine-b46e1ca97e61ebfe4c37961e723142245efe5016.tar.bz2
go-tangerine-b46e1ca97e61ebfe4c37961e723142245efe5016.tar.lz
go-tangerine-b46e1ca97e61ebfe4c37961e723142245efe5016.tar.xz
go-tangerine-b46e1ca97e61ebfe4c37961e723142245efe5016.tar.zst
go-tangerine-b46e1ca97e61ebfe4c37961e723142245efe5016.zip
Merge branch 'jsonrpc' of github.com-obscure:ethereum/go-ethereum into jsonrpc
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/cmd.go20
1 files changed, 14 insertions, 6 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index 95a7f89c8..9cdd8b5d1 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -38,9 +38,10 @@ import (
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/rlp"
- "github.com/ethereum/go-ethereum/rpc"
+ rpchttp "github.com/ethereum/go-ethereum/rpc/http"
+ rpcws "github.com/ethereum/go-ethereum/rpc/ws"
"github.com/ethereum/go-ethereum/state"
- "github.com/ethereum/go-ethereum/websocket"
+ // "github.com/ethereum/go-ethereum/websocket"
"github.com/ethereum/go-ethereum/xeth"
)
@@ -193,7 +194,7 @@ func KeyTasks(keyManager *crypto.KeyManager, KeyRing string, GenAddr bool, Secre
func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
var err error
- ethereum.RpcServer, err = rpc.NewJsonRpcServer(xeth.NewJSXEth(ethereum), RpcPort)
+ ethereum.RpcServer, err = rpchttp.NewRpcHttpServer(xeth.NewJSXEth(ethereum), RpcPort)
if err != nil {
clilogger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err)
} else {
@@ -201,11 +202,18 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
}
}
-func StartWebSockets(eth *eth.Ethereum) {
+func StartWebSockets(eth *eth.Ethereum, wsPort int) {
clilogger.Infoln("Starting WebSockets")
- sock := websocket.NewWebSocketServer(eth)
- go sock.Serv()
+ // sock := websocket.NewWebSocketServer(eth)
+ // go sock.Serv()
+ var err error
+ eth.WsServer, err = rpcws.NewWebSocketServer(eth, wsPort)
+ if err != nil {
+ clilogger.Errorf("Could not start RPC interface (port %v): %v", wsPort, err)
+ } else {
+ go eth.WsServer.Start()
+ }
}
var gminer *miner.Miner