Merge pull request #6510 from ErikEk/neutrinorpc-add-getblockhash
neutrinorpc: add getblockhash
This commit is contained in:
10 files changed
+502
-73
No files matched your search
@@ -6,6 +6,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/lightningnetwork/lnd/lnrpc/neutrinorpc"
|
"github.com/lightningnetwork/lnd/lnrpc/neutrinorpc"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
|
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getNeutrinoKitClient(ctx *cli.Context) (neutrinorpc.NeutrinoKitClient, func()) {
|
func getNeutrinoKitClient(ctx *cli.Context) (neutrinorpc.NeutrinoKitClient, func()) {
|
||||||
@@ -261,6 +263,47 @@ func getCFilter(ctx *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var getBlockHashCommand = cli.Command{
|
||||||
|
Name: "getblockhash",
|
||||||
|
Usage: "Get a block hash.",
|
||||||
|
Category: "Neutrino",
|
||||||
|
Description: "Returns the header hash of a block at a given height.",
|
||||||
|
ArgsUsage: "height",
|
||||||
|
Action: actionDecorator(getBlockHash),
|
||||||
|
}
|
||||||
|
|
||||||
|
func getBlockHash(ctx *cli.Context) error {
|
||||||
|
ctxc := getContext()
|
||||||
|
args := ctx.Args()
|
||||||
|
|
||||||
|
// Display the command's help message if we do not have the expected
|
||||||
|
// number of arguments/flags.
|
||||||
|
if !args.Present() {
|
||||||
|
return cli.ShowCommandHelp(ctx, "getblockhash")
|
||||||
|
}
|
||||||
|
|
||||||
|
client, cleanUp := getNeutrinoKitClient(ctx)
|
||||||
|
defer cleanUp()
|
||||||
|
|
||||||
|
height, err := strconv.ParseInt(args.First(), 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
req := &neutrinorpc.GetBlockHashRequest{
|
||||||
|
Height: int32(height),
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := client.GetBlockHash(ctxc, req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
printRespJSON(resp)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// neutrinoCommands will return the set of commands to enable for neutrinorpc
|
// neutrinoCommands will return the set of commands to enable for neutrinorpc
|
||||||
// builds.
|
// builds.
|
||||||
func neutrinoCommands() []cli.Command {
|
func neutrinoCommands() []cli.Command {
|
||||||
@@ -278,6 +321,7 @@ func neutrinoCommands() []cli.Command {
|
|||||||
getBlockCommand,
|
getBlockCommand,
|
||||||
getBlockHeaderCommand,
|
getBlockHeaderCommand,
|
||||||
getCFilterCommand,
|
getCFilterCommand,
|
||||||
|
getBlockHashCommand,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,13 @@ default](https://github.com/lightningnetwork/lnd/pull/6810) in most cases.
|
|||||||
|
|
||||||
* [Add minor comment](https://github.com/lightningnetwork/lnd/pull/6559) on
|
* [Add minor comment](https://github.com/lightningnetwork/lnd/pull/6559) on
|
||||||
subscribe/cancel/lookup invoice parameter encoding.
|
subscribe/cancel/lookup invoice parameter encoding.
|
||||||
|
|
||||||
* [Log pubkey for peer related messages](https://github.com/lightningnetwork/lnd/pull/6588).
|
* [Log pubkey for peer related messages](https://github.com/lightningnetwork/lnd/pull/6588).
|
||||||
|
|
||||||
|
## Neutrino
|
||||||
|
|
||||||
|
* Add [getblockhash command](https://github.com/lightningnetwork/lnd/pull/6510) to
|
||||||
|
neutrino sub-server.
|
||||||
|
|
||||||
## RPC Server
|
## RPC Server
|
||||||
|
|
||||||
|
|||||||
@@ -958,6 +958,102 @@ func (x *GetCFilterResponse) GetFilter() []byte {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetBlockHashRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
// The block height or index.
|
||||||
|
Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetBlockHashRequest) Reset() {
|
||||||
|
*x = GetBlockHashRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_neutrinorpc_neutrino_proto_msgTypes[14]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetBlockHashRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetBlockHashRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_neutrinorpc_neutrino_proto_msgTypes[14]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetBlockHashRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetBlockHashRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_neutrinorpc_neutrino_proto_rawDescGZIP(), []int{14}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetBlockHashRequest) GetHeight() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Height
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetBlockHashResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
// The block hash.
|
||||||
|
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetBlockHashResponse) Reset() {
|
||||||
|
*x = GetBlockHashResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_neutrinorpc_neutrino_proto_msgTypes[15]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetBlockHashResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetBlockHashResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_neutrinorpc_neutrino_proto_msgTypes[15]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetBlockHashResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetBlockHashResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_neutrinorpc_neutrino_proto_rawDescGZIP(), []int{15}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetBlockHashResponse) GetHash() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Hash
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_neutrinorpc_neutrino_proto protoreflect.FileDescriptor
|
var File_neutrinorpc_neutrino_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_neutrinorpc_neutrino_proto_rawDesc = []byte{
|
var file_neutrinorpc_neutrino_proto_rawDesc = []byte{
|
||||||
@@ -1055,41 +1151,52 @@ var file_neutrinorpc_neutrino_proto_rawDesc = []byte{
|
|||||||
0x68, 0x61, 0x73, 0x68, 0x22, 0x2c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x46, 0x69, 0x6c, 0x74,
|
0x68, 0x61, 0x73, 0x68, 0x22, 0x2c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x46, 0x69, 0x6c, 0x74,
|
||||||
0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69,
|
0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69,
|
||||||
0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74,
|
0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74,
|
||||||
0x65, 0x72, 0x32, 0xad, 0x04, 0x0a, 0x0b, 0x4e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x4b,
|
0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61,
|
||||||
0x69, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x6e,
|
0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69,
|
||||||
0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
|
0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68,
|
||||||
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72,
|
0x74, 0x22, 0x2a, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73,
|
||||||
0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73,
|
0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72,
|
0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x32, 0x82, 0x05,
|
||||||
0x12, 0x1b, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x41,
|
0x0a, 0x0b, 0x4e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x4b, 0x69, 0x74, 0x12, 0x41, 0x0a,
|
||||||
0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e,
|
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69,
|
||||||
0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x50,
|
0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0e, 0x44,
|
0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70,
|
||||||
0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x22, 0x2e,
|
0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x69, 0x73, 0x63,
|
0x12, 0x44, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x6e, 0x65,
|
||||||
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65,
|
||||||
0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e,
|
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72,
|
||||||
0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65,
|
0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x49, 0x73, 0x42, 0x61, 0x6e, 0x6e,
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e,
|
||||||
0x65, 0x64, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63,
|
0x6e, 0x65, 0x63, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72,
|
||||||
0x2e, 0x49, 0x73, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
|
||||||
0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x49,
|
0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e,
|
||||||
0x73, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f,
|
||||||
0x59, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65,
|
0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x72, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e,
|
0x65, 0x12, 0x47, 0x0a, 0x08, 0x49, 0x73, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x1c, 0x2e,
|
||||||
0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65,
|
0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x73, 0x42, 0x61,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f,
|
0x6e, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65,
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64,
|
0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x73, 0x42, 0x61, 0x6e, 0x6e,
|
||||||
0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x47, 0x65,
|
0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0e, 0x47, 0x65,
|
||||||
0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e,
|
0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x6e,
|
||||||
0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71,
|
0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72,
|
0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47,
|
||||||
0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x46, 0x69, 0x6c, 0x74, 0x65,
|
0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73,
|
||||||
0x72, 0x12, 0x1e, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63,
|
||||||
0x47, 0x65, 0x74, 0x43, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x6b, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e,
|
||||||
0x74, 0x1a, 0x1f, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e,
|
0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x47, 0x65, 0x74, 0x43, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x1d, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65,
|
||||||
|
0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d,
|
||||||
|
0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x6e,
|
||||||
|
0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x46,
|
||||||
|
0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6e,
|
||||||
|
0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x46,
|
||||||
|
0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a,
|
||||||
|
0x0c, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x20, 0x2e,
|
||||||
|
0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42,
|
||||||
|
0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
|
0x21, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65,
|
||||||
|
0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||||
0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72,
|
0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72,
|
||||||
0x6b, 0x2f, 0x6c, 0x6e, 0x64, 0x2f, 0x6c, 0x6e, 0x72, 0x70, 0x63, 0x2f, 0x6e, 0x65, 0x75, 0x74,
|
0x6b, 0x2f, 0x6c, 0x6e, 0x64, 0x2f, 0x6c, 0x6e, 0x72, 0x70, 0x63, 0x2f, 0x6e, 0x65, 0x75, 0x74,
|
||||||
@@ -1108,7 +1215,7 @@ func file_neutrinorpc_neutrino_proto_rawDescGZIP() []byte {
|
|||||||
return file_neutrinorpc_neutrino_proto_rawDescData
|
return file_neutrinorpc_neutrino_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_neutrinorpc_neutrino_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
|
var file_neutrinorpc_neutrino_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
||||||
var file_neutrinorpc_neutrino_proto_goTypes = []interface{}{
|
var file_neutrinorpc_neutrino_proto_goTypes = []interface{}{
|
||||||
(*StatusRequest)(nil), // 0: neutrinorpc.StatusRequest
|
(*StatusRequest)(nil), // 0: neutrinorpc.StatusRequest
|
||||||
(*StatusResponse)(nil), // 1: neutrinorpc.StatusResponse
|
(*StatusResponse)(nil), // 1: neutrinorpc.StatusResponse
|
||||||
@@ -1124,6 +1231,8 @@ var file_neutrinorpc_neutrino_proto_goTypes = []interface{}{
|
|||||||
(*GetBlockResponse)(nil), // 11: neutrinorpc.GetBlockResponse
|
(*GetBlockResponse)(nil), // 11: neutrinorpc.GetBlockResponse
|
||||||
(*GetCFilterRequest)(nil), // 12: neutrinorpc.GetCFilterRequest
|
(*GetCFilterRequest)(nil), // 12: neutrinorpc.GetCFilterRequest
|
||||||
(*GetCFilterResponse)(nil), // 13: neutrinorpc.GetCFilterResponse
|
(*GetCFilterResponse)(nil), // 13: neutrinorpc.GetCFilterResponse
|
||||||
|
(*GetBlockHashRequest)(nil), // 14: neutrinorpc.GetBlockHashRequest
|
||||||
|
(*GetBlockHashResponse)(nil), // 15: neutrinorpc.GetBlockHashResponse
|
||||||
}
|
}
|
||||||
var file_neutrinorpc_neutrino_proto_depIdxs = []int32{
|
var file_neutrinorpc_neutrino_proto_depIdxs = []int32{
|
||||||
0, // 0: neutrinorpc.NeutrinoKit.Status:input_type -> neutrinorpc.StatusRequest
|
0, // 0: neutrinorpc.NeutrinoKit.Status:input_type -> neutrinorpc.StatusRequest
|
||||||
@@ -1133,15 +1242,17 @@ var file_neutrinorpc_neutrino_proto_depIdxs = []int32{
|
|||||||
8, // 4: neutrinorpc.NeutrinoKit.GetBlockHeader:input_type -> neutrinorpc.GetBlockHeaderRequest
|
8, // 4: neutrinorpc.NeutrinoKit.GetBlockHeader:input_type -> neutrinorpc.GetBlockHeaderRequest
|
||||||
10, // 5: neutrinorpc.NeutrinoKit.GetBlock:input_type -> neutrinorpc.GetBlockRequest
|
10, // 5: neutrinorpc.NeutrinoKit.GetBlock:input_type -> neutrinorpc.GetBlockRequest
|
||||||
12, // 6: neutrinorpc.NeutrinoKit.GetCFilter:input_type -> neutrinorpc.GetCFilterRequest
|
12, // 6: neutrinorpc.NeutrinoKit.GetCFilter:input_type -> neutrinorpc.GetCFilterRequest
|
||||||
1, // 7: neutrinorpc.NeutrinoKit.Status:output_type -> neutrinorpc.StatusResponse
|
14, // 7: neutrinorpc.NeutrinoKit.GetBlockHash:input_type -> neutrinorpc.GetBlockHashRequest
|
||||||
3, // 8: neutrinorpc.NeutrinoKit.AddPeer:output_type -> neutrinorpc.AddPeerResponse
|
1, // 8: neutrinorpc.NeutrinoKit.Status:output_type -> neutrinorpc.StatusResponse
|
||||||
5, // 9: neutrinorpc.NeutrinoKit.DisconnectPeer:output_type -> neutrinorpc.DisconnectPeerResponse
|
3, // 9: neutrinorpc.NeutrinoKit.AddPeer:output_type -> neutrinorpc.AddPeerResponse
|
||||||
7, // 10: neutrinorpc.NeutrinoKit.IsBanned:output_type -> neutrinorpc.IsBannedResponse
|
5, // 10: neutrinorpc.NeutrinoKit.DisconnectPeer:output_type -> neutrinorpc.DisconnectPeerResponse
|
||||||
9, // 11: neutrinorpc.NeutrinoKit.GetBlockHeader:output_type -> neutrinorpc.GetBlockHeaderResponse
|
7, // 11: neutrinorpc.NeutrinoKit.IsBanned:output_type -> neutrinorpc.IsBannedResponse
|
||||||
11, // 12: neutrinorpc.NeutrinoKit.GetBlock:output_type -> neutrinorpc.GetBlockResponse
|
9, // 12: neutrinorpc.NeutrinoKit.GetBlockHeader:output_type -> neutrinorpc.GetBlockHeaderResponse
|
||||||
13, // 13: neutrinorpc.NeutrinoKit.GetCFilter:output_type -> neutrinorpc.GetCFilterResponse
|
11, // 13: neutrinorpc.NeutrinoKit.GetBlock:output_type -> neutrinorpc.GetBlockResponse
|
||||||
7, // [7:14] is the sub-list for method output_type
|
13, // 14: neutrinorpc.NeutrinoKit.GetCFilter:output_type -> neutrinorpc.GetCFilterResponse
|
||||||
0, // [0:7] is the sub-list for method input_type
|
15, // 15: neutrinorpc.NeutrinoKit.GetBlockHash:output_type -> neutrinorpc.GetBlockHashResponse
|
||||||
|
8, // [8:16] is the sub-list for method output_type
|
||||||
|
0, // [0:8] is the sub-list for method input_type
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
0, // [0:0] is the sub-list for field type_name
|
0, // [0:0] is the sub-list for field type_name
|
||||||
@@ -1321,6 +1432,30 @@ func file_neutrinorpc_neutrino_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_neutrinorpc_neutrino_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*GetBlockHashRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_neutrinorpc_neutrino_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*GetBlockHashResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@@ -1328,7 +1463,7 @@ func file_neutrinorpc_neutrino_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_neutrinorpc_neutrino_proto_rawDesc,
|
RawDescriptor: file_neutrinorpc_neutrino_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 14,
|
NumMessages: 16,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -309,6 +309,58 @@ func local_request_NeutrinoKit_GetCFilter_0(ctx context.Context, marshaler runti
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func request_NeutrinoKit_GetBlockHash_0(ctx context.Context, marshaler runtime.Marshaler, client NeutrinoKitClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq GetBlockHashRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
var (
|
||||||
|
val string
|
||||||
|
ok bool
|
||||||
|
err error
|
||||||
|
_ = err
|
||||||
|
)
|
||||||
|
|
||||||
|
val, ok = pathParams["height"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height")
|
||||||
|
}
|
||||||
|
|
||||||
|
protoReq.Height, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := client.GetBlockHash(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_NeutrinoKit_GetBlockHash_0(ctx context.Context, marshaler runtime.Marshaler, server NeutrinoKitServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq GetBlockHashRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
var (
|
||||||
|
val string
|
||||||
|
ok bool
|
||||||
|
err error
|
||||||
|
_ = err
|
||||||
|
)
|
||||||
|
|
||||||
|
val, ok = pathParams["height"]
|
||||||
|
if !ok {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height")
|
||||||
|
}
|
||||||
|
|
||||||
|
protoReq.Height, err = runtime.Int32(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg, err := server.GetBlockHash(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// RegisterNeutrinoKitHandlerServer registers the http handlers for service NeutrinoKit to "mux".
|
// RegisterNeutrinoKitHandlerServer registers the http handlers for service NeutrinoKit to "mux".
|
||||||
// UnaryRPC :call NeutrinoKitServer directly.
|
// UnaryRPC :call NeutrinoKitServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
@@ -476,6 +528,29 @@ func RegisterNeutrinoKitHandlerServer(ctx context.Context, mux *runtime.ServeMux
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_NeutrinoKit_GetBlockHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/neutrinorpc.NeutrinoKit/GetBlockHash", runtime.WithHTTPPathPattern("/v2/neutrino/blockhash/{height}"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_NeutrinoKit_GetBlockHash_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_NeutrinoKit_GetBlockHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,6 +732,26 @@ func RegisterNeutrinoKitHandlerClient(ctx context.Context, mux *runtime.ServeMux
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_NeutrinoKit_GetBlockHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/neutrinorpc.NeutrinoKit/GetBlockHash", runtime.WithHTTPPathPattern("/v2/neutrino/blockhash/{height}"))
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_NeutrinoKit_GetBlockHash_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_NeutrinoKit_GetBlockHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,6 +769,8 @@ var (
|
|||||||
pattern_NeutrinoKit_GetBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "neutrino", "block", "hash"}, ""))
|
pattern_NeutrinoKit_GetBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "neutrino", "block", "hash"}, ""))
|
||||||
|
|
||||||
pattern_NeutrinoKit_GetCFilter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "neutrino", "cfilter", "hash"}, ""))
|
pattern_NeutrinoKit_GetCFilter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "neutrino", "cfilter", "hash"}, ""))
|
||||||
|
|
||||||
|
pattern_NeutrinoKit_GetBlockHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "neutrino", "blockhash", "height"}, ""))
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -690,4 +787,6 @@ var (
|
|||||||
forward_NeutrinoKit_GetBlock_0 = runtime.ForwardResponseMessage
|
forward_NeutrinoKit_GetBlock_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_NeutrinoKit_GetCFilter_0 = runtime.ForwardResponseMessage
|
forward_NeutrinoKit_GetCFilter_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_NeutrinoKit_GetBlockHash_0 = runtime.ForwardResponseMessage
|
||||||
)
|
)
|
||||||
@@ -45,6 +45,11 @@ service NeutrinoKit {
|
|||||||
GetCFilter returns a compact filter from a block.
|
GetCFilter returns a compact filter from a block.
|
||||||
*/
|
*/
|
||||||
rpc GetCFilter (GetCFilterRequest) returns (GetCFilterResponse);
|
rpc GetCFilter (GetCFilterRequest) returns (GetCFilterResponse);
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetBlockHash returns the header hash of a block at a given height.
|
||||||
|
*/
|
||||||
|
rpc GetBlockHash (GetBlockHashRequest) returns (GetBlockHashResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
message StatusRequest {
|
message StatusRequest {
|
||||||
@@ -207,4 +212,14 @@ message GetCFilterRequest {
|
|||||||
message GetCFilterResponse {
|
message GetCFilterResponse {
|
||||||
// GCS filter.
|
// GCS filter.
|
||||||
bytes filter = 1;
|
bytes filter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GetBlockHashRequest {
|
||||||
|
// The block height or index.
|
||||||
|
int32 height = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetBlockHashResponse {
|
||||||
|
// The block hash.
|
||||||
|
string hash = 1;
|
||||||
|
}
|
||||||
@@ -81,6 +81,39 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/v2/neutrino/blockhash/{height}": {
|
||||||
|
"get": {
|
||||||
|
"summary": "GetBlockHash returns the header hash of a block at a given height.",
|
||||||
|
"operationId": "NeutrinoKit_GetBlockHash",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "A successful response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/neutrinorpcGetBlockHashResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"description": "An unexpected error response.",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/rpcStatus"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "height",
|
||||||
|
"description": "The block height or index.",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"NeutrinoKit"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/v2/neutrino/blockheader/{hash}": {
|
"/v2/neutrino/blockheader/{hash}": {
|
||||||
"get": {
|
"get": {
|
||||||
"summary": "GetBlockHeader returns a block header with a particular block hash.",
|
"summary": "GetBlockHeader returns a block header with a particular block hash.",
|
||||||
@@ -259,6 +292,15 @@
|
|||||||
"neutrinorpcDisconnectPeerResponse": {
|
"neutrinorpcDisconnectPeerResponse": {
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"neutrinorpcGetBlockHashResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"hash": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The block hash."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"neutrinorpcGetBlockHeaderResponse": {
|
"neutrinorpcGetBlockHeaderResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -18,4 +18,6 @@ http:
|
|||||||
- selector: neutrinorpc.NeutrinoKit.GetBlockHeader
|
- selector: neutrinorpc.NeutrinoKit.GetBlockHeader
|
||||||
get: "/v2/neutrino/blockheader/{hash}"
|
get: "/v2/neutrino/blockheader/{hash}"
|
||||||
- selector: neutrinorpc.NeutrinoKit.GetCFilter
|
- selector: neutrinorpc.NeutrinoKit.GetCFilter
|
||||||
get: "/v2/neutrino/cfilter/{hash}"
|
get: "/v2/neutrino/cfilter/{hash}"
|
||||||
|
- selector: neutrinorpc.NeutrinoKit.GetBlockHash
|
||||||
|
get: "/v2/neutrino/blockhash/{height}"
|
||||||
@@ -43,6 +43,9 @@ type NeutrinoKitClient interface {
|
|||||||
//
|
//
|
||||||
//GetCFilter returns a compact filter from a block.
|
//GetCFilter returns a compact filter from a block.
|
||||||
GetCFilter(ctx context.Context, in *GetCFilterRequest, opts ...grpc.CallOption) (*GetCFilterResponse, error)
|
GetCFilter(ctx context.Context, in *GetCFilterRequest, opts ...grpc.CallOption) (*GetCFilterResponse, error)
|
||||||
|
//
|
||||||
|
//GetBlockHash returns the header hash of a block at a given height.
|
||||||
|
GetBlockHash(ctx context.Context, in *GetBlockHashRequest, opts ...grpc.CallOption) (*GetBlockHashResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type neutrinoKitClient struct {
|
type neutrinoKitClient struct {
|
||||||
@@ -116,6 +119,15 @@ func (c *neutrinoKitClient) GetCFilter(ctx context.Context, in *GetCFilterReques
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
// NeutrinoKitServer is the server API for NeutrinoKit service.
|
// NeutrinoKitServer is the server API for NeutrinoKit service.
|
||||||
// All implementations must embed UnimplementedNeutrinoKitServer
|
// All implementations must embed UnimplementedNeutrinoKitServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@@ -145,6 +157,9 @@ type NeutrinoKitServer interface {
|
|||||||
//
|
//
|
||||||
//GetCFilter returns a compact filter from a block.
|
//GetCFilter returns a compact filter from a block.
|
||||||
GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error)
|
GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error)
|
||||||
|
//
|
||||||
|
//GetBlockHash returns the header hash of a block at a given height.
|
||||||
|
GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error)
|
||||||
mustEmbedUnimplementedNeutrinoKitServer()
|
mustEmbedUnimplementedNeutrinoKitServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,6 +188,9 @@ func (UnimplementedNeutrinoKitServer) GetBlock(context.Context, *GetBlockRequest
|
|||||||
func (UnimplementedNeutrinoKitServer) GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error) {
|
func (UnimplementedNeutrinoKitServer) GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetCFilter not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetCFilter not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedNeutrinoKitServer) GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetBlockHash not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedNeutrinoKitServer) mustEmbedUnimplementedNeutrinoKitServer() {}
|
func (UnimplementedNeutrinoKitServer) mustEmbedUnimplementedNeutrinoKitServer() {}
|
||||||
|
|
||||||
// UnsafeNeutrinoKitServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeNeutrinoKitServer may be embedded to opt out of forward compatibility for this service.
|
||||||
@@ -312,6 +330,24 @@ func _NeutrinoKit_GetCFilter_Handler(srv interface{}, ctx context.Context, dec f
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
// NeutrinoKit_ServiceDesc is the grpc.ServiceDesc for NeutrinoKit service.
|
// NeutrinoKit_ServiceDesc is the grpc.ServiceDesc for NeutrinoKit service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@@ -347,6 +383,10 @@ var NeutrinoKit_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "GetCFilter",
|
MethodName: "GetCFilter",
|
||||||
Handler: _NeutrinoKit_GetCFilter_Handler,
|
Handler: _NeutrinoKit_GetCFilter_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetBlockHash",
|
||||||
|
Handler: _NeutrinoKit_GetBlockHash_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "neutrinorpc/neutrino.proto",
|
Metadata: "neutrinorpc/neutrino.proto",
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ var (
|
|||||||
Entity: "onchain",
|
Entity: "onchain",
|
||||||
Action: "read",
|
Action: "read",
|
||||||
}},
|
}},
|
||||||
|
"/neutrinorpc.NeutrinoKit/GetBlockHash": {{
|
||||||
|
Entity: "onchain",
|
||||||
|
Action: "read",
|
||||||
|
}},
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrNeutrinoNotActive is an error returned when there is no running
|
// ErrNeutrinoNotActive is an error returned when there is no running
|
||||||
@@ -192,13 +196,12 @@ func (s *Server) Status(ctx context.Context,
|
|||||||
in *StatusRequest) (*StatusResponse, error) {
|
in *StatusRequest) (*StatusResponse, error) {
|
||||||
|
|
||||||
if s.cfg.NeutrinoCS == nil {
|
if s.cfg.NeutrinoCS == nil {
|
||||||
return &StatusResponse{}, nil
|
return nil, ErrNeutrinoNotActive
|
||||||
}
|
}
|
||||||
|
|
||||||
bestBlock, err := s.cfg.NeutrinoCS.BestBlock()
|
bestBlock, err := s.cfg.NeutrinoCS.BestBlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &StatusResponse{},
|
return nil, fmt.Errorf("could not get best block: %v", err)
|
||||||
fmt.Errorf("could not get best block: %v", err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
peers := s.cfg.NeutrinoCS.Peers()
|
peers := s.cfg.NeutrinoCS.Peers()
|
||||||
@@ -223,12 +226,12 @@ func (s *Server) AddPeer(ctx context.Context,
|
|||||||
in *AddPeerRequest) (*AddPeerResponse, error) {
|
in *AddPeerRequest) (*AddPeerResponse, error) {
|
||||||
|
|
||||||
if s.cfg.NeutrinoCS == nil {
|
if s.cfg.NeutrinoCS == nil {
|
||||||
return &AddPeerResponse{}, ErrNeutrinoNotActive
|
return nil, ErrNeutrinoNotActive
|
||||||
}
|
}
|
||||||
|
|
||||||
peer := s.cfg.NeutrinoCS.PeerByAddr(in.PeerAddrs)
|
peer := s.cfg.NeutrinoCS.PeerByAddr(in.PeerAddrs)
|
||||||
if peer == nil {
|
if peer == nil {
|
||||||
return &AddPeerResponse{},
|
return nil,
|
||||||
fmt.Errorf("could not found peer: %s", in.PeerAddrs)
|
fmt.Errorf("could not found peer: %s", in.PeerAddrs)
|
||||||
}
|
}
|
||||||
s.cfg.NeutrinoCS.AddPeer(peer)
|
s.cfg.NeutrinoCS.AddPeer(peer)
|
||||||
@@ -245,18 +248,18 @@ func (s *Server) DisconnectPeer(ctx context.Context,
|
|||||||
in *DisconnectPeerRequest) (*DisconnectPeerResponse, error) {
|
in *DisconnectPeerRequest) (*DisconnectPeerResponse, error) {
|
||||||
|
|
||||||
if s.cfg.NeutrinoCS == nil {
|
if s.cfg.NeutrinoCS == nil {
|
||||||
return &DisconnectPeerResponse{}, ErrNeutrinoNotActive
|
return nil, ErrNeutrinoNotActive
|
||||||
}
|
}
|
||||||
|
|
||||||
peer := s.cfg.NeutrinoCS.PeerByAddr(in.PeerAddrs)
|
peer := s.cfg.NeutrinoCS.PeerByAddr(in.PeerAddrs)
|
||||||
if peer == nil {
|
if peer == nil {
|
||||||
return &DisconnectPeerResponse{},
|
return nil,
|
||||||
fmt.Errorf("could not found peer: %s", in.PeerAddrs)
|
fmt.Errorf("could not found peer: %s", in.PeerAddrs)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.cfg.NeutrinoCS.DisconnectNodeByAddr(peer.Addr())
|
err := s.cfg.NeutrinoCS.DisconnectNodeByAddr(peer.Addr())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &DisconnectPeerResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &DisconnectPeerResponse{}, nil
|
return &DisconnectPeerResponse{}, nil
|
||||||
@@ -269,7 +272,7 @@ func (s *Server) IsBanned(ctx context.Context,
|
|||||||
in *IsBannedRequest) (*IsBannedResponse, error) {
|
in *IsBannedRequest) (*IsBannedResponse, error) {
|
||||||
|
|
||||||
if s.cfg.NeutrinoCS == nil {
|
if s.cfg.NeutrinoCS == nil {
|
||||||
return &IsBannedResponse{}, ErrNeutrinoNotActive
|
return nil, ErrNeutrinoNotActive
|
||||||
}
|
}
|
||||||
|
|
||||||
return &IsBannedResponse{
|
return &IsBannedResponse{
|
||||||
@@ -287,17 +290,17 @@ func (s *Server) GetBlockHeader(ctx context.Context,
|
|||||||
in *GetBlockHeaderRequest) (*GetBlockHeaderResponse, error) {
|
in *GetBlockHeaderRequest) (*GetBlockHeaderResponse, error) {
|
||||||
|
|
||||||
if s.cfg.NeutrinoCS == nil {
|
if s.cfg.NeutrinoCS == nil {
|
||||||
return &GetBlockHeaderResponse{}, ErrNeutrinoNotActive
|
return nil, ErrNeutrinoNotActive
|
||||||
}
|
}
|
||||||
|
|
||||||
var hash chainhash.Hash
|
var hash chainhash.Hash
|
||||||
if err := chainhash.Decode(&hash, in.Hash); err != nil {
|
if err := chainhash.Decode(&hash, in.Hash); err != nil {
|
||||||
return &GetBlockHeaderResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := s.getBlock(hash)
|
resp, err := s.getBlock(hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetBlockHeaderResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &GetBlockHeaderResponse{
|
return &GetBlockHeaderResponse{
|
||||||
@@ -328,12 +331,12 @@ func (s *Server) GetBlock(ctx context.Context,
|
|||||||
in *GetBlockRequest) (*GetBlockResponse, error) {
|
in *GetBlockRequest) (*GetBlockResponse, error) {
|
||||||
|
|
||||||
if s.cfg.NeutrinoCS == nil {
|
if s.cfg.NeutrinoCS == nil {
|
||||||
return &GetBlockResponse{}, ErrNeutrinoNotActive
|
return nil, ErrNeutrinoNotActive
|
||||||
}
|
}
|
||||||
|
|
||||||
var hash chainhash.Hash
|
var hash chainhash.Hash
|
||||||
if err := chainhash.Decode(&hash, in.Hash); err != nil {
|
if err := chainhash.Decode(&hash, in.Hash); err != nil {
|
||||||
return &GetBlockResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.getBlock(hash)
|
return s.getBlock(hash)
|
||||||
@@ -347,24 +350,24 @@ func (s *Server) GetCFilter(ctx context.Context,
|
|||||||
in *GetCFilterRequest) (*GetCFilterResponse, error) {
|
in *GetCFilterRequest) (*GetCFilterResponse, error) {
|
||||||
|
|
||||||
if s.cfg.NeutrinoCS == nil {
|
if s.cfg.NeutrinoCS == nil {
|
||||||
return &GetCFilterResponse{}, ErrNeutrinoNotActive
|
return nil, ErrNeutrinoNotActive
|
||||||
}
|
}
|
||||||
|
|
||||||
var hash chainhash.Hash
|
var hash chainhash.Hash
|
||||||
if err := chainhash.Decode(&hash, in.Hash); err != nil {
|
if err := chainhash.Decode(&hash, in.Hash); err != nil {
|
||||||
return &GetCFilterResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCFilter returns a compact filter from the database. If it is missing,
|
// GetCFilter returns a compact filter from the database. If it is
|
||||||
// it requests the compact filter from the network.
|
// missing, it requests the compact filter from the network.
|
||||||
filter, err := s.cfg.NeutrinoCS.GetCFilter(hash, wire.GCSFilterRegular)
|
filter, err := s.cfg.NeutrinoCS.GetCFilter(hash, wire.GCSFilterRegular)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetCFilterResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
filterlBytes, err := filter.Bytes()
|
filterlBytes, err := filter.Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetCFilterResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &GetCFilterResponse{Filter: filterlBytes}, nil
|
return &GetCFilterResponse{Filter: filterlBytes}, nil
|
||||||
@@ -373,27 +376,27 @@ func (s *Server) GetCFilter(ctx context.Context,
|
|||||||
func (s *Server) getBlock(hash chainhash.Hash) (*GetBlockResponse, error) {
|
func (s *Server) getBlock(hash chainhash.Hash) (*GetBlockResponse, error) {
|
||||||
block, err := s.cfg.NeutrinoCS.GetBlock(hash)
|
block, err := s.cfg.NeutrinoCS.GetBlock(hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetBlockResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
header, _, err := s.cfg.NeutrinoCS.BlockHeaders.FetchHeader(&hash)
|
header, _, err := s.cfg.NeutrinoCS.BlockHeaders.FetchHeader(&hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetBlockResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
blockData, err := block.Bytes()
|
blockData, err := block.Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetBlockResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
strippedData, err := block.BytesNoWitness()
|
strippedData, err := block.BytesNoWitness()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetBlockResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
bestBlock, err := s.cfg.NeutrinoCS.BestBlock()
|
bestBlock, err := s.cfg.NeutrinoCS.BestBlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &GetBlockResponse{}, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert txids to a string array.
|
// Convert txids to a string array.
|
||||||
@@ -423,3 +426,21 @@ func (s *Server) getBlock(hash chainhash.Hash) (*GetBlockResponse, error) {
|
|||||||
RawHex: blockData,
|
RawHex: blockData,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetBlockHash returns the header hash of a block at a given height.
|
||||||
|
//
|
||||||
|
// NOTE: Part of the NeutrinoKitServer interface.
|
||||||
|
func (s *Server) GetBlockHash(ctx context.Context,
|
||||||
|
in *GetBlockHashRequest) (*GetBlockHashResponse, error) {
|
||||||
|
|
||||||
|
if s.cfg.NeutrinoCS == nil {
|
||||||
|
return nil, ErrNeutrinoNotActive
|
||||||
|
}
|
||||||
|
|
||||||
|
hash, err := s.cfg.NeutrinoCS.GetBlockHash(int64(in.Height))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &GetBlockHashResponse{Hash: hash.String()}, nil
|
||||||
|
}
|
||||||
@@ -197,4 +197,29 @@ func RegisterNeutrinoKitJSONCallbacks(registry map[string]func(ctx context.Conte
|
|||||||
}
|
}
|
||||||
callback(string(respBytes), nil)
|
callback(string(respBytes), nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registry["neutrinorpc.NeutrinoKit.GetBlockHash"] = func(ctx context.Context,
|
||||||
|
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
|
||||||
|
|
||||||
|
req := &GetBlockHashRequest{}
|
||||||
|
err := marshaler.Unmarshal([]byte(reqJSON), req)
|
||||||
|
if err != nil {
|
||||||
|
callback("", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
client := NewNeutrinoKitClient(conn)
|
||||||
|
resp, err := client.GetBlockHash(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
callback("", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
respBytes, err := marshaler.Marshal(resp)
|
||||||
|
if err != nil {
|
||||||
|
callback("", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback(string(respBytes), nil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user