|
|
|
@ -39,8 +39,9 @@ import ( |
|
|
|
|
"github.com/ethereum/go-ethereum/miner" |
|
|
|
|
"github.com/ethereum/go-ethereum/rlp" |
|
|
|
|
rpchttp "github.com/ethereum/go-ethereum/rpc/http" |
|
|
|
|
rpcws "github.com/ethereum/go-ethereum/rpc/websocket" |
|
|
|
|
"github.com/ethereum/go-ethereum/state" |
|
|
|
|
"github.com/ethereum/go-ethereum/websocket" |
|
|
|
|
// "github.com/ethereum/go-ethereum/websocket"
|
|
|
|
|
"github.com/ethereum/go-ethereum/xeth" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -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 |
|
|
|
|