From 8ef1e0c9051219a3713898cc8b6d3eb5eda7a797 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:03:52 -0800 Subject: [PATCH 1/3] Add call options to Ping --- access/grpc/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/access/grpc/client.go b/access/grpc/client.go index 3e04cef8c..282729c88 100644 --- a/access/grpc/client.go +++ b/access/grpc/client.go @@ -62,8 +62,8 @@ type Client struct { grpc *BaseClient } -func (c *Client) Ping(ctx context.Context) error { - return c.grpc.Ping(ctx) +func (c *Client) Ping(ctx context.Context, opts ...grpc.CallOption) error { + return c.grpc.Ping(ctx, opts...) } func (c *Client) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error) { From 584959937ab76dfd90237fa992dc90022d103f50 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:08:22 -0800 Subject: [PATCH 2/3] Revert "Add call options to Ping" This reverts commit 8ef1e0c9051219a3713898cc8b6d3eb5eda7a797. --- access/grpc/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/access/grpc/client.go b/access/grpc/client.go index 282729c88..3e04cef8c 100644 --- a/access/grpc/client.go +++ b/access/grpc/client.go @@ -62,8 +62,8 @@ type Client struct { grpc *BaseClient } -func (c *Client) Ping(ctx context.Context, opts ...grpc.CallOption) error { - return c.grpc.Ping(ctx, opts...) +func (c *Client) Ping(ctx context.Context) error { + return c.grpc.Ping(ctx) } func (c *Client) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error) { From 150b76ddcd3c8410e542626464de2656dcd040c0 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:08:28 -0800 Subject: [PATCH 3/3] Add WaitServer to grpc --- access/grpc/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/access/grpc/client.go b/access/grpc/client.go index 3e04cef8c..e56883945 100644 --- a/access/grpc/client.go +++ b/access/grpc/client.go @@ -66,6 +66,10 @@ func (c *Client) Ping(ctx context.Context) error { return c.grpc.Ping(ctx) } +func (c *Client) WaitServer(ctx context.Context) error { + return c.grpc.Ping(ctx, grpc.WaitForReady(true)) +} + func (c *Client) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error) { return c.grpc.GetLatestBlockHeader(ctx, isSealed) }