Skip to content

Commit

Permalink
Adds grpcurl/reflection support for v1 apis via disperser-v2 reflecti…
Browse files Browse the repository at this point in the history
…on service (#954)
  • Loading branch information
pschork authored Dec 4, 2024
1 parent 4d6c2bb commit 9041f72
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions disperser/apiserver/server_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/Layr-Labs/eigenda/api"
pbcommon "github.com/Layr-Labs/eigenda/api/grpc/common"
pbv1 "github.com/Layr-Labs/eigenda/api/grpc/disperser"
pb "github.com/Layr-Labs/eigenda/api/grpc/disperser/v2"
"github.com/Layr-Labs/eigenda/common"
healthcheck "github.com/Layr-Labs/eigenda/common/healthcheck"
Expand All @@ -32,6 +33,11 @@ type OnchainState struct {
TTL time.Duration
}

// Include disperser v1 protos to support grpcurl/reflection of v1 APIs
type DispersalServerV1 struct {
pbv1.UnimplementedDisperserServer
}

type DispersalServerV2 struct {
pb.UnimplementedDisperserServer

Expand Down Expand Up @@ -98,6 +104,9 @@ func (s *DispersalServerV2) Start(ctx context.Context) error {
reflection.Register(gs)
pb.RegisterDisperserServer(gs, s)

// Unimplemented v1 server for grpcurl/reflection support
pbv1.RegisterDisperserServer(gs, &DispersalServerV1{})

// Register Server for Health Checks
name := pb.Disperser_ServiceDesc.ServiceName
healthcheck.RegisterHealthServer(name, gs)
Expand Down

0 comments on commit 9041f72

Please sign in to comment.