|
@ -499,10 +499,10 @@ func (n *Node) startRPC() ([]net.Listener, error) { |
|
|
for i, listenAddr := range listenAddrs { |
|
|
for i, listenAddr := range listenAddrs { |
|
|
mux := http.NewServeMux() |
|
|
mux := http.NewServeMux() |
|
|
rpcLogger := n.Logger.With("module", "rpc-server") |
|
|
rpcLogger := n.Logger.With("module", "rpc-server") |
|
|
wm := rpcserver.NewWebsocketManager(rpccore.Routes, rpcserver.EventSubscriber(n.eventBus)) |
|
|
|
|
|
|
|
|
wm := rpcserver.NewWebsocketManager(rpccore.Routes, rpccore.RoutesCodec, rpcserver.EventSubscriber(n.eventBus)) |
|
|
wm.SetLogger(rpcLogger.With("protocol", "websocket")) |
|
|
wm.SetLogger(rpcLogger.With("protocol", "websocket")) |
|
|
mux.HandleFunc("/websocket", wm.WebsocketHandler) |
|
|
mux.HandleFunc("/websocket", wm.WebsocketHandler) |
|
|
rpcserver.RegisterRPCFuncs(mux, rpccore.Routes, rpcLogger) |
|
|
|
|
|
|
|
|
rpcserver.RegisterRPCFuncs(mux, rpccore.Routes, rpccore.RoutesCodec, rpcLogger) |
|
|
listener, err := rpcserver.StartHTTPServer(listenAddr, mux, rpcLogger) |
|
|
listener, err := rpcserver.StartHTTPServer(listenAddr, mux, rpcLogger) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
|