Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Add addPeer RPC #1033

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions direct/eth_backend_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ func (s *EthBackendClientDirect) Peers(ctx context.Context, in *emptypb.Empty, o
return s.server.Peers(ctx, in)
}

func (s *EthBackendClientDirect) AddPeer(ctx context.Context, in *remote.AddPeerRequest, opts ...grpc.CallOption) (*remote.AddPeerReply, error) {
return s.server.AddPeer(ctx, in)
}

func (s *EthBackendClientDirect) PendingBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*remote.PendingBlockReply, error) {
return s.server.PendingBlock(ctx, in)
}
Expand Down
9 changes: 9 additions & 0 deletions direct/sentinel_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ func (s *SentinelClientDirect) GetPeers(ctx context.Context, in *sentinel.EmptyM
func (s *SentinelClientDirect) BanPeer(ctx context.Context, p *sentinel.Peer, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) {
return s.server.BanPeer(ctx, p)
}
func (s *SentinelClientDirect) UnbanPeer(ctx context.Context, p *sentinel.Peer, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) {
return s.server.UnbanPeer(ctx, p)
}
func (s *SentinelClientDirect) RewardPeer(ctx context.Context, p *sentinel.Peer, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) {
return s.server.RewardPeer(ctx, p)
}
func (s *SentinelClientDirect) PenalizePeer(ctx context.Context, p *sentinel.Peer, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) {
return s.server.PenalizePeer(ctx, p)
}

func (s *SentinelClientDirect) PublishGossip(ctx context.Context, in *sentinel.GossipData, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) {
return s.server.PublishGossip(ctx, in)
Expand Down
4 changes: 4 additions & 0 deletions direct/sentry_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ func (c *SentryClientDirect) PeerEvents(ctx context.Context, in *sentry.PeerEven
return &SentryPeersStreamC{ch: ch, ctx: ctx}, nil
}

func (c *SentryClientDirect) AddPeer(ctx context.Context, in *sentry.AddPeerRequest, opts ...grpc.CallOption) (*sentry.AddPeerReply, error) {
return c.server.AddPeer(ctx, in)
}

type peersReply struct {
r *sentry.PeerEvent
err error
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/erigontech/mdbx-go v0.27.14
github.com/ledgerwatch/interfaces v0.0.0-20230825231422-3f5363b4d464
github.com/ledgerwatch/interfaces v0.0.0-20230906081535-2d4029205941
github.com/ledgerwatch/log/v3 v3.9.0
github.com/ledgerwatch/secp256k1 v1.0.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/ledgerwatch/interfaces v0.0.0-20230825231422-3f5363b4d464 h1:SqUdJfYpRjQuZdB5ThWbSDdUaAEsCJpu9jtiG9I8VWY=
github.com/ledgerwatch/interfaces v0.0.0-20230825231422-3f5363b4d464/go.mod h1:ugQv1QllJzBny3cKZKxUrSnykkjkBgm27eQM6dnGAcc=
github.com/ledgerwatch/interfaces v0.0.0-20230906081535-2d4029205941 h1:HConnUr7iAMFp0haM06QLLsO+c92Oh6v3XpuGom1Gzw=
github.com/ledgerwatch/interfaces v0.0.0-20230906081535-2d4029205941/go.mod h1:ugQv1QllJzBny3cKZKxUrSnykkjkBgm27eQM6dnGAcc=
github.com/ledgerwatch/log/v3 v3.9.0 h1:iDwrXe0PVwBC68Dd94YSsHbMgQ3ufsgjzXtFNFVZFRk=
github.com/ledgerwatch/log/v3 v3.9.0/go.mod h1:EiAY6upmI/6LkNhOVxb4eVsmsP11HZCnZ3PlJMjYiqE=
github.com/ledgerwatch/secp256k1 v1.0.0 h1:Usvz87YoTG0uePIV8woOof5cQnLXGYa162rFf3YnwaQ=
Expand Down
Loading