2021-08-23 05:04:47 +02:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package neutrinorpc
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
// NeutrinoKitClient is the client API for NeutrinoKit service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type NeutrinoKitClient interface {
2022-08-24 11:42:34 -05:00
// Status returns the status of the light client neutrino instance,
// along with height and hash of the best block, and a list of connected
// peers.
2021-08-23 05:04:47 +02:00
Status ( ctx context . Context , in * StatusRequest , opts ... grpc . CallOption ) ( * StatusResponse , error )
2022-08-24 11:42:34 -05:00
// AddPeer adds a new peer that has already been connected to the server.
2021-08-23 05:04:47 +02:00
AddPeer ( ctx context . Context , in * AddPeerRequest , opts ... grpc . CallOption ) ( * AddPeerResponse , error )
2022-08-24 11:42:34 -05:00
// DisconnectPeer disconnects a peer by target address. Both outbound and
// inbound nodes will be searched for the target node. An error message will
// be returned if the peer was not found.
2021-08-23 05:04:47 +02:00
DisconnectPeer ( ctx context . Context , in * DisconnectPeerRequest , opts ... grpc . CallOption ) ( * DisconnectPeerResponse , error )
2022-08-24 11:42:34 -05:00
// IsBanned returns true if the peer is banned, otherwise false.
2021-08-23 05:04:47 +02:00
IsBanned ( ctx context . Context , in * IsBannedRequest , opts ... grpc . CallOption ) ( * IsBannedResponse , error )
2022-08-24 11:42:34 -05:00
// GetBlockHeader returns a block header with a particular block hash.
2021-08-23 05:04:47 +02:00
GetBlockHeader ( ctx context . Context , in * GetBlockHeaderRequest , opts ... grpc . CallOption ) ( * GetBlockHeaderResponse , error )
2022-08-24 11:42:34 -05:00
// GetBlock returns a block with a particular block hash.
2021-08-23 05:04:47 +02:00
GetBlock ( ctx context . Context , in * GetBlockRequest , opts ... grpc . CallOption ) ( * GetBlockResponse , error )
2022-08-24 11:42:34 -05:00
// GetCFilter returns a compact filter from a block.
2021-08-23 05:04:47 +02:00
GetCFilter ( ctx context . Context , in * GetCFilterRequest , opts ... grpc . CallOption ) ( * GetCFilterResponse , error )
2023-05-20 13:01:41 +07:00
// Deprecated: Do not use.
//
// Deprecated, use chainrpc.GetBlockHash instead.
2022-08-24 11:42:34 -05:00
// GetBlockHash returns the header hash of a block at a given height.
2022-05-06 21:40:36 +02:00
GetBlockHash ( ctx context . Context , in * GetBlockHashRequest , opts ... grpc . CallOption ) ( * GetBlockHashResponse , error )
2021-08-23 05:04:47 +02:00
}
type neutrinoKitClient struct {
cc grpc . ClientConnInterface
}
func NewNeutrinoKitClient ( cc grpc . ClientConnInterface ) NeutrinoKitClient {
return & neutrinoKitClient { cc }
}
func ( c * neutrinoKitClient ) Status ( ctx context . Context , in * StatusRequest , opts ... grpc . CallOption ) ( * StatusResponse , error ) {
out := new ( StatusResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/Status" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * neutrinoKitClient ) AddPeer ( ctx context . Context , in * AddPeerRequest , opts ... grpc . CallOption ) ( * AddPeerResponse , error ) {
out := new ( AddPeerResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/AddPeer" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * neutrinoKitClient ) DisconnectPeer ( ctx context . Context , in * DisconnectPeerRequest , opts ... grpc . CallOption ) ( * DisconnectPeerResponse , error ) {
out := new ( DisconnectPeerResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/DisconnectPeer" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * neutrinoKitClient ) IsBanned ( ctx context . Context , in * IsBannedRequest , opts ... grpc . CallOption ) ( * IsBannedResponse , error ) {
out := new ( IsBannedResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/IsBanned" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * neutrinoKitClient ) GetBlockHeader ( ctx context . Context , in * GetBlockHeaderRequest , opts ... grpc . CallOption ) ( * GetBlockHeaderResponse , error ) {
out := new ( GetBlockHeaderResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/GetBlockHeader" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * neutrinoKitClient ) GetBlock ( ctx context . Context , in * GetBlockRequest , opts ... grpc . CallOption ) ( * GetBlockResponse , error ) {
out := new ( GetBlockResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/GetBlock" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * neutrinoKitClient ) GetCFilter ( ctx context . Context , in * GetCFilterRequest , opts ... grpc . CallOption ) ( * GetCFilterResponse , error ) {
out := new ( GetCFilterResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/GetCFilter" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-05-20 13:01:41 +07:00
// Deprecated: Do not use.
2022-05-06 21:40:36 +02:00
func ( c * neutrinoKitClient ) GetBlockHash ( ctx context . Context , in * GetBlockHashRequest , opts ... grpc . CallOption ) ( * GetBlockHashResponse , error ) {
out := new ( GetBlockHashResponse )
err := c . cc . Invoke ( ctx , "/neutrinorpc.NeutrinoKit/GetBlockHash" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2021-08-23 05:04:47 +02:00
// NeutrinoKitServer is the server API for NeutrinoKit service.
// All implementations must embed UnimplementedNeutrinoKitServer
// for forward compatibility
type NeutrinoKitServer interface {
2022-08-24 11:42:34 -05:00
// Status returns the status of the light client neutrino instance,
// along with height and hash of the best block, and a list of connected
// peers.
2021-08-23 05:04:47 +02:00
Status ( context . Context , * StatusRequest ) ( * StatusResponse , error )
2022-08-24 11:42:34 -05:00
// AddPeer adds a new peer that has already been connected to the server.
2021-08-23 05:04:47 +02:00
AddPeer ( context . Context , * AddPeerRequest ) ( * AddPeerResponse , error )
2022-08-24 11:42:34 -05:00
// DisconnectPeer disconnects a peer by target address. Both outbound and
// inbound nodes will be searched for the target node. An error message will
// be returned if the peer was not found.
2021-08-23 05:04:47 +02:00
DisconnectPeer ( context . Context , * DisconnectPeerRequest ) ( * DisconnectPeerResponse , error )
2022-08-24 11:42:34 -05:00
// IsBanned returns true if the peer is banned, otherwise false.
2021-08-23 05:04:47 +02:00
IsBanned ( context . Context , * IsBannedRequest ) ( * IsBannedResponse , error )
2022-08-24 11:42:34 -05:00
// GetBlockHeader returns a block header with a particular block hash.
2021-08-23 05:04:47 +02:00
GetBlockHeader ( context . Context , * GetBlockHeaderRequest ) ( * GetBlockHeaderResponse , error )
2022-08-24 11:42:34 -05:00
// GetBlock returns a block with a particular block hash.
2021-08-23 05:04:47 +02:00
GetBlock ( context . Context , * GetBlockRequest ) ( * GetBlockResponse , error )
2022-08-24 11:42:34 -05:00
// GetCFilter returns a compact filter from a block.
2021-08-23 05:04:47 +02:00
GetCFilter ( context . Context , * GetCFilterRequest ) ( * GetCFilterResponse , error )
2023-05-20 13:01:41 +07:00
// Deprecated: Do not use.
//
// Deprecated, use chainrpc.GetBlockHash instead.
2022-08-24 11:42:34 -05:00
// GetBlockHash returns the header hash of a block at a given height.
2022-05-06 21:40:36 +02:00
GetBlockHash ( context . Context , * GetBlockHashRequest ) ( * GetBlockHashResponse , error )
2021-08-23 05:04:47 +02:00
mustEmbedUnimplementedNeutrinoKitServer ( )
}
// UnimplementedNeutrinoKitServer must be embedded to have forward compatible implementations.
type UnimplementedNeutrinoKitServer struct {
}
func ( UnimplementedNeutrinoKitServer ) Status ( context . Context , * StatusRequest ) ( * StatusResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Status not implemented" )
}
func ( UnimplementedNeutrinoKitServer ) AddPeer ( context . Context , * AddPeerRequest ) ( * AddPeerResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method AddPeer not implemented" )
}
func ( UnimplementedNeutrinoKitServer ) DisconnectPeer ( context . Context , * DisconnectPeerRequest ) ( * DisconnectPeerResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method DisconnectPeer not implemented" )
}
func ( UnimplementedNeutrinoKitServer ) IsBanned ( context . Context , * IsBannedRequest ) ( * IsBannedResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method IsBanned not implemented" )
}
func ( UnimplementedNeutrinoKitServer ) GetBlockHeader ( context . Context , * GetBlockHeaderRequest ) ( * GetBlockHeaderResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetBlockHeader not implemented" )
}
func ( UnimplementedNeutrinoKitServer ) GetBlock ( context . Context , * GetBlockRequest ) ( * GetBlockResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetBlock not implemented" )
}
func ( UnimplementedNeutrinoKitServer ) GetCFilter ( context . Context , * GetCFilterRequest ) ( * GetCFilterResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetCFilter not implemented" )
}
2022-05-06 21:40:36 +02:00
func ( UnimplementedNeutrinoKitServer ) GetBlockHash ( context . Context , * GetBlockHashRequest ) ( * GetBlockHashResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetBlockHash not implemented" )
}
2021-08-23 05:04:47 +02:00
func ( UnimplementedNeutrinoKitServer ) mustEmbedUnimplementedNeutrinoKitServer ( ) { }
// UnsafeNeutrinoKitServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NeutrinoKitServer will
// result in compilation errors.
type UnsafeNeutrinoKitServer interface {
mustEmbedUnimplementedNeutrinoKitServer ( )
}
func RegisterNeutrinoKitServer ( s grpc . ServiceRegistrar , srv NeutrinoKitServer ) {
s . RegisterService ( & NeutrinoKit_ServiceDesc , srv )
}
func _NeutrinoKit_Status_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( StatusRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . Status ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/Status" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . Status ( ctx , req . ( * StatusRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NeutrinoKit_AddPeer_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( AddPeerRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . AddPeer ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/AddPeer" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . AddPeer ( ctx , req . ( * AddPeerRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NeutrinoKit_DisconnectPeer_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( DisconnectPeerRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . DisconnectPeer ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/DisconnectPeer" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . DisconnectPeer ( ctx , req . ( * DisconnectPeerRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NeutrinoKit_IsBanned_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( IsBannedRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . IsBanned ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/IsBanned" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . IsBanned ( ctx , req . ( * IsBannedRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NeutrinoKit_GetBlockHeader_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetBlockHeaderRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . GetBlockHeader ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/GetBlockHeader" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . GetBlockHeader ( ctx , req . ( * GetBlockHeaderRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NeutrinoKit_GetBlock_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetBlockRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . GetBlock ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/GetBlock" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . GetBlock ( ctx , req . ( * GetBlockRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NeutrinoKit_GetCFilter_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetCFilterRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . GetCFilter ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/GetCFilter" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . GetCFilter ( ctx , req . ( * GetCFilterRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2022-05-06 21:40:36 +02:00
func _NeutrinoKit_GetBlockHash_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetBlockHashRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NeutrinoKitServer ) . GetBlockHash ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/neutrinorpc.NeutrinoKit/GetBlockHash" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NeutrinoKitServer ) . GetBlockHash ( ctx , req . ( * GetBlockHashRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2021-08-23 05:04:47 +02:00
// NeutrinoKit_ServiceDesc is the grpc.ServiceDesc for NeutrinoKit service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NeutrinoKit_ServiceDesc = grpc . ServiceDesc {
ServiceName : "neutrinorpc.NeutrinoKit" ,
HandlerType : ( * NeutrinoKitServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Status" ,
Handler : _NeutrinoKit_Status_Handler ,
} ,
{
MethodName : "AddPeer" ,
Handler : _NeutrinoKit_AddPeer_Handler ,
} ,
{
MethodName : "DisconnectPeer" ,
Handler : _NeutrinoKit_DisconnectPeer_Handler ,
} ,
{
MethodName : "IsBanned" ,
Handler : _NeutrinoKit_IsBanned_Handler ,
} ,
{
MethodName : "GetBlockHeader" ,
Handler : _NeutrinoKit_GetBlockHeader_Handler ,
} ,
{
MethodName : "GetBlock" ,
Handler : _NeutrinoKit_GetBlock_Handler ,
} ,
{
MethodName : "GetCFilter" ,
Handler : _NeutrinoKit_GetCFilter_Handler ,
} ,
2022-05-06 21:40:36 +02:00
{
MethodName : "GetBlockHash" ,
Handler : _NeutrinoKit_GetBlockHash_Handler ,
} ,
2021-08-23 05:04:47 +02:00
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "neutrinorpc/neutrino.proto" ,
}