mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-31 20:18:37 +00:00
Remove unused backend
This commit is contained in:
parent
bb6215bce5
commit
3ded1c14c3
3 changed files with 6 additions and 7 deletions
|
|
@ -197,7 +197,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
||||||
filterSystem := utils.RegisterFilterAPI(stack, backend, &cfg.Eth)
|
filterSystem := utils.RegisterFilterAPI(stack, backend, &cfg.Eth)
|
||||||
|
|
||||||
// TODO: ENG191 add flag to request endpoint
|
// TODO: ENG191 add flag to request endpoint
|
||||||
utils.RegisterHealthService(stack, backend, &cfg.Node)
|
utils.RegisterHealthService(stack, &cfg.Node)
|
||||||
|
|
||||||
// Configure GraphQL if requested.
|
// Configure GraphQL if requested.
|
||||||
if ctx.IsSet(utils.GraphQLEnabledFlag.Name) {
|
if ctx.IsSet(utils.GraphQLEnabledFlag.Name) {
|
||||||
|
|
|
||||||
|
|
@ -1885,8 +1885,8 @@ func RegisterGraphQLService(stack *node.Node, backend ethapi.Backend, filterSyst
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterHealthService adds the Health API to the node.
|
// RegisterHealthService adds the Health API to the node.
|
||||||
func RegisterHealthService(stack *node.Node, backend ethapi.Backend, cfg *node.Config) {
|
func RegisterHealthService(stack *node.Node, cfg *node.Config) {
|
||||||
err := health.New(stack, backend, cfg.HTTPCors, cfg.HTTPVirtualHosts)
|
err := health.New(stack, cfg.HTTPCors, cfg.HTTPVirtualHosts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Failed to register the health service: %v", err)
|
Fatalf("Failed to register the health service: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/ethclient"
|
"github.com/ethereum/go-ethereum/ethclient"
|
||||||
"github.com/ethereum/go-ethereum/internal/ethapi"
|
|
||||||
"github.com/ethereum/go-ethereum/node"
|
"github.com/ethereum/go-ethereum/node"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,13 +21,13 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// New constructs a new health service instance.
|
// New constructs a new health service instance.
|
||||||
func New(stack *node.Node, backend ethapi.Backend, cors, vhosts []string) error {
|
func New(stack *node.Node, cors, vhosts []string) error {
|
||||||
_, err := newHandler(stack, backend, cors, vhosts)
|
_, err := newHandler(stack, cors, vhosts)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// newHandler returns a new `http.Handler` that will answer node health queries.
|
// newHandler returns a new `http.Handler` that will answer node health queries.
|
||||||
func newHandler(stack *node.Node, backend ethapi.Backend, cors, vhosts []string) (*handler, error) {
|
func newHandler(stack *node.Node, cors, vhosts []string) (*handler, error) {
|
||||||
ec := ethclient.NewClient(stack.Attach())
|
ec := ethclient.NewClient(stack.Attach())
|
||||||
h := handler{ec}
|
h := handler{ec}
|
||||||
handler := node.NewHTTPHandlerStack(h, cors, vhosts, nil)
|
handler := node.NewHTTPHandlerStack(h, cors, vhosts, nil)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue