2023-01-23 06:45:09 -08:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/certusone/wormhole/node/pkg/common"
|
|
|
|
publicrpcv1 "github.com/certusone/wormhole/node/pkg/proto/publicrpc/v1"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Server struct {
|
|
|
|
Srv *grpc.Server
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewServer creates a GRPC server.
|
|
|
|
func NewServer(h *Handler, logger *zap.Logger) *grpc.Server {
|
2023-03-15 12:52:50 -07:00
|
|
|
grpcServer := common.NewInstrumentedGRPCServer(logger, common.GrpcLogDetailMinimal)
|
2023-01-23 06:45:09 -08:00
|
|
|
publicrpcv1.RegisterPublicRPCServiceServer(grpcServer, h)
|
|
|
|
return grpcServer
|
|
|
|
}
|