Files
prysm/validator/client/node-client-factory/node_client_factory.go
Bastin 92bd211e4d upgrade v6 to v7 (#15989)
* upgrade v6 to v7

* changelog

* update-go-ssz
2025-11-06 16:16:23 +00:00

19 lines
713 B
Go

package node_client_factory
import (
"github.com/OffchainLabs/prysm/v7/config/features"
beaconApi "github.com/OffchainLabs/prysm/v7/validator/client/beacon-api"
grpcApi "github.com/OffchainLabs/prysm/v7/validator/client/grpc-api"
"github.com/OffchainLabs/prysm/v7/validator/client/iface"
validatorHelpers "github.com/OffchainLabs/prysm/v7/validator/helpers"
)
func NewNodeClient(validatorConn validatorHelpers.NodeConnection, jsonRestHandler beaconApi.RestHandler) iface.NodeClient {
grpcClient := grpcApi.NewNodeClient(validatorConn.GetGrpcClientConn())
if features.Get().EnableBeaconRESTApi {
return beaconApi.NewNodeClientWithFallback(jsonRestHandler, grpcClient)
} else {
return grpcClient
}
}