mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Use a single rest handler (#13446)
This commit is contained in:
@@ -49,6 +49,7 @@ go_library(
|
||||
"//validator/accounts/petnames:go_default_library",
|
||||
"//validator/accounts/wallet:go_default_library",
|
||||
"//validator/client:go_default_library",
|
||||
"//validator/client/beacon-api:go_default_library",
|
||||
"//validator/client/beacon-chain-client-factory:go_default_library",
|
||||
"//validator/client/iface:go_default_library",
|
||||
"//validator/client/node-client-factory:go_default_library",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
grpcretry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
||||
@@ -9,6 +11,7 @@ import (
|
||||
grpcutil "github.com/prysmaticlabs/prysm/v4/api/grpc"
|
||||
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/v4/validator/client"
|
||||
beaconApi "github.com/prysmaticlabs/prysm/v4/validator/client/beacon-api"
|
||||
beaconChainClientFactory "github.com/prysmaticlabs/prysm/v4/validator/client/beacon-chain-client-factory"
|
||||
nodeClientFactory "github.com/prysmaticlabs/prysm/v4/validator/client/node-client-factory"
|
||||
validatorClientFactory "github.com/prysmaticlabs/prysm/v4/validator/client/validator-client-factory"
|
||||
@@ -51,8 +54,13 @@ func (s *Server) registerBeaconClient() error {
|
||||
s.beaconApiTimeout,
|
||||
)
|
||||
|
||||
s.beaconChainClient = beaconChainClientFactory.NewBeaconChainClient(conn)
|
||||
s.beaconNodeClient = nodeClientFactory.NewNodeClient(conn)
|
||||
s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn)
|
||||
restHandler := &beaconApi.BeaconApiJsonRestHandler{
|
||||
HttpClient: http.Client{Timeout: s.beaconApiTimeout},
|
||||
Host: s.beaconApiEndpoint,
|
||||
}
|
||||
s.beaconChainClient = beaconChainClientFactory.NewBeaconChainClient(conn, restHandler)
|
||||
s.beaconNodeClient = nodeClientFactory.NewNodeClient(conn, restHandler)
|
||||
s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, restHandler)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user