fix http server

This commit is contained in:
Roy Crihfield 2020-11-16 18:15:53 +08:00
parent abff9bf045
commit a93eb3ce35

View File

@ -21,6 +21,7 @@ import (
"os/signal"
"sync"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/sirupsen/logrus"
@ -127,11 +128,10 @@ func startServers(serv sd.IService) error {
}
if httpPath != "" {
logWithCommand.Info("starting up HTTP server")
// XXX broken https://github.com/ethereum/go-ethereum/pull/21105
// if _, _, err := node.StartHTTPEndpoint(httpPath, rpc.HTTPTimeouts{}, handler); err != nil {
// return err
// }
// or node.RegisterHandler ?
handler := rpc.NewServer()
if _, _, err := node.StartHTTPEndpoint(httpPath, rpc.HTTPTimeouts{}, handler); err != nil {
return err
}
}
return nil
}