mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
add "GetMempoolEntriesByAddresses" to kaspad RPC. (#2022)
* add "GetMempoolEntriesByAddresses" to kaspad RPC. * fmt formatting. * some things I forgot * update rpc.md * forgot to add handler * fix fmt * bug fix, implicat testing & error handling * address reveiw * address reveiw
This commit is contained in:
parent
beb038c815
commit
6e2fd0633b
@ -159,6 +159,8 @@ const (
|
||||
CmdNotifyNewBlockTemplateRequestMessage
|
||||
CmdNotifyNewBlockTemplateResponseMessage
|
||||
CmdNewBlockTemplateNotificationMessage
|
||||
CmdGetMempoolEntriesByAddressesRequestMessage
|
||||
CmdGetMempoolEntriesByAddressesResponseMessage
|
||||
)
|
||||
|
||||
// ProtocolMessageCommandToString maps all MessageCommands to their string representation
|
||||
@ -292,6 +294,8 @@ var RPCMessageCommandToString = map[MessageCommand]string{
|
||||
CmdNotifyNewBlockTemplateRequestMessage: "NotifyNewBlockTemplateRequest",
|
||||
CmdNotifyNewBlockTemplateResponseMessage: "NotifyNewBlockTemplateResponse",
|
||||
CmdNewBlockTemplateNotificationMessage: "NewBlockTemplateNotification",
|
||||
CmdGetMempoolEntriesByAddressesRequestMessage: "CmdGetMempoolEntriesByAddressesRequest",
|
||||
CmdGetMempoolEntriesByAddressesResponseMessage: "CmdGetMempoolEntriesByAddressesResponse",
|
||||
}
|
||||
|
||||
// Message is an interface that describes a kaspa message. A type that
|
||||
|
48
app/appmessage/rpc_get_mempool_entries_by_addresses.go
Normal file
48
app/appmessage/rpc_get_mempool_entries_by_addresses.go
Normal file
@ -0,0 +1,48 @@
|
||||
package appmessage
|
||||
|
||||
// MempoolEntryByAddress represents MempoolEntries associated with some address
|
||||
type MempoolEntryByAddress struct {
|
||||
Address string
|
||||
Receiving []*MempoolEntry
|
||||
Sending []*MempoolEntry
|
||||
}
|
||||
|
||||
// GetMempoolEntriesByAddressesRequestMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type GetMempoolEntriesByAddressesRequestMessage struct {
|
||||
baseMessage
|
||||
Addresses []string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
func (msg *GetMempoolEntriesByAddressesRequestMessage) Command() MessageCommand {
|
||||
return CmdGetMempoolEntriesByAddressesRequestMessage
|
||||
}
|
||||
|
||||
// NewGetMempoolEntriesByAddressesRequestMessage returns a instance of the message
|
||||
func NewGetMempoolEntriesByAddressesRequestMessage(addresses []string) *GetMempoolEntriesByAddressesRequestMessage {
|
||||
return &GetMempoolEntriesByAddressesRequestMessage{
|
||||
Addresses: addresses,
|
||||
}
|
||||
}
|
||||
|
||||
// GetMempoolEntriesByAddressesResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type GetMempoolEntriesByAddressesResponseMessage struct {
|
||||
baseMessage
|
||||
Entries []*MempoolEntryByAddress
|
||||
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
func (msg *GetMempoolEntriesByAddressesResponseMessage) Command() MessageCommand {
|
||||
return CmdGetMempoolEntriesByAddressesResponseMessage
|
||||
}
|
||||
|
||||
// NewGetMempoolEntriesByAddressesResponseMessage returns a instance of the message
|
||||
func NewGetMempoolEntriesByAddressesResponseMessage(entries []*MempoolEntryByAddress) *GetMempoolEntriesByAddressesResponseMessage {
|
||||
return &GetMempoolEntriesByAddressesResponseMessage{
|
||||
Entries: entries,
|
||||
}
|
||||
}
|
@ -49,6 +49,7 @@ var handlers = map[appmessage.MessageCommand]handler{
|
||||
appmessage.CmdEstimateNetworkHashesPerSecondRequestMessage: rpchandlers.HandleEstimateNetworkHashesPerSecond,
|
||||
appmessage.CmdNotifyVirtualDaaScoreChangedRequestMessage: rpchandlers.HandleNotifyVirtualDaaScoreChanged,
|
||||
appmessage.CmdNotifyNewBlockTemplateRequestMessage: rpchandlers.HandleNotifyNewBlockTemplate,
|
||||
appmessage.CmdGetMempoolEntriesByAddressesRequestMessage: rpchandlers.HandleGetMempoolEntriesByAddresses,
|
||||
}
|
||||
|
||||
func (m *Manager) routerInitializer(router *router.Router, netConnection *netadapter.NetConnection) {
|
||||
|
90
app/rpc/rpchandlers/get_mempool_entries_by_addresses.go
Normal file
90
app/rpc/rpchandlers/get_mempool_entries_by_addresses.go
Normal file
@ -0,0 +1,90 @@
|
||||
package rpchandlers
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/txscript"
|
||||
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
"github.com/kaspanet/kaspad/util"
|
||||
)
|
||||
|
||||
// HandleGetMempoolEntriesByAddresses handles the respectively named RPC command
|
||||
func HandleGetMempoolEntriesByAddresses(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||
|
||||
transactions := context.Domain.MiningManager().AllTransactions()
|
||||
getMempoolEntriesByAddressesRequest := request.(*appmessage.GetMempoolEntriesByAddressesRequestMessage)
|
||||
mempoolEntriesByAddresses := make([]*appmessage.MempoolEntryByAddress, 0)
|
||||
|
||||
for _, addressString := range getMempoolEntriesByAddressesRequest.Addresses {
|
||||
|
||||
_, err := util.DecodeAddress(addressString, context.Config.ActiveNetParams.Prefix)
|
||||
if err != nil {
|
||||
errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{}
|
||||
errorMessage.Error = appmessage.RPCErrorf("Could not decode address '%s': %s", addressString, err)
|
||||
return errorMessage, nil
|
||||
}
|
||||
|
||||
sending := make([]*appmessage.MempoolEntry, 0)
|
||||
receiving := make([]*appmessage.MempoolEntry, 0)
|
||||
|
||||
for _, transaction := range transactions {
|
||||
|
||||
for _, input := range transaction.Inputs {
|
||||
_, transactionSendingAddress, err := txscript.ExtractScriptPubKeyAddress(
|
||||
input.UTXOEntry.ScriptPublicKey(),
|
||||
context.Config.ActiveNetParams)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if addressString == transactionSendingAddress.String() {
|
||||
rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction)
|
||||
sending = append(
|
||||
sending,
|
||||
&appmessage.MempoolEntry{
|
||||
Fee: transaction.Fee,
|
||||
Transaction: rpcTransaction,
|
||||
},
|
||||
)
|
||||
break //one input is enough
|
||||
}
|
||||
}
|
||||
|
||||
for _, output := range transaction.Outputs {
|
||||
_, transactionReceivingAddress, err := txscript.ExtractScriptPubKeyAddress(
|
||||
output.ScriptPublicKey,
|
||||
context.Config.ActiveNetParams,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if addressString == transactionReceivingAddress.String() {
|
||||
rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction)
|
||||
receiving = append(
|
||||
receiving,
|
||||
&appmessage.MempoolEntry{
|
||||
Fee: transaction.Fee,
|
||||
Transaction: rpcTransaction,
|
||||
},
|
||||
)
|
||||
break //one output is enough
|
||||
}
|
||||
}
|
||||
|
||||
//Only append mempoolEntriesByAddress, if at least 1 mempoolEntry for the address is found.
|
||||
//This mimics the behaviour of GetUtxosByAddresses RPC call.
|
||||
if len(sending) > 0 || len(receiving) > 0 {
|
||||
mempoolEntriesByAddresses = append(
|
||||
mempoolEntriesByAddresses,
|
||||
&appmessage.MempoolEntryByAddress{
|
||||
Address: addressString,
|
||||
Sending: sending,
|
||||
Receiving: receiving,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return appmessage.NewGetMempoolEntriesByAddressesResponseMessage(mempoolEntriesByAddresses), nil
|
||||
}
|
@ -31,6 +31,8 @@ var commandTypes = []reflect.Type{
|
||||
|
||||
reflect.TypeOf(protowire.KaspadMessage_GetMempoolEntryRequest{}),
|
||||
reflect.TypeOf(protowire.KaspadMessage_GetMempoolEntriesRequest{}),
|
||||
reflect.TypeOf(protowire.KaspadMessage_GetMempoolEntriesByAddressesRequest{}),
|
||||
|
||||
reflect.TypeOf(protowire.KaspadMessage_SubmitTransactionRequest{}),
|
||||
|
||||
reflect.TypeOf(protowire.KaspadMessage_GetUtxosByAddressesRequest{}),
|
||||
|
2
go.mod
2
go.mod
@ -18,7 +18,7 @@ require (
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
|
||||
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
|
||||
google.golang.org/grpc v1.38.0
|
||||
google.golang.org/protobuf v1.26.0
|
||||
google.golang.org/protobuf v1.27.1
|
||||
)
|
||||
|
||||
require (
|
||||
|
4
go.sum
4
go.sum
@ -151,6 +151,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 h1:TLkBREm4nIsEcexnCjgQd5GQWaHcqMzwQV0TX9pq8S0=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@ -163,6 +165,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.17.2
|
||||
// source: messages.proto
|
||||
|
||||
@ -152,6 +152,8 @@ type KaspadMessage struct {
|
||||
// *KaspadMessage_NotifyNewBlockTemplateRequest
|
||||
// *KaspadMessage_NotifyNewBlockTemplateResponse
|
||||
// *KaspadMessage_NewBlockTemplateNotification
|
||||
// *KaspadMessage_GetMempoolEntriesByAddressesRequest
|
||||
// *KaspadMessage_GetMempoolEntriesByAddressesResponse
|
||||
Payload isKaspadMessage_Payload `protobuf_oneof:"payload"`
|
||||
}
|
||||
|
||||
@ -1076,6 +1078,20 @@ func (x *KaspadMessage) GetNewBlockTemplateNotification() *NewBlockTemplateNotif
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetGetMempoolEntriesByAddressesRequest() *GetMempoolEntriesByAddressesRequestMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_GetMempoolEntriesByAddressesRequest); ok {
|
||||
return x.GetMempoolEntriesByAddressesRequest
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetGetMempoolEntriesByAddressesResponse() *GetMempoolEntriesByAddressesResponseMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_GetMempoolEntriesByAddressesResponse); ok {
|
||||
return x.GetMempoolEntriesByAddressesResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isKaspadMessage_Payload interface {
|
||||
isKaspadMessage_Payload()
|
||||
}
|
||||
@ -1584,6 +1600,14 @@ type KaspadMessage_NewBlockTemplateNotification struct {
|
||||
NewBlockTemplateNotification *NewBlockTemplateNotificationMessage `protobuf:"bytes,1083,opt,name=newBlockTemplateNotification,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_GetMempoolEntriesByAddressesRequest struct {
|
||||
GetMempoolEntriesByAddressesRequest *GetMempoolEntriesByAddressesRequestMessage `protobuf:"bytes,1084,opt,name=getMempoolEntriesByAddressesRequest,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_GetMempoolEntriesByAddressesResponse struct {
|
||||
GetMempoolEntriesByAddressesResponse *GetMempoolEntriesByAddressesResponseMessage `protobuf:"bytes,1085,opt,name=getMempoolEntriesByAddressesResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*KaspadMessage_Addresses) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_Block) isKaspadMessage_Payload() {}
|
||||
@ -1836,13 +1860,17 @@ func (*KaspadMessage_NotifyNewBlockTemplateResponse) isKaspadMessage_Payload() {
|
||||
|
||||
func (*KaspadMessage_NewBlockTemplateNotification) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_GetMempoolEntriesByAddressesRequest) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_GetMempoolEntriesByAddressesResponse) isKaspadMessage_Payload() {}
|
||||
|
||||
var File_messages_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_messages_proto_rawDesc = []byte{
|
||||
0x0a, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x1a, 0x09, 0x70, 0x32, 0x70,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x09, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0xe1, 0x69, 0x0a, 0x0d, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x6f, 0x22, 0xfe, 0x6b, 0x0a, 0x0d, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73,
|
||||
@ -2687,21 +2715,39 @@ var file_messages_proto_rawDesc = []byte{
|
||||
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1c, 0x6e, 0x65,
|
||||
0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x6f,
|
||||
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61,
|
||||
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0x50, 0x0a, 0x03, 0x50, 0x32, 0x50, 0x12, 0x49, 0x0a, 0x0d,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
||||
0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x50, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x49,
|
||||
0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12,
|
||||
0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70,
|
||||
0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74,
|
||||
0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72,
|
||||
0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x8a, 0x01, 0x0a, 0x23, 0x67,
|
||||
0x65, 0x74, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73,
|
||||
0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x18, 0xbc, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c,
|
||||
0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
|
||||
0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x48, 0x00, 0x52, 0x23, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x8d, 0x01, 0x0a, 0x24, 0x67, 0x65, 0x74, 0x4d,
|
||||
0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x41,
|
||||
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x18, 0xbd, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
||||
0x69, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
|
||||
0x00, 0x52, 0x24, 0x67, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74,
|
||||
0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x32, 0x50, 0x0a, 0x03, 0x50, 0x32, 0x50, 0x12, 0x49, 0x0a, 0x0d, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65,
|
||||
0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00,
|
||||
0x28, 0x01, 0x30, 0x01, 0x32, 0x50, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x49, 0x0a, 0x0d, 0x4d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x61,
|
||||
0x73, 0x70, 0x61, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -2844,6 +2890,8 @@ var file_messages_proto_goTypes = []interface{}{
|
||||
(*NotifyNewBlockTemplateRequestMessage)(nil), // 123: protowire.NotifyNewBlockTemplateRequestMessage
|
||||
(*NotifyNewBlockTemplateResponseMessage)(nil), // 124: protowire.NotifyNewBlockTemplateResponseMessage
|
||||
(*NewBlockTemplateNotificationMessage)(nil), // 125: protowire.NewBlockTemplateNotificationMessage
|
||||
(*GetMempoolEntriesByAddressesRequestMessage)(nil), // 126: protowire.GetMempoolEntriesByAddressesRequestMessage
|
||||
(*GetMempoolEntriesByAddressesResponseMessage)(nil), // 127: protowire.GetMempoolEntriesByAddressesResponseMessage
|
||||
}
|
||||
var file_messages_proto_depIdxs = []int32{
|
||||
1, // 0: protowire.KaspadMessage.addresses:type_name -> protowire.AddressesMessage
|
||||
@ -2972,15 +3020,17 @@ var file_messages_proto_depIdxs = []int32{
|
||||
123, // 123: protowire.KaspadMessage.notifyNewBlockTemplateRequest:type_name -> protowire.NotifyNewBlockTemplateRequestMessage
|
||||
124, // 124: protowire.KaspadMessage.notifyNewBlockTemplateResponse:type_name -> protowire.NotifyNewBlockTemplateResponseMessage
|
||||
125, // 125: protowire.KaspadMessage.newBlockTemplateNotification:type_name -> protowire.NewBlockTemplateNotificationMessage
|
||||
0, // 126: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 127: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 128: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
||||
0, // 129: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
||||
128, // [128:130] is the sub-list for method output_type
|
||||
126, // [126:128] is the sub-list for method input_type
|
||||
126, // [126:126] is the sub-list for extension type_name
|
||||
126, // [126:126] is the sub-list for extension extendee
|
||||
0, // [0:126] is the sub-list for field type_name
|
||||
126, // 126: protowire.KaspadMessage.getMempoolEntriesByAddressesRequest:type_name -> protowire.GetMempoolEntriesByAddressesRequestMessage
|
||||
127, // 127: protowire.KaspadMessage.getMempoolEntriesByAddressesResponse:type_name -> protowire.GetMempoolEntriesByAddressesResponseMessage
|
||||
0, // 128: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 129: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 130: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
||||
0, // 131: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
||||
130, // [130:132] is the sub-list for method output_type
|
||||
128, // [128:130] is the sub-list for method input_type
|
||||
128, // [128:128] is the sub-list for extension type_name
|
||||
128, // [128:128] is the sub-list for extension extendee
|
||||
0, // [0:128] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_messages_proto_init() }
|
||||
@ -3131,6 +3181,8 @@ func file_messages_proto_init() {
|
||||
(*KaspadMessage_NotifyNewBlockTemplateRequest)(nil),
|
||||
(*KaspadMessage_NotifyNewBlockTemplateResponse)(nil),
|
||||
(*KaspadMessage_NewBlockTemplateNotification)(nil),
|
||||
(*KaspadMessage_GetMempoolEntriesByAddressesRequest)(nil),
|
||||
(*KaspadMessage_GetMempoolEntriesByAddressesResponse)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
@ -135,6 +135,8 @@ message KaspadMessage {
|
||||
NotifyNewBlockTemplateRequestMessage notifyNewBlockTemplateRequest = 1081;
|
||||
NotifyNewBlockTemplateResponseMessage notifyNewBlockTemplateResponse = 1082;
|
||||
NewBlockTemplateNotificationMessage newBlockTemplateNotification = 1083;
|
||||
GetMempoolEntriesByAddressesRequestMessage getMempoolEntriesByAddressesRequest = 1084;
|
||||
GetMempoolEntriesByAddressesResponseMessage getMempoolEntriesByAddressesResponse = 1085;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.17.2
|
||||
// source: p2p.proto
|
||||
|
||||
|
@ -3,109 +3,116 @@
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [rpc.proto](#rpc.proto)
|
||||
- [RPCError](#protowire.RPCError)
|
||||
- [RpcBlock](#protowire.RpcBlock)
|
||||
- [RpcBlockHeader](#protowire.RpcBlockHeader)
|
||||
- [RpcBlockLevelParents](#protowire.RpcBlockLevelParents)
|
||||
- [RpcBlockVerboseData](#protowire.RpcBlockVerboseData)
|
||||
- [RpcTransaction](#protowire.RpcTransaction)
|
||||
- [RpcTransactionInput](#protowire.RpcTransactionInput)
|
||||
- [RpcScriptPublicKey](#protowire.RpcScriptPublicKey)
|
||||
- [RpcTransactionOutput](#protowire.RpcTransactionOutput)
|
||||
- [RpcOutpoint](#protowire.RpcOutpoint)
|
||||
- [RpcUtxoEntry](#protowire.RpcUtxoEntry)
|
||||
- [RpcTransactionVerboseData](#protowire.RpcTransactionVerboseData)
|
||||
- [RpcTransactionInputVerboseData](#protowire.RpcTransactionInputVerboseData)
|
||||
- [RpcTransactionOutputVerboseData](#protowire.RpcTransactionOutputVerboseData)
|
||||
- [GetCurrentNetworkRequestMessage](#protowire.GetCurrentNetworkRequestMessage)
|
||||
- [GetCurrentNetworkResponseMessage](#protowire.GetCurrentNetworkResponseMessage)
|
||||
- [SubmitBlockRequestMessage](#protowire.SubmitBlockRequestMessage)
|
||||
- [SubmitBlockResponseMessage](#protowire.SubmitBlockResponseMessage)
|
||||
- [GetBlockTemplateRequestMessage](#protowire.GetBlockTemplateRequestMessage)
|
||||
- [GetBlockTemplateResponseMessage](#protowire.GetBlockTemplateResponseMessage)
|
||||
- [NotifyBlockAddedRequestMessage](#protowire.NotifyBlockAddedRequestMessage)
|
||||
- [NotifyBlockAddedResponseMessage](#protowire.NotifyBlockAddedResponseMessage)
|
||||
- [BlockAddedNotificationMessage](#protowire.BlockAddedNotificationMessage)
|
||||
- [GetPeerAddressesRequestMessage](#protowire.GetPeerAddressesRequestMessage)
|
||||
- [GetPeerAddressesResponseMessage](#protowire.GetPeerAddressesResponseMessage)
|
||||
- [GetPeerAddressesKnownAddressMessage](#protowire.GetPeerAddressesKnownAddressMessage)
|
||||
- [GetSelectedTipHashRequestMessage](#protowire.GetSelectedTipHashRequestMessage)
|
||||
- [GetSelectedTipHashResponseMessage](#protowire.GetSelectedTipHashResponseMessage)
|
||||
- [GetMempoolEntryRequestMessage](#protowire.GetMempoolEntryRequestMessage)
|
||||
- [GetMempoolEntryResponseMessage](#protowire.GetMempoolEntryResponseMessage)
|
||||
- [GetMempoolEntriesRequestMessage](#protowire.GetMempoolEntriesRequestMessage)
|
||||
- [GetMempoolEntriesResponseMessage](#protowire.GetMempoolEntriesResponseMessage)
|
||||
- [MempoolEntry](#protowire.MempoolEntry)
|
||||
- [GetConnectedPeerInfoRequestMessage](#protowire.GetConnectedPeerInfoRequestMessage)
|
||||
- [GetConnectedPeerInfoResponseMessage](#protowire.GetConnectedPeerInfoResponseMessage)
|
||||
- [GetConnectedPeerInfoMessage](#protowire.GetConnectedPeerInfoMessage)
|
||||
- [AddPeerRequestMessage](#protowire.AddPeerRequestMessage)
|
||||
- [AddPeerResponseMessage](#protowire.AddPeerResponseMessage)
|
||||
- [SubmitTransactionRequestMessage](#protowire.SubmitTransactionRequestMessage)
|
||||
- [SubmitTransactionResponseMessage](#protowire.SubmitTransactionResponseMessage)
|
||||
- [NotifyVirtualSelectedParentChainChangedRequestMessage](#protowire.NotifyVirtualSelectedParentChainChangedRequestMessage)
|
||||
- [NotifyVirtualSelectedParentChainChangedResponseMessage](#protowire.NotifyVirtualSelectedParentChainChangedResponseMessage)
|
||||
- [VirtualSelectedParentChainChangedNotificationMessage](#protowire.VirtualSelectedParentChainChangedNotificationMessage)
|
||||
- [GetBlockRequestMessage](#protowire.GetBlockRequestMessage)
|
||||
- [GetBlockResponseMessage](#protowire.GetBlockResponseMessage)
|
||||
- [GetSubnetworkRequestMessage](#protowire.GetSubnetworkRequestMessage)
|
||||
- [GetSubnetworkResponseMessage](#protowire.GetSubnetworkResponseMessage)
|
||||
- [GetVirtualSelectedParentChainFromBlockRequestMessage](#protowire.GetVirtualSelectedParentChainFromBlockRequestMessage)
|
||||
- [GetVirtualSelectedParentChainFromBlockResponseMessage](#protowire.GetVirtualSelectedParentChainFromBlockResponseMessage)
|
||||
- [GetBlocksRequestMessage](#protowire.GetBlocksRequestMessage)
|
||||
- [GetBlocksResponseMessage](#protowire.GetBlocksResponseMessage)
|
||||
- [GetBlockCountRequestMessage](#protowire.GetBlockCountRequestMessage)
|
||||
- [GetBlockCountResponseMessage](#protowire.GetBlockCountResponseMessage)
|
||||
- [GetBlockDagInfoRequestMessage](#protowire.GetBlockDagInfoRequestMessage)
|
||||
- [GetBlockDagInfoResponseMessage](#protowire.GetBlockDagInfoResponseMessage)
|
||||
- [ResolveFinalityConflictRequestMessage](#protowire.ResolveFinalityConflictRequestMessage)
|
||||
- [ResolveFinalityConflictResponseMessage](#protowire.ResolveFinalityConflictResponseMessage)
|
||||
- [NotifyFinalityConflictsRequestMessage](#protowire.NotifyFinalityConflictsRequestMessage)
|
||||
- [NotifyFinalityConflictsResponseMessage](#protowire.NotifyFinalityConflictsResponseMessage)
|
||||
- [FinalityConflictNotificationMessage](#protowire.FinalityConflictNotificationMessage)
|
||||
- [FinalityConflictResolvedNotificationMessage](#protowire.FinalityConflictResolvedNotificationMessage)
|
||||
- [ShutDownRequestMessage](#protowire.ShutDownRequestMessage)
|
||||
- [ShutDownResponseMessage](#protowire.ShutDownResponseMessage)
|
||||
- [GetHeadersRequestMessage](#protowire.GetHeadersRequestMessage)
|
||||
- [GetHeadersResponseMessage](#protowire.GetHeadersResponseMessage)
|
||||
- [NotifyUtxosChangedRequestMessage](#protowire.NotifyUtxosChangedRequestMessage)
|
||||
- [NotifyUtxosChangedResponseMessage](#protowire.NotifyUtxosChangedResponseMessage)
|
||||
- [UtxosChangedNotificationMessage](#protowire.UtxosChangedNotificationMessage)
|
||||
- [UtxosByAddressesEntry](#protowire.UtxosByAddressesEntry)
|
||||
- [StopNotifyingUtxosChangedRequestMessage](#protowire.StopNotifyingUtxosChangedRequestMessage)
|
||||
- [StopNotifyingUtxosChangedResponseMessage](#protowire.StopNotifyingUtxosChangedResponseMessage)
|
||||
- [GetUtxosByAddressesRequestMessage](#protowire.GetUtxosByAddressesRequestMessage)
|
||||
- [GetUtxosByAddressesResponseMessage](#protowire.GetUtxosByAddressesResponseMessage)
|
||||
- [GetBalanceByAddressRequestMessage](#protowire.GetBalanceByAddressRequestMessage)
|
||||
- [GetBalanceByAddressResponseMessage](#protowire.GetBalanceByAddressResponseMessage)
|
||||
- [GetBalancesByAddressesRequestMessage](#protowire.GetBalancesByAddressesRequestMessage)
|
||||
- [BalancesByAddressEntry](#protowire.BalancesByAddressEntry)
|
||||
- [GetBalancesByAddressesResponseMessage](#protowire.GetBalancesByAddressesResponseMessage)
|
||||
- [GetVirtualSelectedParentBlueScoreRequestMessage](#protowire.GetVirtualSelectedParentBlueScoreRequestMessage)
|
||||
- [GetVirtualSelectedParentBlueScoreResponseMessage](#protowire.GetVirtualSelectedParentBlueScoreResponseMessage)
|
||||
- [NotifyVirtualSelectedParentBlueScoreChangedRequestMessage](#protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)
|
||||
- [NotifyVirtualSelectedParentBlueScoreChangedResponseMessage](#protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage)
|
||||
- [VirtualSelectedParentBlueScoreChangedNotificationMessage](#protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage)
|
||||
- [NotifyVirtualDaaScoreChangedRequestMessage](#protowire.NotifyVirtualDaaScoreChangedRequestMessage)
|
||||
- [NotifyVirtualDaaScoreChangedResponseMessage](#protowire.NotifyVirtualDaaScoreChangedResponseMessage)
|
||||
- [VirtualDaaScoreChangedNotificationMessage](#protowire.VirtualDaaScoreChangedNotificationMessage)
|
||||
- [NotifyPruningPointUTXOSetOverrideRequestMessage](#protowire.NotifyPruningPointUTXOSetOverrideRequestMessage)
|
||||
- [NotifyPruningPointUTXOSetOverrideResponseMessage](#protowire.NotifyPruningPointUTXOSetOverrideResponseMessage)
|
||||
- [PruningPointUTXOSetOverrideNotificationMessage](#protowire.PruningPointUTXOSetOverrideNotificationMessage)
|
||||
- [StopNotifyingPruningPointUTXOSetOverrideRequestMessage](#protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage)
|
||||
- [StopNotifyingPruningPointUTXOSetOverrideResponseMessage](#protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage)
|
||||
- [BanRequestMessage](#protowire.BanRequestMessage)
|
||||
- [BanResponseMessage](#protowire.BanResponseMessage)
|
||||
- [UnbanRequestMessage](#protowire.UnbanRequestMessage)
|
||||
- [UnbanResponseMessage](#protowire.UnbanResponseMessage)
|
||||
- [GetInfoRequestMessage](#protowire.GetInfoRequestMessage)
|
||||
- [GetInfoResponseMessage](#protowire.GetInfoResponseMessage)
|
||||
- [EstimateNetworkHashesPerSecondRequestMessage](#protowire.EstimateNetworkHashesPerSecondRequestMessage)
|
||||
- [EstimateNetworkHashesPerSecondResponseMessage](#protowire.EstimateNetworkHashesPerSecondResponseMessage)
|
||||
- [NotifyNewBlockTemplateRequestMessage](#protowire.NotifyNewBlockTemplateRequestMessage)
|
||||
- [NotifyNewBlockTemplateResponseMessage](#protowire.NotifyNewBlockTemplateResponseMessage)
|
||||
- [NewBlockTemplateNotificationMessage](#protowire.NewBlockTemplateNotificationMessage)
|
||||
- [Protocol Documentation](#protocol-documentation)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [rpc.proto](#rpcproto)
|
||||
- [RPCError](#rpcerror)
|
||||
- [RpcBlock](#rpcblock)
|
||||
- [RpcBlockHeader](#rpcblockheader)
|
||||
- [RpcBlockLevelParents](#rpcblocklevelparents)
|
||||
- [RpcBlockVerboseData](#rpcblockverbosedata)
|
||||
- [RpcTransaction](#rpctransaction)
|
||||
- [RpcTransactionInput](#rpctransactioninput)
|
||||
- [RpcScriptPublicKey](#rpcscriptpublickey)
|
||||
- [RpcTransactionOutput](#rpctransactionoutput)
|
||||
- [RpcOutpoint](#rpcoutpoint)
|
||||
- [RpcUtxoEntry](#rpcutxoentry)
|
||||
- [RpcTransactionVerboseData](#rpctransactionverbosedata)
|
||||
- [RpcTransactionInputVerboseData](#rpctransactioninputverbosedata)
|
||||
- [RpcTransactionOutputVerboseData](#rpctransactionoutputverbosedata)
|
||||
- [GetCurrentNetworkRequestMessage](#getcurrentnetworkrequestmessage)
|
||||
- [GetCurrentNetworkResponseMessage](#getcurrentnetworkresponsemessage)
|
||||
- [SubmitBlockRequestMessage](#submitblockrequestmessage)
|
||||
- [SubmitBlockResponseMessage](#submitblockresponsemessage)
|
||||
- [GetBlockTemplateRequestMessage](#getblocktemplaterequestmessage)
|
||||
- [GetBlockTemplateResponseMessage](#getblocktemplateresponsemessage)
|
||||
- [NotifyBlockAddedRequestMessage](#notifyblockaddedrequestmessage)
|
||||
- [NotifyBlockAddedResponseMessage](#notifyblockaddedresponsemessage)
|
||||
- [BlockAddedNotificationMessage](#blockaddednotificationmessage)
|
||||
- [GetPeerAddressesRequestMessage](#getpeeraddressesrequestmessage)
|
||||
- [GetPeerAddressesResponseMessage](#getpeeraddressesresponsemessage)
|
||||
- [GetPeerAddressesKnownAddressMessage](#getpeeraddressesknownaddressmessage)
|
||||
- [GetSelectedTipHashRequestMessage](#getselectedtiphashrequestmessage)
|
||||
- [GetSelectedTipHashResponseMessage](#getselectedtiphashresponsemessage)
|
||||
- [GetMempoolEntryRequestMessage](#getmempoolentryrequestmessage)
|
||||
- [GetMempoolEntryResponseMessage](#getmempoolentryresponsemessage)
|
||||
- [GetMempoolEntriesRequestMessage](#getmempoolentriesrequestmessage)
|
||||
- [GetMempoolEntriesResponseMessage](#getmempoolentriesresponsemessage)
|
||||
- [MempoolEntry](#mempoolentry)
|
||||
- [GetConnectedPeerInfoRequestMessage](#getconnectedpeerinforequestmessage)
|
||||
- [GetConnectedPeerInfoResponseMessage](#getconnectedpeerinforesponsemessage)
|
||||
- [GetConnectedPeerInfoMessage](#getconnectedpeerinfomessage)
|
||||
- [AddPeerRequestMessage](#addpeerrequestmessage)
|
||||
- [AddPeerResponseMessage](#addpeerresponsemessage)
|
||||
- [SubmitTransactionRequestMessage](#submittransactionrequestmessage)
|
||||
- [SubmitTransactionResponseMessage](#submittransactionresponsemessage)
|
||||
- [NotifyVirtualSelectedParentChainChangedRequestMessage](#notifyvirtualselectedparentchainchangedrequestmessage)
|
||||
- [NotifyVirtualSelectedParentChainChangedResponseMessage](#notifyvirtualselectedparentchainchangedresponsemessage)
|
||||
- [VirtualSelectedParentChainChangedNotificationMessage](#virtualselectedparentchainchangednotificationmessage)
|
||||
- [GetBlockRequestMessage](#getblockrequestmessage)
|
||||
- [GetBlockResponseMessage](#getblockresponsemessage)
|
||||
- [GetSubnetworkRequestMessage](#getsubnetworkrequestmessage)
|
||||
- [GetSubnetworkResponseMessage](#getsubnetworkresponsemessage)
|
||||
- [GetVirtualSelectedParentChainFromBlockRequestMessage](#getvirtualselectedparentchainfromblockrequestmessage)
|
||||
- [GetVirtualSelectedParentChainFromBlockResponseMessage](#getvirtualselectedparentchainfromblockresponsemessage)
|
||||
- [GetBlocksRequestMessage](#getblocksrequestmessage)
|
||||
- [GetBlocksResponseMessage](#getblocksresponsemessage)
|
||||
- [GetBlockCountRequestMessage](#getblockcountrequestmessage)
|
||||
- [GetBlockCountResponseMessage](#getblockcountresponsemessage)
|
||||
- [GetBlockDagInfoRequestMessage](#getblockdaginforequestmessage)
|
||||
- [GetBlockDagInfoResponseMessage](#getblockdaginforesponsemessage)
|
||||
- [ResolveFinalityConflictRequestMessage](#resolvefinalityconflictrequestmessage)
|
||||
- [ResolveFinalityConflictResponseMessage](#resolvefinalityconflictresponsemessage)
|
||||
- [NotifyFinalityConflictsRequestMessage](#notifyfinalityconflictsrequestmessage)
|
||||
- [NotifyFinalityConflictsResponseMessage](#notifyfinalityconflictsresponsemessage)
|
||||
- [FinalityConflictNotificationMessage](#finalityconflictnotificationmessage)
|
||||
- [FinalityConflictResolvedNotificationMessage](#finalityconflictresolvednotificationmessage)
|
||||
- [ShutDownRequestMessage](#shutdownrequestmessage)
|
||||
- [ShutDownResponseMessage](#shutdownresponsemessage)
|
||||
- [GetHeadersRequestMessage](#getheadersrequestmessage)
|
||||
- [GetHeadersResponseMessage](#getheadersresponsemessage)
|
||||
- [NotifyUtxosChangedRequestMessage](#notifyutxoschangedrequestmessage)
|
||||
- [NotifyUtxosChangedResponseMessage](#notifyutxoschangedresponsemessage)
|
||||
- [UtxosChangedNotificationMessage](#utxoschangednotificationmessage)
|
||||
- [UtxosByAddressesEntry](#utxosbyaddressesentry)
|
||||
- [StopNotifyingUtxosChangedRequestMessage](#stopnotifyingutxoschangedrequestmessage)
|
||||
- [StopNotifyingUtxosChangedResponseMessage](#stopnotifyingutxoschangedresponsemessage)
|
||||
- [GetUtxosByAddressesRequestMessage](#getutxosbyaddressesrequestmessage)
|
||||
- [GetUtxosByAddressesResponseMessage](#getutxosbyaddressesresponsemessage)
|
||||
- [GetBalanceByAddressRequestMessage](#getbalancebyaddressrequestmessage)
|
||||
- [GetBalanceByAddressResponseMessage](#getbalancebyaddressresponsemessage)
|
||||
- [GetBalancesByAddressesRequestMessage](#getbalancesbyaddressesrequestmessage)
|
||||
- [BalancesByAddressEntry](#balancesbyaddressentry)
|
||||
- [GetBalancesByAddressesResponseMessage](#getbalancesbyaddressesresponsemessage)
|
||||
- [GetVirtualSelectedParentBlueScoreRequestMessage](#getvirtualselectedparentbluescorerequestmessage)
|
||||
- [GetVirtualSelectedParentBlueScoreResponseMessage](#getvirtualselectedparentbluescoreresponsemessage)
|
||||
- [NotifyVirtualSelectedParentBlueScoreChangedRequestMessage](#notifyvirtualselectedparentbluescorechangedrequestmessage)
|
||||
- [NotifyVirtualSelectedParentBlueScoreChangedResponseMessage](#notifyvirtualselectedparentbluescorechangedresponsemessage)
|
||||
- [VirtualSelectedParentBlueScoreChangedNotificationMessage](#virtualselectedparentbluescorechangednotificationmessage)
|
||||
- [NotifyVirtualDaaScoreChangedRequestMessage](#notifyvirtualdaascorechangedrequestmessage)
|
||||
- [NotifyVirtualDaaScoreChangedResponseMessage](#notifyvirtualdaascorechangedresponsemessage)
|
||||
- [VirtualDaaScoreChangedNotificationMessage](#virtualdaascorechangednotificationmessage)
|
||||
- [NotifyPruningPointUTXOSetOverrideRequestMessage](#notifypruningpointutxosetoverriderequestmessage)
|
||||
- [NotifyPruningPointUTXOSetOverrideResponseMessage](#notifypruningpointutxosetoverrideresponsemessage)
|
||||
- [PruningPointUTXOSetOverrideNotificationMessage](#pruningpointutxosetoverridenotificationmessage)
|
||||
- [StopNotifyingPruningPointUTXOSetOverrideRequestMessage](#stopnotifyingpruningpointutxosetoverriderequestmessage)
|
||||
- [StopNotifyingPruningPointUTXOSetOverrideResponseMessage](#stopnotifyingpruningpointutxosetoverrideresponsemessage)
|
||||
- [BanRequestMessage](#banrequestmessage)
|
||||
- [BanResponseMessage](#banresponsemessage)
|
||||
- [UnbanRequestMessage](#unbanrequestmessage)
|
||||
- [UnbanResponseMessage](#unbanresponsemessage)
|
||||
- [GetInfoRequestMessage](#getinforequestmessage)
|
||||
- [GetInfoResponseMessage](#getinforesponsemessage)
|
||||
- [EstimateNetworkHashesPerSecondRequestMessage](#estimatenetworkhashespersecondrequestmessage)
|
||||
- [EstimateNetworkHashesPerSecondResponseMessage](#estimatenetworkhashespersecondresponsemessage)
|
||||
- [NotifyNewBlockTemplateRequestMessage](#notifynewblocktemplaterequestmessage)
|
||||
- [NotifyNewBlockTemplateResponseMessage](#notifynewblocktemplateresponsemessage)
|
||||
- [NewBlockTemplateNotificationMessage](#newblocktemplatenotificationmessage)
|
||||
- [MempoolEntryByAddress](#mempoolentrybyaddress)
|
||||
- [GetMempoolEntriesByAddressesRequestMessage](#getmempoolentriesbyaddressesrequestmessage)
|
||||
- [GetMempoolEntriesByAddressesResponseMessage](#getmempoolentriesbyaddressesresponsemessage)
|
||||
- [SubmitBlockResponseMessage.RejectReason](#submitblockresponsemessagerejectreason)
|
||||
- [Scalar Value Types](#scalar-value-types)
|
||||
|
||||
- [SubmitBlockResponseMessage.RejectReason](#protowire.SubmitBlockResponseMessage.RejectReason)
|
||||
|
||||
@ -1739,6 +1746,56 @@ See NotifyNewBlockTemplateRequestMessage
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.MempoolEntryByAddress"></a>
|
||||
|
||||
### MempoolEntryByAddress
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| address | [string](#string) | | |
|
||||
| sending | [MempoolEntry](#protowire.MempoolEntry) | repeated | |
|
||||
| receiving | [MempoolEntry](#protowire.MempoolEntry) | repeated | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.GetMempoolEntriesByAddressesRequestMessage"></a>
|
||||
|
||||
### GetMempoolEntriesByAddressesRequestMessage
|
||||
GetMempoolEntriesByAddressesRequestMessage requests all Sending and Receiving Txs for the given kaspad addresses
|
||||
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| addresses | [string](#string) | repeated | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.GetMempoolEntriesByAddressesResponseMessage"></a>
|
||||
|
||||
### GetMempoolEntriesByAddressesResponseMessage
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| entries | [MempoolEntryByAddress](#protowire.MempoolEntryByAddress) | repeated | |
|
||||
| error | [RPCError](#protowire.RPCError) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.17.2
|
||||
// source: rpc.proto
|
||||
|
||||
@ -5681,6 +5681,171 @@ func (*NewBlockTemplateNotificationMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{101}
|
||||
}
|
||||
|
||||
type MempoolEntryByAddress struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
||||
Sending []*MempoolEntry `protobuf:"bytes,2,rep,name=sending,proto3" json:"sending,omitempty"`
|
||||
Receiving []*MempoolEntry `protobuf:"bytes,3,rep,name=receiving,proto3" json:"receiving,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MempoolEntryByAddress) Reset() {
|
||||
*x = MempoolEntryByAddress{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[102]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MempoolEntryByAddress) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MempoolEntryByAddress) ProtoMessage() {}
|
||||
|
||||
func (x *MempoolEntryByAddress) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[102]
|
||||
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 MempoolEntryByAddress.ProtoReflect.Descriptor instead.
|
||||
func (*MempoolEntryByAddress) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{102}
|
||||
}
|
||||
|
||||
func (x *MempoolEntryByAddress) GetAddress() string {
|
||||
if x != nil {
|
||||
return x.Address
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MempoolEntryByAddress) GetSending() []*MempoolEntry {
|
||||
if x != nil {
|
||||
return x.Sending
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *MempoolEntryByAddress) GetReceiving() []*MempoolEntry {
|
||||
if x != nil {
|
||||
return x.Receiving
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetMempoolEntriesByAddressesRequestMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesRequestMessage) Reset() {
|
||||
*x = GetMempoolEntriesByAddressesRequestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[103]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesRequestMessage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMempoolEntriesByAddressesRequestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[103]
|
||||
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 GetMempoolEntriesByAddressesRequestMessage.ProtoReflect.Descriptor instead.
|
||||
func (*GetMempoolEntriesByAddressesRequestMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{103}
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesRequestMessage) GetAddresses() []string {
|
||||
if x != nil {
|
||||
return x.Addresses
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetMempoolEntriesByAddressesResponseMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Entries []*MempoolEntryByAddress `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
|
||||
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesResponseMessage) Reset() {
|
||||
*x = GetMempoolEntriesByAddressesResponseMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[104]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesResponseMessage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMempoolEntriesByAddressesResponseMessage) ProtoMessage() {}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[104]
|
||||
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 GetMempoolEntriesByAddressesResponseMessage.ProtoReflect.Descriptor instead.
|
||||
func (*GetMempoolEntriesByAddressesResponseMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{104}
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesResponseMessage) GetEntries() []*MempoolEntryByAddress {
|
||||
if x != nil {
|
||||
return x.Entries
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesResponseMessage) GetError() *RPCError {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_rpc_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_rpc_proto_rawDesc = []byte{
|
||||
@ -6396,9 +6561,34 @@ var file_rpc_proto_rawDesc = []byte{
|
||||
0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x25, 0x0a, 0x23, 0x4e, 0x65, 0x77,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x74,
|
||||
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b,
|
||||
0x61, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x2f, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x22, 0x9b, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64,
|
||||
0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64,
|
||||
0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x18,
|
||||
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72,
|
||||
0x65, 0x2e, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07,
|
||||
0x73, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69,
|
||||
0x76, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x22, 0x4a,
|
||||
0x0a, 0x2a, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x69, 0x65, 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09,
|
||||
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
|
||||
0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x2b, 0x47,
|
||||
0x65, 0x74, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73,
|
||||
0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x65, 0x6e,
|
||||
0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x45,
|
||||
0x6e, 0x74, 0x72, 0x79, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x65,
|
||||
0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
|
||||
0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72,
|
||||
0x6f, 0x72, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x64,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -6414,7 +6604,7 @@ func file_rpc_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 102)
|
||||
var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 105)
|
||||
var file_rpc_proto_goTypes = []interface{}{
|
||||
(SubmitBlockResponseMessage_RejectReason)(0), // 0: protowire.SubmitBlockResponseMessage.RejectReason
|
||||
(*RPCError)(nil), // 1: protowire.RPCError
|
||||
@ -6519,82 +6709,89 @@ var file_rpc_proto_goTypes = []interface{}{
|
||||
(*NotifyNewBlockTemplateRequestMessage)(nil), // 100: protowire.NotifyNewBlockTemplateRequestMessage
|
||||
(*NotifyNewBlockTemplateResponseMessage)(nil), // 101: protowire.NotifyNewBlockTemplateResponseMessage
|
||||
(*NewBlockTemplateNotificationMessage)(nil), // 102: protowire.NewBlockTemplateNotificationMessage
|
||||
(*MempoolEntryByAddress)(nil), // 103: protowire.MempoolEntryByAddress
|
||||
(*GetMempoolEntriesByAddressesRequestMessage)(nil), // 104: protowire.GetMempoolEntriesByAddressesRequestMessage
|
||||
(*GetMempoolEntriesByAddressesResponseMessage)(nil), // 105: protowire.GetMempoolEntriesByAddressesResponseMessage
|
||||
}
|
||||
var file_rpc_proto_depIdxs = []int32{
|
||||
3, // 0: protowire.RpcBlock.header:type_name -> protowire.RpcBlockHeader
|
||||
6, // 1: protowire.RpcBlock.transactions:type_name -> protowire.RpcTransaction
|
||||
5, // 2: protowire.RpcBlock.verboseData:type_name -> protowire.RpcBlockVerboseData
|
||||
4, // 3: protowire.RpcBlockHeader.parents:type_name -> protowire.RpcBlockLevelParents
|
||||
7, // 4: protowire.RpcTransaction.inputs:type_name -> protowire.RpcTransactionInput
|
||||
9, // 5: protowire.RpcTransaction.outputs:type_name -> protowire.RpcTransactionOutput
|
||||
12, // 6: protowire.RpcTransaction.verboseData:type_name -> protowire.RpcTransactionVerboseData
|
||||
10, // 7: protowire.RpcTransactionInput.previousOutpoint:type_name -> protowire.RpcOutpoint
|
||||
13, // 8: protowire.RpcTransactionInput.verboseData:type_name -> protowire.RpcTransactionInputVerboseData
|
||||
8, // 9: protowire.RpcTransactionOutput.scriptPublicKey:type_name -> protowire.RpcScriptPublicKey
|
||||
14, // 10: protowire.RpcTransactionOutput.verboseData:type_name -> protowire.RpcTransactionOutputVerboseData
|
||||
8, // 11: protowire.RpcUtxoEntry.scriptPublicKey:type_name -> protowire.RpcScriptPublicKey
|
||||
1, // 12: protowire.GetCurrentNetworkResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 13: protowire.SubmitBlockRequestMessage.block:type_name -> protowire.RpcBlock
|
||||
0, // 14: protowire.SubmitBlockResponseMessage.rejectReason:type_name -> protowire.SubmitBlockResponseMessage.RejectReason
|
||||
1, // 15: protowire.SubmitBlockResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 16: protowire.GetBlockTemplateResponseMessage.block:type_name -> protowire.RpcBlock
|
||||
1, // 17: protowire.GetBlockTemplateResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 18: protowire.NotifyBlockAddedResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 19: protowire.BlockAddedNotificationMessage.block:type_name -> protowire.RpcBlock
|
||||
26, // 20: protowire.GetPeerAddressesResponseMessage.addresses:type_name -> protowire.GetPeerAddressesKnownAddressMessage
|
||||
26, // 21: protowire.GetPeerAddressesResponseMessage.bannedAddresses:type_name -> protowire.GetPeerAddressesKnownAddressMessage
|
||||
1, // 22: protowire.GetPeerAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 23: protowire.GetSelectedTipHashResponseMessage.error:type_name -> protowire.RPCError
|
||||
33, // 24: protowire.GetMempoolEntryResponseMessage.entry:type_name -> protowire.MempoolEntry
|
||||
1, // 25: protowire.GetMempoolEntryResponseMessage.error:type_name -> protowire.RPCError
|
||||
33, // 26: protowire.GetMempoolEntriesResponseMessage.entries:type_name -> protowire.MempoolEntry
|
||||
1, // 27: protowire.GetMempoolEntriesResponseMessage.error:type_name -> protowire.RPCError
|
||||
6, // 28: protowire.MempoolEntry.transaction:type_name -> protowire.RpcTransaction
|
||||
36, // 29: protowire.GetConnectedPeerInfoResponseMessage.infos:type_name -> protowire.GetConnectedPeerInfoMessage
|
||||
1, // 30: protowire.GetConnectedPeerInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 31: protowire.AddPeerResponseMessage.error:type_name -> protowire.RPCError
|
||||
6, // 32: protowire.SubmitTransactionRequestMessage.transaction:type_name -> protowire.RpcTransaction
|
||||
1, // 33: protowire.SubmitTransactionResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 34: protowire.NotifyVirtualSelectedParentChainChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 35: protowire.GetBlockResponseMessage.block:type_name -> protowire.RpcBlock
|
||||
1, // 36: protowire.GetBlockResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 37: protowire.GetSubnetworkResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 38: protowire.GetVirtualSelectedParentChainFromBlockResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 39: protowire.GetBlocksResponseMessage.blocks:type_name -> protowire.RpcBlock
|
||||
1, // 40: protowire.GetBlocksResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 41: protowire.GetBlockCountResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 42: protowire.GetBlockDagInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 43: protowire.ResolveFinalityConflictResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 44: protowire.NotifyFinalityConflictsResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 45: protowire.ShutDownResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 46: protowire.GetHeadersResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 47: protowire.NotifyUtxosChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
69, // 48: protowire.UtxosChangedNotificationMessage.added:type_name -> protowire.UtxosByAddressesEntry
|
||||
69, // 49: protowire.UtxosChangedNotificationMessage.removed:type_name -> protowire.UtxosByAddressesEntry
|
||||
10, // 50: protowire.UtxosByAddressesEntry.outpoint:type_name -> protowire.RpcOutpoint
|
||||
11, // 51: protowire.UtxosByAddressesEntry.utxoEntry:type_name -> protowire.RpcUtxoEntry
|
||||
1, // 52: protowire.StopNotifyingUtxosChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
69, // 53: protowire.GetUtxosByAddressesResponseMessage.entries:type_name -> protowire.UtxosByAddressesEntry
|
||||
1, // 54: protowire.GetUtxosByAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 55: protowire.GetBalanceByAddressResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 56: protowire.BalancesByAddressEntry.error:type_name -> protowire.RPCError
|
||||
77, // 57: protowire.GetBalancesByAddressesResponseMessage.entries:type_name -> protowire.BalancesByAddressEntry
|
||||
1, // 58: protowire.GetBalancesByAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 59: protowire.GetVirtualSelectedParentBlueScoreResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 60: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 61: protowire.NotifyVirtualDaaScoreChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 62: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 63: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 64: protowire.BanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 65: protowire.UnbanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 66: protowire.GetInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 67: protowire.EstimateNetworkHashesPerSecondResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 68: protowire.NotifyNewBlockTemplateResponseMessage.error:type_name -> protowire.RPCError
|
||||
69, // [69:69] is the sub-list for method output_type
|
||||
69, // [69:69] is the sub-list for method input_type
|
||||
69, // [69:69] is the sub-list for extension type_name
|
||||
69, // [69:69] is the sub-list for extension extendee
|
||||
0, // [0:69] is the sub-list for field type_name
|
||||
3, // 0: protowire.RpcBlock.header:type_name -> protowire.RpcBlockHeader
|
||||
6, // 1: protowire.RpcBlock.transactions:type_name -> protowire.RpcTransaction
|
||||
5, // 2: protowire.RpcBlock.verboseData:type_name -> protowire.RpcBlockVerboseData
|
||||
4, // 3: protowire.RpcBlockHeader.parents:type_name -> protowire.RpcBlockLevelParents
|
||||
7, // 4: protowire.RpcTransaction.inputs:type_name -> protowire.RpcTransactionInput
|
||||
9, // 5: protowire.RpcTransaction.outputs:type_name -> protowire.RpcTransactionOutput
|
||||
12, // 6: protowire.RpcTransaction.verboseData:type_name -> protowire.RpcTransactionVerboseData
|
||||
10, // 7: protowire.RpcTransactionInput.previousOutpoint:type_name -> protowire.RpcOutpoint
|
||||
13, // 8: protowire.RpcTransactionInput.verboseData:type_name -> protowire.RpcTransactionInputVerboseData
|
||||
8, // 9: protowire.RpcTransactionOutput.scriptPublicKey:type_name -> protowire.RpcScriptPublicKey
|
||||
14, // 10: protowire.RpcTransactionOutput.verboseData:type_name -> protowire.RpcTransactionOutputVerboseData
|
||||
8, // 11: protowire.RpcUtxoEntry.scriptPublicKey:type_name -> protowire.RpcScriptPublicKey
|
||||
1, // 12: protowire.GetCurrentNetworkResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 13: protowire.SubmitBlockRequestMessage.block:type_name -> protowire.RpcBlock
|
||||
0, // 14: protowire.SubmitBlockResponseMessage.rejectReason:type_name -> protowire.SubmitBlockResponseMessage.RejectReason
|
||||
1, // 15: protowire.SubmitBlockResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 16: protowire.GetBlockTemplateResponseMessage.block:type_name -> protowire.RpcBlock
|
||||
1, // 17: protowire.GetBlockTemplateResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 18: protowire.NotifyBlockAddedResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 19: protowire.BlockAddedNotificationMessage.block:type_name -> protowire.RpcBlock
|
||||
26, // 20: protowire.GetPeerAddressesResponseMessage.addresses:type_name -> protowire.GetPeerAddressesKnownAddressMessage
|
||||
26, // 21: protowire.GetPeerAddressesResponseMessage.bannedAddresses:type_name -> protowire.GetPeerAddressesKnownAddressMessage
|
||||
1, // 22: protowire.GetPeerAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 23: protowire.GetSelectedTipHashResponseMessage.error:type_name -> protowire.RPCError
|
||||
33, // 24: protowire.GetMempoolEntryResponseMessage.entry:type_name -> protowire.MempoolEntry
|
||||
1, // 25: protowire.GetMempoolEntryResponseMessage.error:type_name -> protowire.RPCError
|
||||
33, // 26: protowire.GetMempoolEntriesResponseMessage.entries:type_name -> protowire.MempoolEntry
|
||||
1, // 27: protowire.GetMempoolEntriesResponseMessage.error:type_name -> protowire.RPCError
|
||||
6, // 28: protowire.MempoolEntry.transaction:type_name -> protowire.RpcTransaction
|
||||
36, // 29: protowire.GetConnectedPeerInfoResponseMessage.infos:type_name -> protowire.GetConnectedPeerInfoMessage
|
||||
1, // 30: protowire.GetConnectedPeerInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 31: protowire.AddPeerResponseMessage.error:type_name -> protowire.RPCError
|
||||
6, // 32: protowire.SubmitTransactionRequestMessage.transaction:type_name -> protowire.RpcTransaction
|
||||
1, // 33: protowire.SubmitTransactionResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 34: protowire.NotifyVirtualSelectedParentChainChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 35: protowire.GetBlockResponseMessage.block:type_name -> protowire.RpcBlock
|
||||
1, // 36: protowire.GetBlockResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 37: protowire.GetSubnetworkResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 38: protowire.GetVirtualSelectedParentChainFromBlockResponseMessage.error:type_name -> protowire.RPCError
|
||||
2, // 39: protowire.GetBlocksResponseMessage.blocks:type_name -> protowire.RpcBlock
|
||||
1, // 40: protowire.GetBlocksResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 41: protowire.GetBlockCountResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 42: protowire.GetBlockDagInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 43: protowire.ResolveFinalityConflictResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 44: protowire.NotifyFinalityConflictsResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 45: protowire.ShutDownResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 46: protowire.GetHeadersResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 47: protowire.NotifyUtxosChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
69, // 48: protowire.UtxosChangedNotificationMessage.added:type_name -> protowire.UtxosByAddressesEntry
|
||||
69, // 49: protowire.UtxosChangedNotificationMessage.removed:type_name -> protowire.UtxosByAddressesEntry
|
||||
10, // 50: protowire.UtxosByAddressesEntry.outpoint:type_name -> protowire.RpcOutpoint
|
||||
11, // 51: protowire.UtxosByAddressesEntry.utxoEntry:type_name -> protowire.RpcUtxoEntry
|
||||
1, // 52: protowire.StopNotifyingUtxosChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
69, // 53: protowire.GetUtxosByAddressesResponseMessage.entries:type_name -> protowire.UtxosByAddressesEntry
|
||||
1, // 54: protowire.GetUtxosByAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 55: protowire.GetBalanceByAddressResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 56: protowire.BalancesByAddressEntry.error:type_name -> protowire.RPCError
|
||||
77, // 57: protowire.GetBalancesByAddressesResponseMessage.entries:type_name -> protowire.BalancesByAddressEntry
|
||||
1, // 58: protowire.GetBalancesByAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 59: protowire.GetVirtualSelectedParentBlueScoreResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 60: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 61: protowire.NotifyVirtualDaaScoreChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 62: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 63: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 64: protowire.BanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 65: protowire.UnbanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 66: protowire.GetInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 67: protowire.EstimateNetworkHashesPerSecondResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 68: protowire.NotifyNewBlockTemplateResponseMessage.error:type_name -> protowire.RPCError
|
||||
33, // 69: protowire.MempoolEntryByAddress.sending:type_name -> protowire.MempoolEntry
|
||||
33, // 70: protowire.MempoolEntryByAddress.receiving:type_name -> protowire.MempoolEntry
|
||||
103, // 71: protowire.GetMempoolEntriesByAddressesResponseMessage.entries:type_name -> protowire.MempoolEntryByAddress
|
||||
1, // 72: protowire.GetMempoolEntriesByAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
73, // [73:73] is the sub-list for method output_type
|
||||
73, // [73:73] is the sub-list for method input_type
|
||||
73, // [73:73] is the sub-list for extension type_name
|
||||
73, // [73:73] is the sub-list for extension extendee
|
||||
0, // [0:73] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_rpc_proto_init() }
|
||||
@ -7827,6 +8024,42 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MempoolEntryByAddress); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetMempoolEntriesByAddressesRequestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetMempoolEntriesByAddressesResponseMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
@ -7834,7 +8067,7 @@ func file_rpc_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_rpc_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 102,
|
||||
NumMessages: 105,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -673,4 +673,19 @@ message NotifyNewBlockTemplateResponseMessage {
|
||||
message NewBlockTemplateNotificationMessage {
|
||||
}
|
||||
|
||||
message MempoolEntryByAddress{
|
||||
string address = 1;
|
||||
repeated MempoolEntry sending = 2;
|
||||
repeated MempoolEntry receiving = 3;
|
||||
}
|
||||
|
||||
message GetMempoolEntriesByAddressesRequestMessage{
|
||||
repeated string addresses = 1;
|
||||
}
|
||||
|
||||
message GetMempoolEntriesByAddressesResponseMessage{
|
||||
repeated MempoolEntryByAddress entries = 1;
|
||||
|
||||
RPCError error = 1000;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,137 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_GetMempoolEntriesByAddressesRequest) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_GetMempoolEntriesRequest is nil")
|
||||
}
|
||||
return x.GetMempoolEntriesByAddressesRequest.toAppMessage()
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_GetMempoolEntriesByAddressesRequest) fromAppMessage(message *appmessage.GetMempoolEntriesByAddressesRequestMessage) error {
|
||||
x.GetMempoolEntriesByAddressesRequest = &GetMempoolEntriesByAddressesRequestMessage{
|
||||
Addresses: message.Addresses,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesRequestMessage) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_GetMempoolEntriesRequest is nil")
|
||||
}
|
||||
return &appmessage.GetMempoolEntriesByAddressesRequestMessage{
|
||||
Addresses: x.Addresses,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_GetMempoolEntriesByAddressesResponse) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_GetMempoolEntriesByAddressesResponse is nil")
|
||||
}
|
||||
return x.GetMempoolEntriesByAddressesResponse.toAppMessage()
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_GetMempoolEntriesByAddressesResponse) fromAppMessage(message *appmessage.GetMempoolEntriesByAddressesResponseMessage) error {
|
||||
var rpcErr *RPCError
|
||||
if message.Error != nil {
|
||||
rpcErr = &RPCError{Message: message.Error.Message}
|
||||
}
|
||||
entries := make([]*MempoolEntryByAddress, len(message.Entries))
|
||||
for i, entry := range message.Entries {
|
||||
entries[i] = &MempoolEntryByAddress{}
|
||||
entries[i].fromAppMessage(entry)
|
||||
}
|
||||
x.GetMempoolEntriesByAddressesResponse = &GetMempoolEntriesByAddressesResponseMessage{
|
||||
Entries: entries,
|
||||
Error: rpcErr,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetMempoolEntriesByAddressesResponseMessage) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "GetMempoolEntriesResponseMessage is nil")
|
||||
}
|
||||
rpcErr, err := x.Error.toAppMessage()
|
||||
// Error is an optional field
|
||||
if err != nil && !errors.Is(err, errorNil) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if rpcErr != nil && len(x.Entries) != 0 {
|
||||
return nil, errors.New("GetMempoolEntriesByAddressesResponseMessage contains both an error and a response")
|
||||
}
|
||||
entries := make([]*appmessage.MempoolEntryByAddress, len(x.Entries))
|
||||
for i, entry := range x.Entries {
|
||||
entries[i], err = entry.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return &appmessage.GetMempoolEntriesByAddressesResponseMessage{
|
||||
Entries: entries,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *MempoolEntryByAddress) toAppMessage() (*appmessage.MempoolEntryByAddress, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "MempoolEntry is nil")
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
sending := make([]*appmessage.MempoolEntry, len(x.Sending))
|
||||
for i, mempoolEntry := range x.Sending {
|
||||
sending[i], err = mempoolEntry.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
receiving := make([]*appmessage.MempoolEntry, len(x.Receiving))
|
||||
for i, mempoolEntry := range x.Receiving {
|
||||
receiving[i], err = mempoolEntry.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return &appmessage.MempoolEntryByAddress{
|
||||
Address: x.Address,
|
||||
Sending: sending,
|
||||
Receiving: receiving,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *MempoolEntryByAddress) fromAppMessage(message *appmessage.MempoolEntryByAddress) error {
|
||||
|
||||
sending := make([]*MempoolEntry, len(message.Sending))
|
||||
for i, mempoolEntry := range message.Sending {
|
||||
sending[i] = &MempoolEntry{}
|
||||
err := sending[i].fromAppMessage(mempoolEntry)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
receiving := make([]*MempoolEntry, len(message.Receiving))
|
||||
for i, mempoolEntry := range message.Receiving {
|
||||
receiving[i] = &MempoolEntry{}
|
||||
err := receiving[i].fromAppMessage(mempoolEntry)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
*x = MempoolEntryByAddress{
|
||||
Address: message.Address,
|
||||
Sending: sending,
|
||||
Receiving: receiving,
|
||||
}
|
||||
return nil
|
||||
}
|
@ -940,6 +940,20 @@ func toRPCPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.GetMempoolEntriesByAddressesRequestMessage:
|
||||
payload := new(KaspadMessage_GetMempoolEntriesByAddressesRequest)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.GetMempoolEntriesByAddressesResponseMessage:
|
||||
payload := new(KaspadMessage_GetMempoolEntriesByAddressesResponse)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
default:
|
||||
return nil, nil
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package rpcclient
|
||||
|
||||
import "github.com/kaspanet/kaspad/app/appmessage"
|
||||
|
||||
// GetMempoolEntriesByAddresses sends an RPC request respective to the function's name and returns the RPC server's response
|
||||
func (c *RPCClient) GetMempoolEntriesByAddresses(addresses []string) (*appmessage.GetMempoolEntriesByAddressesResponseMessage, error) {
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewGetMempoolEntriesByAddressesRequestMessage(addresses))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response, err := c.route(appmessage.CmdGetMempoolEntriesByAddressesResponseMessage).DequeueWithTimeout(c.timeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
getMempoolEntriesByAddressesResponse := response.(*appmessage.GetMempoolEntriesByAddressesResponseMessage)
|
||||
if getMempoolEntriesByAddressesResponse.Error != nil {
|
||||
return nil, c.convertRPCError(getMempoolEntriesByAddressesResponse.Error)
|
||||
}
|
||||
return getMempoolEntriesByAddressesResponse, nil
|
||||
}
|
@ -2,11 +2,12 @@ package integration
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"github.com/kaspanet/kaspad/app/protocol/flowcontext"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/kaspanet/kaspad/app/protocol/flowcontext"
|
||||
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/utxo"
|
||||
|
||||
"github.com/kaspanet/go-secp256k1"
|
||||
@ -60,11 +61,14 @@ func TestTxRelay(t *testing.T) {
|
||||
|
||||
txAddedToMempoolChan := make(chan struct{})
|
||||
|
||||
mempoolAddressQuery := []string{payee.miningAddress, payer.miningAddress}
|
||||
|
||||
spawn("TestTxRelay-WaitForTransactionPropagation", func() {
|
||||
ticker := time.NewTicker(10 * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
|
||||
for range ticker.C {
|
||||
|
||||
_, err := payee.rpcClient.GetMempoolEntry(txID)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "not found") {
|
||||
@ -73,6 +77,31 @@ func TestTxRelay(t *testing.T) {
|
||||
|
||||
t.Fatalf("Error getting mempool entry: %+v", err)
|
||||
}
|
||||
|
||||
mempoolEntriesByAddresses, err := payee.rpcClient.GetMempoolEntriesByAddresses(mempoolAddressQuery)
|
||||
if err != nil {
|
||||
t.Fatalf("Error getting mempool entry: %+v", err)
|
||||
}
|
||||
for _, mempoolEntryByAddress := range mempoolEntriesByAddresses.Entries {
|
||||
if payee.miningAddress == mempoolEntryByAddress.Address {
|
||||
if len(mempoolEntryByAddress.Sending) > 1 {
|
||||
t.Fatal("Error payee is sending")
|
||||
}
|
||||
if len(mempoolEntryByAddress.Receiving) < 1 {
|
||||
t.Fatal("Error payee is not reciving")
|
||||
}
|
||||
}
|
||||
if payer.miningAddress == mempoolEntryByAddress.Address {
|
||||
if len(mempoolEntryByAddress.Sending) < 1 {
|
||||
t.Fatal("Error payer is not sending")
|
||||
}
|
||||
if len(mempoolEntryByAddress.Receiving) > 1 {
|
||||
t.Fatal("Error payer is reciving")
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
close(txAddedToMempoolChan)
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user