Skip to content

Commit

Permalink
Merge pull request #45 from onflow/ianthpun/grpcaccessclient
Browse files Browse the repository at this point in the history
use grpcAccess Client option in Gateway
  • Loading branch information
ianthpun authored May 7, 2024
2 parents 5e0bf14 + 151fc3f commit 7c9c45c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions gateway/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
grpcAccess "github.com/onflow/flow-go-sdk/access/grpc"
"github.com/onflow/flow-go/utils/grpcutils"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

"github.com/onflow/flowkit/v2/config"
)
Expand All @@ -45,18 +44,17 @@ type GrpcGateway struct {

// NewGrpcGateway returns a new gRPC gateway.

func NewGrpcGateway(network config.Network, opts ...grpc.DialOption) (*GrpcGateway, error) {
options := []grpc.DialOption{
func NewGrpcGateway(network config.Network, opts ...grpcAccess.ClientOption) (*GrpcGateway, error) {
opts = append(
opts,
grpcAccess.WithGRPCDialOptions(
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxGRPCMessageSize),
),
))

grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxGRPCMessageSize)),
}
options = append(options, opts...)
gClient, err := grpcAccess.NewClient(
network.Host,
grpcAccess.WithGRPCDialOptions(
options...,
),
opts...,
)

if err != nil || gClient == nil {
Expand Down

0 comments on commit 7c9c45c

Please sign in to comment.