mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 03:31:20 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package grpc_api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/golang/protobuf/ptypes/empty"
|
|
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/v5/validator/client/iface"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type grpcNodeClient struct {
|
|
nodeClient ethpb.NodeClient
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetSyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) {
|
|
return c.nodeClient.GetSyncStatus(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetGenesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) {
|
|
return c.nodeClient.GetGenesis(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) GetVersion(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) {
|
|
return c.nodeClient.GetVersion(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) {
|
|
return c.nodeClient.ListPeers(ctx, in)
|
|
}
|
|
|
|
func (c *grpcNodeClient) IsHealthy(context.Context) bool {
|
|
panic("function not supported for gRPC client")
|
|
}
|
|
|
|
func NewNodeClient(cc grpc.ClientConnInterface) iface.NodeClient {
|
|
return &grpcNodeClient{ethpb.NewNodeClient(cc)}
|
|
}
|