Implement archive export tool

This commit is contained in:
Ori Newman 2025-02-25 17:46:09 +02:00
parent 352d261fd6
commit c0f4301099
17 changed files with 1214 additions and 139 deletions

View File

@ -167,6 +167,10 @@ const (
CmdGetFeeEstimateResponseMessage
CmdSubmitTransactionReplacementRequestMessage
CmdSubmitTransactionReplacementResponseMessage
CmdGetPruningWindowRootsRequestMessage
CmdGetPruningWindowRootsResponseMessage
CmdAddArchivalBlocksRequestMessage
CmdAddArchivalBlocksResponseMessage
)
// ProtocolMessageCommandToString maps all MessageCommands to their string representation

View File

@ -0,0 +1,42 @@
package appmessage
type ArchivalBlock struct {
Block *RPCBlock
Child string
}
// AddArchivalBlocksRequestMessage represents a request to add archival blocks
type AddArchivalBlocksRequestMessage struct {
baseMessage
Blocks []*ArchivalBlock
}
// Command returns the protocol command string for the message
func (msg *AddArchivalBlocksRequestMessage) Command() MessageCommand {
return CmdAddArchivalBlocksRequestMessage
}
// NewAddArchivalBlocksRequestMessage returns a instance of the message
func NewAddArchivalBlocksRequestMessage(blocks []*ArchivalBlock) *AddArchivalBlocksRequestMessage {
return &AddArchivalBlocksRequestMessage{
Blocks: blocks,
}
}
// AddArchivalBlocksResponseMessage represents a response to the AddArchivalBlocks request
type AddArchivalBlocksResponseMessage struct {
baseMessage
Error *RPCError
}
// Command returns the protocol command string for the message
func (msg *AddArchivalBlocksResponseMessage) Command() MessageCommand {
return CmdAddArchivalBlocksResponseMessage
}
// NewAddArchivalBlocksResponseMessage returns a instance of the message
func NewAddArchivalBlocksResponseMessage(err *RPCError) *AddArchivalBlocksResponseMessage {
return &AddArchivalBlocksResponseMessage{
Error: err,
}
}

View File

@ -0,0 +1,30 @@
package appmessage
// GetPruningWindowRootsRequestMessage is an appmessage corresponding to
// its respective RPC message
type GetPruningWindowRootsRequestMessage struct {
baseMessage
}
// Command returns the protocol command string for the message
func (msg *GetPruningWindowRootsRequestMessage) Command() MessageCommand {
return CmdGetPruningWindowRootsRequestMessage
}
type PruningWindowRoot struct {
Root string
PPIndex uint64
}
// GetPruningWindowRootsResponseMessage is an appmessage corresponding to
// its respective RPC message
type GetPruningWindowRootsResponseMessage struct {
baseMessage
Roots []*PruningWindowRoot
Error *RPCError
}
// Command returns the protocol command string for the message
func (msg *GetPruningWindowRootsResponseMessage) Command() MessageCommand {
return CmdGetPruningWindowRootsResponseMessage
}

View File

@ -0,0 +1,73 @@
package main
import (
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/kaspanet/kaspad/infrastructure/config"
"github.com/kaspanet/kaspad/util"
"github.com/pkg/errors"
"github.com/jessevdk/go-flags"
"github.com/kaspanet/kaspad/version"
)
const (
defaultLogFilename = "archiveexport.log"
defaultErrLogFilename = "archiveexport_err.log"
)
var (
// Default configuration options
defaultAppDir = util.AppDir("archiveexport", false)
defaultLogFile = filepath.Join(defaultAppDir, defaultLogFilename)
defaultErrLogFile = filepath.Join(defaultAppDir, defaultErrLogFilename)
defaultRPCServer = "localhost"
)
type configFlags struct {
ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"`
RPCServer string `short:"s" long:"rpcserver" description:"RPC server to connect to"`
Profile string `long:"profile" description:"Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65536"`
config.NetworkFlags
}
func parseConfig() (*configFlags, error) {
cfg := &configFlags{
RPCServer: defaultRPCServer,
}
parser := flags.NewParser(cfg, flags.PrintErrors|flags.HelpFlag)
_, err := parser.Parse()
// Show the version and exit if the version flag was specified.
if cfg.ShowVersion {
appName := filepath.Base(os.Args[0])
appName = strings.TrimSuffix(appName, filepath.Ext(appName))
fmt.Println(appName, "version", version.Version())
os.Exit(0)
}
if err != nil {
return nil, err
}
err = cfg.ResolveNetwork(parser)
if err != nil {
return nil, err
}
if cfg.Profile != "" {
profilePort, err := strconv.Atoi(cfg.Profile)
if err != nil || profilePort < 1024 || profilePort > 65535 {
return nil, errors.New("The profile port must be between 1024 and 65535")
}
}
initLog(defaultLogFile, defaultErrLogFile)
return cfg, nil
}

39
cmd/archiveexport/log.go Normal file
View File

@ -0,0 +1,39 @@
package main
import (
"fmt"
"github.com/kaspanet/kaspad/infrastructure/logger"
"github.com/kaspanet/kaspad/util/panics"
"os"
)
var (
backendLog = logger.NewBackend()
log = backendLog.Logger("ARCH")
spawn = panics.GoroutineWrapperFunc(log)
)
func initLog(logFile, errLogFile string) {
log.SetLevel(logger.LevelDebug)
err := backendLog.AddLogFile(logFile, logger.LevelTrace)
if err != nil {
fmt.Fprintf(os.Stderr, "Error adding log file %s as log rotator for level %s: %s", logFile, logger.LevelTrace, err)
os.Exit(1)
}
err = backendLog.AddLogFile(errLogFile, logger.LevelWarn)
if err != nil {
fmt.Fprintf(os.Stderr, "Error adding log file %s as log rotator for level %s: %s", errLogFile, logger.LevelWarn, err)
os.Exit(1)
}
err = backendLog.AddLogWriter(os.Stdout, logger.LevelInfo)
if err != nil {
fmt.Fprintf(os.Stderr, "Error adding stdout to the loggerfor level %s: %s", logger.LevelWarn, err)
os.Exit(1)
}
err = backendLog.Run()
if err != nil {
fmt.Fprintf(os.Stderr, "Error starting the logger: %s ", err)
os.Exit(1)
}
}

157
cmd/archiveexport/main.go Normal file
View File

@ -0,0 +1,157 @@
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/domain/consensus"
"github.com/kaspanet/kaspad/domain/consensus/model"
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
"github.com/kaspanet/kaspad/infrastructure/config"
"github.com/kaspanet/kaspad/infrastructure/db/database"
"github.com/kaspanet/kaspad/infrastructure/network/rpcclient"
"github.com/kaspanet/kaspad/util/panics"
"github.com/kaspanet/kaspad/util/profiling"
"github.com/kaspanet/kaspad/version"
"github.com/pkg/errors"
)
func main() {
defer panics.HandlePanic(log, "MAIN", nil)
cfg, err := parseConfig()
if err != nil {
printErrorAndExit(errors.Errorf("Error parsing command-line arguments: %s", err))
}
defer backendLog.Close()
// Show version at startup.
log.Infof("Version %s", version.Version())
// Enable http profiling server if requested.
if cfg.Profile != "" {
profiling.Start(cfg.Profile, log)
}
err = mainImpl(cfg)
if err != nil {
printErrorAndExit(err)
}
}
func mainImpl(cfg *configFlags) error {
dataDir := filepath.Join(config.DefaultAppDir)
dbPath := filepath.Join(dataDir, "db")
consensusConfig := &consensus.Config{Params: *cfg.NetParams()}
factory := consensus.NewFactory()
factory.SetTestDataDir(dbPath)
tc, tearDownFunc, err := factory.NewTestConsensus(consensusConfig, "archiveexport")
if err != nil {
return err
}
defer tearDownFunc(true)
rpcAddress, err := cfg.NetParams().NormalizeRPCServerAddress(cfg.RPCServer)
if err != nil {
return err
}
rpcClient, err := rpcclient.NewRPCClient(rpcAddress)
if err != nil {
return err
}
rootsResp, err := rpcClient.GetPruningWindowRoots()
if err != nil {
return err
}
ppHeaders, err := tc.PruningPointHeaders()
if err != nil {
return err
}
for _, root := range rootsResp.Roots {
rootHash, err := externalapi.NewDomainHashFromString(root.Root)
if err != nil {
return err
}
rootHeader, err := tc.BlockHeaderStore().BlockHeader(tc.DatabaseContext(), model.NewStagingArea(), rootHash)
if database.IsNotFoundError(err) {
continue
}
if err != nil {
return err
}
nextPP := ppHeaders[root.PPIndex-1]
blockToChild := make(map[externalapi.DomainHash]externalapi.DomainHash)
// TODO: Since GD data is not always available, we should extract the blue work from the header and use that for topological traversal
heap := tc.DAGTraversalManager().NewDownHeap(model.NewStagingArea())
for _, parent := range rootHeader.DirectParents() {
heap.Push(parent)
blockToChild[*parent] = *rootHash
}
visited := make(map[externalapi.DomainHash]struct{})
chunk := make([]*appmessage.ArchivalBlock, 0, 1000)
for heap.Len() > 0 {
hash := heap.Pop()
if _, ok := visited[*hash]; ok {
continue
}
visited[*hash] = struct{}{}
// TODO: Use header data instead of GD data
blockGHOSTDAGData, err := tc.GHOSTDAGDataStore().Get(tc.DatabaseContext(), model.NewStagingArea(), hash, false)
if err != nil {
return err
}
if blockGHOSTDAGData.BlueWork().Cmp(nextPP.BlueWork()) <= 0 {
break
}
block, err := tc.BlockStore().Block(tc.DatabaseContext(), model.NewStagingArea(), hash)
if database.IsNotFoundError(err) {
continue
}
if err != nil {
return err
}
chunk = append(chunk, &appmessage.ArchivalBlock{
Block: appmessage.DomainBlockToRPCBlock(block),
Child: blockToChild[*hash].String(),
})
if len(chunk) == cap(chunk) {
_, err := rpcClient.AddArchivalBlocks(chunk)
if err != nil {
return err
}
chunk = chunk[:0]
}
for _, parent := range block.Header.DirectParents() {
heap.Push(parent)
blockToChild[*parent] = *hash
}
}
}
return nil
}
func printErrorAndExit(err error) {
fmt.Fprintf(os.Stderr, "%+v\n", err)
os.Exit(1)
}

View File

@ -41,6 +41,9 @@ var commandTypes = []reflect.Type{
reflect.TypeOf(protowire.KaspadMessage_BanRequest{}),
reflect.TypeOf(protowire.KaspadMessage_UnbanRequest{}),
reflect.TypeOf(protowire.KaspadMessage_GetPruningWindowRootsRequest{}),
reflect.TypeOf(protowire.KaspadMessage_AddArchivalBlocksRequest{}),
}
type commandDescription struct {

View File

@ -176,6 +176,10 @@ type KaspadMessage struct {
// *KaspadMessage_GetFeeEstimateResponse
// *KaspadMessage_GetFeeEstimateExperimentalResponse
// *KaspadMessage_GetCurrentBlockColorResponse
// *KaspadMessage_GetPruningWindowRootsRequest
// *KaspadMessage_GetPruningWindowRootsResponse
// *KaspadMessage_AddArchivalBlocksRequest
// *KaspadMessage_AddArchivalBlocksResponse
Payload isKaspadMessage_Payload `protobuf_oneof:"payload"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
@ -1586,6 +1590,42 @@ func (x *KaspadMessage) GetGetCurrentBlockColorResponse() *GetCurrentBlockColorR
return nil
}
func (x *KaspadMessage) GetGetPruningWindowRootsRequest() *GetPruningWindowRootsRequestMessage {
if x != nil {
if x, ok := x.Payload.(*KaspadMessage_GetPruningWindowRootsRequest); ok {
return x.GetPruningWindowRootsRequest
}
}
return nil
}
func (x *KaspadMessage) GetGetPruningWindowRootsResponse() *GetPruningWindowRootsResponseMessage {
if x != nil {
if x, ok := x.Payload.(*KaspadMessage_GetPruningWindowRootsResponse); ok {
return x.GetPruningWindowRootsResponse
}
}
return nil
}
func (x *KaspadMessage) GetAddArchivalBlocksRequest() *AddArchivalBlocksRequestMessage {
if x != nil {
if x, ok := x.Payload.(*KaspadMessage_AddArchivalBlocksRequest); ok {
return x.AddArchivalBlocksRequest
}
}
return nil
}
func (x *KaspadMessage) GetAddArchivalBlocksResponse() *AddArchivalBlocksResponseMessage {
if x != nil {
if x, ok := x.Payload.(*KaspadMessage_AddArchivalBlocksResponse); ok {
return x.AddArchivalBlocksResponse
}
}
return nil
}
type isKaspadMessage_Payload interface {
isKaspadMessage_Payload()
}
@ -2198,6 +2238,22 @@ type KaspadMessage_GetCurrentBlockColorResponse struct {
GetCurrentBlockColorResponse *GetCurrentBlockColorResponseMessage `protobuf:"bytes,1111,opt,name=getCurrentBlockColorResponse,proto3,oneof"`
}
type KaspadMessage_GetPruningWindowRootsRequest struct {
GetPruningWindowRootsRequest *GetPruningWindowRootsRequestMessage `protobuf:"bytes,1113,opt,name=getPruningWindowRootsRequest,proto3,oneof"`
}
type KaspadMessage_GetPruningWindowRootsResponse struct {
GetPruningWindowRootsResponse *GetPruningWindowRootsResponseMessage `protobuf:"bytes,1114,opt,name=getPruningWindowRootsResponse,proto3,oneof"`
}
type KaspadMessage_AddArchivalBlocksRequest struct {
AddArchivalBlocksRequest *AddArchivalBlocksRequestMessage `protobuf:"bytes,1115,opt,name=addArchivalBlocksRequest,proto3,oneof"`
}
type KaspadMessage_AddArchivalBlocksResponse struct {
AddArchivalBlocksResponse *AddArchivalBlocksResponseMessage `protobuf:"bytes,1116,opt,name=addArchivalBlocksResponse,proto3,oneof"`
}
func (*KaspadMessage_Addresses) isKaspadMessage_Payload() {}
func (*KaspadMessage_Block) isKaspadMessage_Payload() {}
@ -2502,13 +2558,21 @@ func (*KaspadMessage_GetFeeEstimateExperimentalResponse) isKaspadMessage_Payload
func (*KaspadMessage_GetCurrentBlockColorResponse) isKaspadMessage_Payload() {}
func (*KaspadMessage_GetPruningWindowRootsRequest) isKaspadMessage_Payload() {}
func (*KaspadMessage_GetPruningWindowRootsResponse) isKaspadMessage_Payload() {}
func (*KaspadMessage_AddArchivalBlocksRequest) isKaspadMessage_Payload() {}
func (*KaspadMessage_AddArchivalBlocksResponse) 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, 0x80, 0x80, 0x01, 0x0a, 0x0d, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73,
0x6f, 0x22, 0xca, 0x83, 0x01, 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,
@ -3531,21 +3595,50 @@ var file_messages_proto_rawDesc = []byte{
0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1c, 0x67, 0x65,
0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 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,
0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x1c, 0x67, 0x65,
0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f,
0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0xd9, 0x08, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x47, 0x65,
0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f,
0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x48, 0x00, 0x52, 0x1c, 0x67, 0x65, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57,
0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x78, 0x0a, 0x1d, 0x67, 0x65, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57,
0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x18, 0xda, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67,
0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1d, 0x67, 0x65,
0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f,
0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x18, 0x61,
0x64, 0x64, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0xdb, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x72,
0x63, 0x68, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x18, 0x61, 0x64,
0x64, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6c, 0x0a, 0x19, 0x61, 0x64, 0x64, 0x41, 0x72, 0x63,
0x68, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x18, 0xdc, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76,
0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x19, 0x61, 0x64, 0x64, 0x41, 0x72,
0x63, 0x68, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 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, 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,
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, 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,
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 (
@ -3714,6 +3807,10 @@ var file_messages_proto_goTypes = []any{
(*GetFeeEstimateResponseMessage)(nil), // 149: protowire.GetFeeEstimateResponseMessage
(*GetFeeEstimateExperimentalResponseMessage)(nil), // 150: protowire.GetFeeEstimateExperimentalResponseMessage
(*GetCurrentBlockColorResponseMessage)(nil), // 151: protowire.GetCurrentBlockColorResponseMessage
(*GetPruningWindowRootsRequestMessage)(nil), // 152: protowire.GetPruningWindowRootsRequestMessage
(*GetPruningWindowRootsResponseMessage)(nil), // 153: protowire.GetPruningWindowRootsResponseMessage
(*AddArchivalBlocksRequestMessage)(nil), // 154: protowire.AddArchivalBlocksRequestMessage
(*AddArchivalBlocksResponseMessage)(nil), // 155: protowire.AddArchivalBlocksResponseMessage
}
var file_messages_proto_depIdxs = []int32{
1, // 0: protowire.KaspadMessage.addresses:type_name -> protowire.AddressesMessage
@ -3868,15 +3965,19 @@ var file_messages_proto_depIdxs = []int32{
149, // 149: protowire.KaspadMessage.getFeeEstimateResponse:type_name -> protowire.GetFeeEstimateResponseMessage
150, // 150: protowire.KaspadMessage.getFeeEstimateExperimentalResponse:type_name -> protowire.GetFeeEstimateExperimentalResponseMessage
151, // 151: protowire.KaspadMessage.getCurrentBlockColorResponse:type_name -> protowire.GetCurrentBlockColorResponseMessage
0, // 152: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
0, // 153: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
0, // 154: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
0, // 155: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
154, // [154:156] is the sub-list for method output_type
152, // [152:154] is the sub-list for method input_type
152, // [152:152] is the sub-list for extension type_name
152, // [152:152] is the sub-list for extension extendee
0, // [0:152] is the sub-list for field type_name
152, // 152: protowire.KaspadMessage.getPruningWindowRootsRequest:type_name -> protowire.GetPruningWindowRootsRequestMessage
153, // 153: protowire.KaspadMessage.getPruningWindowRootsResponse:type_name -> protowire.GetPruningWindowRootsResponseMessage
154, // 154: protowire.KaspadMessage.addArchivalBlocksRequest:type_name -> protowire.AddArchivalBlocksRequestMessage
155, // 155: protowire.KaspadMessage.addArchivalBlocksResponse:type_name -> protowire.AddArchivalBlocksResponseMessage
0, // 156: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
0, // 157: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
0, // 158: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
0, // 159: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
158, // [158:160] is the sub-list for method output_type
156, // [156:158] is the sub-list for method input_type
156, // [156:156] is the sub-list for extension type_name
156, // [156:156] is the sub-list for extension extendee
0, // [0:156] is the sub-list for field type_name
}
func init() { file_messages_proto_init() }
@ -4039,6 +4140,10 @@ func file_messages_proto_init() {
(*KaspadMessage_GetFeeEstimateResponse)(nil),
(*KaspadMessage_GetFeeEstimateExperimentalResponse)(nil),
(*KaspadMessage_GetCurrentBlockColorResponse)(nil),
(*KaspadMessage_GetPruningWindowRootsRequest)(nil),
(*KaspadMessage_GetPruningWindowRootsResponse)(nil),
(*KaspadMessage_AddArchivalBlocksRequest)(nil),
(*KaspadMessage_AddArchivalBlocksResponse)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{

View File

@ -29,12 +29,15 @@ message KaspadMessage {
UnexpectedPruningPointMessage unexpectedPruningPoint = 27;
IbdBlockLocatorMessage ibdBlockLocator = 30;
IbdBlockLocatorHighestHashMessage ibdBlockLocatorHighestHash = 31;
RequestNextPruningPointUtxoSetChunkMessage requestNextPruningPointUtxoSetChunk = 33;
RequestNextPruningPointUtxoSetChunkMessage
requestNextPruningPointUtxoSetChunk = 33;
DonePruningPointUtxoSetChunksMessage donePruningPointUtxoSetChunks = 34;
IbdBlockLocatorHighestHashNotFoundMessage ibdBlockLocatorHighestHashNotFound = 35;
IbdBlockLocatorHighestHashNotFoundMessage
ibdBlockLocatorHighestHashNotFound = 35;
BlockWithTrustedDataMessage blockWithTrustedData = 36;
DoneBlocksWithTrustedDataMessage doneBlocksWithTrustedData = 37;
RequestPruningPointAndItsAnticoneMessage requestPruningPointAndItsAnticone = 40;
RequestPruningPointAndItsAnticoneMessage requestPruningPointAndItsAnticone =
40;
BlockHeadersMessage blockHeaders = 41;
RequestNextHeadersMessage requestNextHeaders = 42;
DoneHeadersMessage DoneHeaders = 43;
@ -50,7 +53,8 @@ message KaspadMessage {
RequestIBDChainBlockLocatorMessage requestIBDChainBlockLocator = 53;
IbdChainBlockLocatorMessage ibdChainBlockLocator = 54;
RequestAnticoneMessage requestAnticone = 55;
RequestNextPruningPointAndItsAnticoneBlocksMessage requestNextPruningPointAndItsAnticoneBlocks = 56;
RequestNextPruningPointAndItsAnticoneBlocksMessage
requestNextPruningPointAndItsAnticoneBlocks = 56;
GetCurrentNetworkRequestMessage getCurrentNetworkRequest = 1001;
GetCurrentNetworkResponseMessage getCurrentNetworkResponse = 1002;
@ -73,15 +77,20 @@ message KaspadMessage {
AddPeerResponseMessage addPeerResponse = 1019;
SubmitTransactionRequestMessage submitTransactionRequest = 1020;
SubmitTransactionResponseMessage submitTransactionResponse = 1021;
NotifyVirtualSelectedParentChainChangedRequestMessage notifyVirtualSelectedParentChainChangedRequest = 1022;
NotifyVirtualSelectedParentChainChangedResponseMessage notifyVirtualSelectedParentChainChangedResponse = 1023;
VirtualSelectedParentChainChangedNotificationMessage virtualSelectedParentChainChangedNotification = 1024;
NotifyVirtualSelectedParentChainChangedRequestMessage
notifyVirtualSelectedParentChainChangedRequest = 1022;
NotifyVirtualSelectedParentChainChangedResponseMessage
notifyVirtualSelectedParentChainChangedResponse = 1023;
VirtualSelectedParentChainChangedNotificationMessage
virtualSelectedParentChainChangedNotification = 1024;
GetBlockRequestMessage getBlockRequest = 1025;
GetBlockResponseMessage getBlockResponse = 1026;
GetSubnetworkRequestMessage getSubnetworkRequest = 1027;
GetSubnetworkResponseMessage getSubnetworkResponse = 1028;
GetVirtualSelectedParentChainFromBlockRequestMessage getVirtualSelectedParentChainFromBlockRequest = 1029;
GetVirtualSelectedParentChainFromBlockResponseMessage getVirtualSelectedParentChainFromBlockResponse = 1030;
GetVirtualSelectedParentChainFromBlockRequestMessage
getVirtualSelectedParentChainFromBlockRequest = 1029;
GetVirtualSelectedParentChainFromBlockResponseMessage
getVirtualSelectedParentChainFromBlockResponse = 1030;
GetBlocksRequestMessage getBlocksRequest = 1031;
GetBlocksResponseMessage getBlocksResponse = 1032;
GetBlockCountRequestMessage getBlockCountRequest = 1033;
@ -89,11 +98,14 @@ message KaspadMessage {
GetBlockDagInfoRequestMessage getBlockDagInfoRequest = 1035;
GetBlockDagInfoResponseMessage getBlockDagInfoResponse = 1036;
ResolveFinalityConflictRequestMessage resolveFinalityConflictRequest = 1037;
ResolveFinalityConflictResponseMessage resolveFinalityConflictResponse = 1038;
ResolveFinalityConflictResponseMessage resolveFinalityConflictResponse =
1038;
NotifyFinalityConflictsRequestMessage notifyFinalityConflictsRequest = 1039;
NotifyFinalityConflictsResponseMessage notifyFinalityConflictsResponse = 1040;
NotifyFinalityConflictsResponseMessage notifyFinalityConflictsResponse =
1040;
FinalityConflictNotificationMessage finalityConflictNotification = 1041;
FinalityConflictResolvedNotificationMessage finalityConflictResolvedNotification = 1042;
FinalityConflictResolvedNotificationMessage
finalityConflictResolvedNotification = 1042;
GetMempoolEntriesRequestMessage getMempoolEntriesRequest = 1043;
GetMempoolEntriesResponseMessage getMempoolEntriesResponse = 1044;
ShutDownRequestMessage shutDownRequest = 1045;
@ -105,29 +117,46 @@ message KaspadMessage {
UtxosChangedNotificationMessage utxosChangedNotification = 1051;
GetUtxosByAddressesRequestMessage getUtxosByAddressesRequest = 1052;
GetUtxosByAddressesResponseMessage getUtxosByAddressesResponse = 1053;
GetVirtualSelectedParentBlueScoreRequestMessage getVirtualSelectedParentBlueScoreRequest = 1054;
GetVirtualSelectedParentBlueScoreResponseMessage getVirtualSelectedParentBlueScoreResponse = 1055;
NotifyVirtualSelectedParentBlueScoreChangedRequestMessage notifyVirtualSelectedParentBlueScoreChangedRequest = 1056;
NotifyVirtualSelectedParentBlueScoreChangedResponseMessage notifyVirtualSelectedParentBlueScoreChangedResponse = 1057;
VirtualSelectedParentBlueScoreChangedNotificationMessage virtualSelectedParentBlueScoreChangedNotification = 1058;
GetVirtualSelectedParentBlueScoreRequestMessage
getVirtualSelectedParentBlueScoreRequest = 1054;
GetVirtualSelectedParentBlueScoreResponseMessage
getVirtualSelectedParentBlueScoreResponse = 1055;
NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
notifyVirtualSelectedParentBlueScoreChangedRequest = 1056;
NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
notifyVirtualSelectedParentBlueScoreChangedResponse = 1057;
VirtualSelectedParentBlueScoreChangedNotificationMessage
virtualSelectedParentBlueScoreChangedNotification = 1058;
BanRequestMessage banRequest = 1059;
BanResponseMessage banResponse = 1060;
UnbanRequestMessage unbanRequest = 1061;
UnbanResponseMessage unbanResponse = 1062;
GetInfoRequestMessage getInfoRequest = 1063;
GetInfoResponseMessage getInfoResponse = 1064;
StopNotifyingUtxosChangedRequestMessage stopNotifyingUtxosChangedRequest = 1065;
StopNotifyingUtxosChangedResponseMessage stopNotifyingUtxosChangedResponse = 1066;
NotifyPruningPointUTXOSetOverrideRequestMessage notifyPruningPointUTXOSetOverrideRequest = 1067;
NotifyPruningPointUTXOSetOverrideResponseMessage notifyPruningPointUTXOSetOverrideResponse = 1068;
PruningPointUTXOSetOverrideNotificationMessage pruningPointUTXOSetOverrideNotification = 1069;
StopNotifyingPruningPointUTXOSetOverrideRequestMessage stopNotifyingPruningPointUTXOSetOverrideRequest = 1070;
StopNotifyingPruningPointUTXOSetOverrideResponseMessage stopNotifyingPruningPointUTXOSetOverrideResponse = 1071;
EstimateNetworkHashesPerSecondRequestMessage estimateNetworkHashesPerSecondRequest = 1072;
EstimateNetworkHashesPerSecondResponseMessage estimateNetworkHashesPerSecondResponse = 1073;
NotifyVirtualDaaScoreChangedRequestMessage notifyVirtualDaaScoreChangedRequest = 1074;
NotifyVirtualDaaScoreChangedResponseMessage notifyVirtualDaaScoreChangedResponse = 1075;
VirtualDaaScoreChangedNotificationMessage virtualDaaScoreChangedNotification = 1076;
StopNotifyingUtxosChangedRequestMessage stopNotifyingUtxosChangedRequest =
1065;
StopNotifyingUtxosChangedResponseMessage stopNotifyingUtxosChangedResponse =
1066;
NotifyPruningPointUTXOSetOverrideRequestMessage
notifyPruningPointUTXOSetOverrideRequest = 1067;
NotifyPruningPointUTXOSetOverrideResponseMessage
notifyPruningPointUTXOSetOverrideResponse = 1068;
PruningPointUTXOSetOverrideNotificationMessage
pruningPointUTXOSetOverrideNotification = 1069;
StopNotifyingPruningPointUTXOSetOverrideRequestMessage
stopNotifyingPruningPointUTXOSetOverrideRequest = 1070;
StopNotifyingPruningPointUTXOSetOverrideResponseMessage
stopNotifyingPruningPointUTXOSetOverrideResponse = 1071;
EstimateNetworkHashesPerSecondRequestMessage
estimateNetworkHashesPerSecondRequest = 1072;
EstimateNetworkHashesPerSecondResponseMessage
estimateNetworkHashesPerSecondResponse = 1073;
NotifyVirtualDaaScoreChangedRequestMessage
notifyVirtualDaaScoreChangedRequest = 1074;
NotifyVirtualDaaScoreChangedResponseMessage
notifyVirtualDaaScoreChangedResponse = 1075;
VirtualDaaScoreChangedNotificationMessage
virtualDaaScoreChangedNotification = 1076;
GetBalanceByAddressRequestMessage getBalanceByAddressRequest = 1077;
GetBalanceByAddressResponseMessage getBalanceByAddressResponse = 1078;
GetBalancesByAddressesRequestMessage getBalancesByAddressesRequest = 1079;
@ -135,39 +164,51 @@ message KaspadMessage {
NotifyNewBlockTemplateRequestMessage notifyNewBlockTemplateRequest = 1081;
NotifyNewBlockTemplateResponseMessage notifyNewBlockTemplateResponse = 1082;
NewBlockTemplateNotificationMessage newBlockTemplateNotification = 1083;
GetMempoolEntriesByAddressesRequestMessage getMempoolEntriesByAddressesRequest = 1084;
GetMempoolEntriesByAddressesResponseMessage getMempoolEntriesByAddressesResponse = 1085;
GetMempoolEntriesByAddressesRequestMessage
getMempoolEntriesByAddressesRequest = 1084;
GetMempoolEntriesByAddressesResponseMessage
getMempoolEntriesByAddressesResponse = 1085;
GetCoinSupplyRequestMessage getCoinSupplyRequest = 1086;
GetCoinSupplyResponseMessage getCoinSupplyResponse= 1087;
GetCoinSupplyResponseMessage getCoinSupplyResponse = 1087;
PingRequestMessage pingRequest = 1088;
GetMetricsRequestMessage getMetricsRequest = 1090;
GetServerInfoRequestMessage getServerInfoRequest = 1092;
GetSyncStatusRequestMessage getSyncStatusRequest = 1094;
GetDaaScoreTimestampEstimateRequestMessage getDaaScoreTimestampEstimateRequest = 1096;
SubmitTransactionReplacementRequestMessage submitTransactionReplacementRequest = 1100;
GetDaaScoreTimestampEstimateRequestMessage
getDaaScoreTimestampEstimateRequest = 1096;
SubmitTransactionReplacementRequestMessage
submitTransactionReplacementRequest = 1100;
GetConnectionsRequestMessage getConnectionsRequest = 1102;
GetSystemInfoRequestMessage getSystemInfoRequest = 1104;
GetFeeEstimateRequestMessage getFeeEstimateRequest = 1106;
GetFeeEstimateExperimentalRequestMessage getFeeEstimateExperimentalRequest = 1108;
GetFeeEstimateExperimentalRequestMessage getFeeEstimateExperimentalRequest =
1108;
GetCurrentBlockColorRequestMessage getCurrentBlockColorRequest = 1110;
PingResponseMessage pingResponse= 1089;
GetMetricsResponseMessage getMetricsResponse= 1091;
PingResponseMessage pingResponse = 1089;
GetMetricsResponseMessage getMetricsResponse = 1091;
GetServerInfoResponseMessage getServerInfoResponse = 1093;
GetSyncStatusResponseMessage getSyncStatusResponse = 1095;
GetDaaScoreTimestampEstimateResponseMessage getDaaScoreTimestampEstimateResponse = 1097;
SubmitTransactionReplacementResponseMessage submitTransactionReplacementResponse = 1101;
GetConnectionsResponseMessage getConnectionsResponse= 1103;
GetSystemInfoResponseMessage getSystemInfoResponse= 1105;
GetDaaScoreTimestampEstimateResponseMessage
getDaaScoreTimestampEstimateResponse = 1097;
SubmitTransactionReplacementResponseMessage
submitTransactionReplacementResponse = 1101;
GetConnectionsResponseMessage getConnectionsResponse = 1103;
GetSystemInfoResponseMessage getSystemInfoResponse = 1105;
GetFeeEstimateResponseMessage getFeeEstimateResponse = 1107;
GetFeeEstimateExperimentalResponseMessage getFeeEstimateExperimentalResponse = 1109;
GetFeeEstimateExperimentalResponseMessage
getFeeEstimateExperimentalResponse = 1109;
GetCurrentBlockColorResponseMessage getCurrentBlockColorResponse = 1111;
GetPruningWindowRootsRequestMessage getPruningWindowRootsRequest = 1113;
GetPruningWindowRootsResponseMessage getPruningWindowRootsResponse = 1114;
AddArchivalBlocksRequestMessage addArchivalBlocksRequest = 1115;
AddArchivalBlocksResponseMessage addArchivalBlocksResponse = 1116;
}
}
service P2P {
rpc MessageStream (stream KaspadMessage) returns (stream KaspadMessage) {}
rpc MessageStream(stream KaspadMessage) returns (stream KaspadMessage) {}
}
service RPC {
rpc MessageStream (stream KaspadMessage) returns (stream KaspadMessage) {}
rpc MessageStream(stream KaspadMessage) returns (stream KaspadMessage) {}
}

View File

@ -229,7 +229,7 @@ type TransactionMessage struct {
SubnetworkId *SubnetworkId `protobuf:"bytes,5,opt,name=subnetworkId,proto3" json:"subnetworkId,omitempty"`
Gas uint64 `protobuf:"varint,6,opt,name=gas,proto3" json:"gas,omitempty"`
Payload []byte `protobuf:"bytes,8,opt,name=payload,proto3" json:"payload,omitempty"`
Mass uint64 `protobuf:"varint,9,opt,name=mass,proto3" json:"mass,omitempty"` // <<< BPS10 - Add mass to TransactionMessage
Mass uint64 `protobuf:"varint,9,opt,name=mass,proto3" json:"mass,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

View File

@ -1,11 +1,14 @@
// RPC-related types. Request messages, response messages, and dependant types.
//
// Clients are expected to build RequestMessages and wrap them in KaspadMessage. (see messages.proto)
// Clients are expected to build RequestMessages and wrap them in KaspadMessage.
// (see messages.proto)
//
// Having received a RequestMessage, (wrapped in a KaspadMessage) the RPC server will respond with a
// ResponseMessage (likewise wrapped in a KaspadMessage) respective to the original RequestMessage.
// Having received a RequestMessage, (wrapped in a KaspadMessage) the RPC server
// will respond with a ResponseMessage (likewise wrapped in a KaspadMessage)
// respective to the original RequestMessage.
//
// **IMPORTANT:** This API is a work in progress and is subject to break between versions.
// **IMPORTANT:** This API is a work in progress and is subject to break between
// versions.
//
// Code generated by protoc-gen-go. DO NOT EDIT.
@ -81,7 +84,8 @@ func (SubmitBlockResponseMessage_RejectReason) EnumDescriptor() ([]byte, []int)
// RPCError represents a generic non-internal error.
//
// Receivers of any ResponseMessage are expected to check whether its error field is not null.
// Receivers of any ResponseMessage are expected to check whether its error
// field is not null.
type RPCError struct {
state protoimpl.MessageState `protogen:"open.v1"`
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
@ -488,7 +492,7 @@ type RpcTransaction struct {
Gas uint64 `protobuf:"varint,6,opt,name=gas,proto3" json:"gas,omitempty"`
Payload string `protobuf:"bytes,8,opt,name=payload,proto3" json:"payload,omitempty"`
VerboseData *RpcTransactionVerboseData `protobuf:"bytes,9,opt,name=verboseData,proto3" json:"verboseData,omitempty"`
Mass uint64 `protobuf:"varint,10,opt,name=mass,proto3" json:"mass,omitempty"` // <<< BPS10 - Add mass to RpcTransaction
Mass uint64 `protobuf:"varint,10,opt,name=mass,proto3" json:"mass,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@ -1058,7 +1062,8 @@ func (x *RpcTransactionOutputVerboseData) GetScriptPublicKeyAddress() string {
return ""
}
// GetCurrentNetworkRequestMessage requests the network kaspad is currently running against.
// GetCurrentNetworkRequestMessage requests the network kaspad is currently
// running against.
//
// Possible networks are: Mainnet, Testnet, Simnet, Devnet
type GetCurrentNetworkRequestMessage struct {
@ -1150,7 +1155,8 @@ func (x *GetCurrentNetworkResponseMessage) GetError() *RPCError {
}
// SubmitBlockRequestMessage requests to submit a block into the DAG.
// Blocks are generally expected to have been generated using the getBlockTemplate call.
// Blocks are generally expected to have been generated using the
// getBlockTemplate call.
//
// See: GetBlockTemplateRequestMessage
type SubmitBlockRequestMessage struct {
@ -1258,7 +1264,8 @@ func (x *SubmitBlockResponseMessage) GetError() *RPCError {
}
// GetBlockTemplateRequestMessage requests a current block template.
// Callers are expected to solve the block template and submit it using the submitBlock call
// Callers are expected to solve the block template and submit it using the
// submitBlock call
//
// See: SubmitBlockRequestMessage
type GetBlockTemplateRequestMessage struct {
@ -1318,9 +1325,10 @@ type GetBlockTemplateResponseMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Block *RpcBlock `protobuf:"bytes,3,opt,name=block,proto3" json:"block,omitempty"`
// Whether kaspad thinks that it's synced.
// Callers are discouraged (but not forbidden) from solving blocks when kaspad is not synced.
// That is because when kaspad isn't in sync with the rest of the network there's a high
// chance the block will never be accepted, thus the solving effort would have been wasted.
// Callers are discouraged (but not forbidden) from solving blocks when kaspad
// is not synced. That is because when kaspad isn't in sync with the rest of
// the network there's a high chance the block will never be accepted, thus
// the solving effort would have been wasted.
IsSynced bool `protobuf:"varint,2,opt,name=isSynced,proto3" json:"isSynced,omitempty"`
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
unknownFields protoimpl.UnknownFields
@ -1378,7 +1386,8 @@ func (x *GetBlockTemplateResponseMessage) GetError() *RPCError {
return nil
}
// NotifyBlockAddedRequestMessage registers this connection for blockAdded notifications.
// NotifyBlockAddedRequestMessage registers this connection for blockAdded
// notifications.
//
// See: BlockAddedNotificationMessage
type NotifyBlockAddedRequestMessage struct {
@ -1461,8 +1470,8 @@ func (x *NotifyBlockAddedResponseMessage) GetError() *RPCError {
return nil
}
// BlockAddedNotificationMessage is sent whenever a blocks has been added (NOT accepted)
// into the DAG.
// BlockAddedNotificationMessage is sent whenever a blocks has been added (NOT
// accepted) into the DAG.
//
// See: NotifyBlockAddedRequestMessage
type BlockAddedNotificationMessage struct {
@ -1509,8 +1518,8 @@ func (x *BlockAddedNotificationMessage) GetBlock() *RpcBlock {
return nil
}
// GetPeerAddressesRequestMessage requests the list of known kaspad addresses in the
// current network. (mainnet, testnet, etc.)
// GetPeerAddressesRequestMessage requests the list of known kaspad addresses in
// the current network. (mainnet, testnet, etc.)
type GetPeerAddressesRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
@ -1741,8 +1750,8 @@ func (x *GetSelectedTipHashResponseMessage) GetError() *RPCError {
return nil
}
// GetMempoolEntryRequestMessage requests information about a specific transaction
// in the mempool.
// GetMempoolEntryRequestMessage requests information about a specific
// transaction in the mempool.
type GetMempoolEntryRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The transaction's TransactionID.
@ -1856,8 +1865,8 @@ func (x *GetMempoolEntryResponseMessage) GetError() *RPCError {
return nil
}
// GetMempoolEntriesRequestMessage requests information about all the transactions
// currently in the mempool.
// GetMempoolEntriesRequestMessage requests information about all the
// transactions currently in the mempool.
type GetMempoolEntriesRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
IncludeOrphanPool bool `protobuf:"varint,1,opt,name=includeOrphanPool,proto3" json:"includeOrphanPool,omitempty"`
@ -2022,8 +2031,8 @@ func (x *MempoolEntry) GetIsOrphan() bool {
return false
}
// GetConnectedPeerInfoRequestMessage requests information about all the p2p peers
// currently connected to this kaspad.
// GetConnectedPeerInfoRequestMessage requests information about all the p2p
// peers currently connected to this kaspad.
type GetConnectedPeerInfoRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
@ -2430,7 +2439,8 @@ func (x *SubmitTransactionResponseMessage) GetError() *RPCError {
return nil
}
// NotifyVirtualSelectedParentChainChangedRequestMessage registers this connection for virtualSelectedParentChainChanged notifications.
// NotifyVirtualSelectedParentChainChangedRequestMessage registers this
// connection for virtualSelectedParentChainChanged notifications.
//
// See: VirtualSelectedParentChainChangedNotificationMessage
type NotifyVirtualSelectedParentChainChangedRequestMessage struct {
@ -2521,8 +2531,8 @@ func (x *NotifyVirtualSelectedParentChainChangedResponseMessage) GetError() *RPC
return nil
}
// VirtualSelectedParentChainChangedNotificationMessage is sent whenever the DAG's selected parent
// chain had changed.
// VirtualSelectedParentChainChangedNotificationMessage is sent whenever the
// DAG's selected parent chain had changed.
//
// See: NotifyVirtualSelectedParentChainChangedRequestMessage
type VirtualSelectedParentChainChangedNotificationMessage struct {
@ -2531,7 +2541,8 @@ type VirtualSelectedParentChainChangedNotificationMessage struct {
RemovedChainBlockHashes []string `protobuf:"bytes,1,rep,name=removedChainBlockHashes,proto3" json:"removedChainBlockHashes,omitempty"`
// The chain blocks that were added, in low-to-high order
AddedChainBlockHashes []string `protobuf:"bytes,3,rep,name=addedChainBlockHashes,proto3" json:"addedChainBlockHashes,omitempty"`
// Will be filled only if `includeAcceptedTransactionIds = true` in the notify request.
// Will be filled only if `includeAcceptedTransactionIds = true` in the notify
// request.
AcceptedTransactionIds []*AcceptedTransactionIds `protobuf:"bytes,2,rep,name=acceptedTransactionIds,proto3" json:"acceptedTransactionIds,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
@ -2794,8 +2805,8 @@ func (x *GetSubnetworkResponseMessage) GetError() *RPCError {
return nil
}
// GetVirtualSelectedParentChainFromBlockRequestMessage requests the virtual selected
// parent chain from some startHash to this kaspad's current virtual
// GetVirtualSelectedParentChainFromBlockRequestMessage requests the virtual
// selected parent chain from some startHash to this kaspad's current virtual
type GetVirtualSelectedParentChainFromBlockRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
StartHash string `protobuf:"bytes,1,opt,name=startHash,proto3" json:"startHash,omitempty"`
@ -2907,7 +2918,8 @@ type GetVirtualSelectedParentChainFromBlockResponseMessage struct {
// The chain blocks that were added, in low-to-high order
AddedChainBlockHashes []string `protobuf:"bytes,3,rep,name=addedChainBlockHashes,proto3" json:"addedChainBlockHashes,omitempty"`
// The transactions accepted by each block in addedChainBlockHashes.
// Will be filled only if `includeAcceptedTransactionIds = true` in the request.
// Will be filled only if `includeAcceptedTransactionIds = true` in the
// request.
AcceptedTransactionIds []*AcceptedTransactionIds `protobuf:"bytes,2,rep,name=acceptedTransactionIds,proto3" json:"acceptedTransactionIds,omitempty"`
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
unknownFields protoimpl.UnknownFields
@ -2972,8 +2984,8 @@ func (x *GetVirtualSelectedParentChainFromBlockResponseMessage) GetError() *RPCE
return nil
}
// GetBlocksRequestMessage requests blocks between a certain block lowHash up to this
// kaspad's current virtual.
// GetBlocksRequestMessage requests blocks between a certain block lowHash up to
// this kaspad's current virtual.
type GetBlocksRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
LowHash string `protobuf:"bytes,1,opt,name=lowHash,proto3" json:"lowHash,omitempty"`
@ -3094,8 +3106,8 @@ func (x *GetBlocksResponseMessage) GetError() *RPCError {
return nil
}
// GetBlockCountRequestMessage requests the current number of blocks in this kaspad.
// Note that this number may decrease as pruning occurs.
// GetBlockCountRequestMessage requests the current number of blocks in this
// kaspad. Note that this number may decrease as pruning occurs.
type GetBlockCountRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
@ -3192,8 +3204,8 @@ func (x *GetBlockCountResponseMessage) GetError() *RPCError {
return nil
}
// GetBlockDagInfoRequestMessage requests general information about the current state
// of this kaspad's DAG.
// GetBlockDagInfoRequestMessage requests general information about the current
// state of this kaspad's DAG.
type GetBlockDagInfoRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
@ -3797,8 +3809,8 @@ func (x *GetHeadersResponseMessage) GetError() *RPCError {
return nil
}
// NotifyUtxosChangedRequestMessage registers this connection for utxoChanged notifications
// for the given addresses.
// NotifyUtxosChangedRequestMessage registers this connection for utxoChanged
// notifications for the given addresses.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
@ -3891,7 +3903,8 @@ func (x *NotifyUtxosChangedResponseMessage) GetError() *RPCError {
return nil
}
// UtxosChangedNotificationMessage is sent whenever the UTXO index had been updated.
// UtxosChangedNotificationMessage is sent whenever the UTXO index had been
// updated.
//
// See: NotifyUtxosChangedRequestMessage
type UtxosChangedNotificationMessage struct {
@ -4006,8 +4019,8 @@ func (x *UtxosByAddressesEntry) GetUtxoEntry() *RpcUtxoEntry {
return nil
}
// StopNotifyingUtxosChangedRequestMessage unregisters this connection for utxoChanged notifications
// for the given addresses.
// StopNotifyingUtxosChangedRequestMessage unregisters this connection for
// utxoChanged notifications for the given addresses.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
@ -4100,7 +4113,8 @@ func (x *StopNotifyingUtxosChangedResponseMessage) GetError() *RPCError {
return nil
}
// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given kaspad addresses
// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given
// kaspad addresses
//
// This call is only available when this kaspad was started with `--utxoindex`
type GetUtxosByAddressesRequestMessage struct {
@ -4199,7 +4213,8 @@ func (x *GetUtxosByAddressesResponseMessage) GetError() *RPCError {
return nil
}
// GetBalanceByAddressRequest returns the total balance in unspent transactions towards a given address
// GetBalanceByAddressRequest returns the total balance in unspent transactions
// towards a given address
//
// This call is only available when this kaspad was started with `--utxoindex`
type GetBalanceByAddressRequestMessage struct {
@ -4454,8 +4469,8 @@ func (x *GetBalancesByAddressesResponseMessage) GetError() *RPCError {
return nil
}
// GetVirtualSelectedParentBlueScoreRequestMessage requests the blue score of the current selected parent
// of the virtual block.
// GetVirtualSelectedParentBlueScoreRequestMessage requests the blue score of
// the current selected parent of the virtual block.
type GetVirtualSelectedParentBlueScoreRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
@ -4544,8 +4559,8 @@ func (x *GetVirtualSelectedParentBlueScoreResponseMessage) GetError() *RPCError
return nil
}
// NotifyVirtualSelectedParentBlueScoreChangedRequestMessage registers this connection for
// virtualSelectedParentBlueScoreChanged notifications.
// NotifyVirtualSelectedParentBlueScoreChangedRequestMessage registers this
// connection for virtualSelectedParentBlueScoreChanged notifications.
//
// See: VirtualSelectedParentBlueScoreChangedNotificationMessage
type NotifyVirtualSelectedParentBlueScoreChangedRequestMessage struct {
@ -4628,8 +4643,8 @@ func (x *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) GetError()
return nil
}
// VirtualSelectedParentBlueScoreChangedNotificationMessage is sent whenever the blue score
// of the virtual's selected parent changes.
// VirtualSelectedParentBlueScoreChangedNotificationMessage is sent whenever the
// blue score of the virtual's selected parent changes.
//
// See NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
type VirtualSelectedParentBlueScoreChangedNotificationMessage struct {
@ -4894,8 +4909,8 @@ func (x *NotifyPruningPointUTXOSetOverrideResponseMessage) GetError() *RPCError
return nil
}
// PruningPointUTXOSetOverrideNotificationMessage is sent whenever the UTXO index
// resets due to pruning point change via IBD.
// PruningPointUTXOSetOverrideNotificationMessage is sent whenever the UTXO
// index resets due to pruning point change via IBD.
//
// See NotifyPruningPointUTXOSetOverrideRequestMessage
type PruningPointUTXOSetOverrideNotificationMessage struct {
@ -4934,8 +4949,8 @@ func (*PruningPointUTXOSetOverrideNotificationMessage) Descriptor() ([]byte, []i
return file_rpc_proto_rawDescGZIP(), []int{89}
}
// StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this connection for
// pruning point UTXO set override notifications.
// StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this
// connection for pruning point UTXO set override notifications.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
@ -5507,8 +5522,8 @@ func (x *NotifyNewBlockTemplateResponseMessage) GetError() *RPCError {
return nil
}
// NewBlockTemplateNotificationMessage is sent whenever a new updated block template is
// available for miners.
// NewBlockTemplateNotificationMessage is sent whenever a new updated block
// template is available for miners.
//
// See NotifyNewBlockTemplateRequestMessage
type NewBlockTemplateNotificationMessage struct {
@ -5756,10 +5771,11 @@ func (*GetCoinSupplyRequestMessage) Descriptor() ([]byte, []int) {
}
type GetCoinSupplyResponseMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
MaxSompi uint64 `protobuf:"varint,1,opt,name=maxSompi,proto3" json:"maxSompi,omitempty"` // note: this is a hard coded maxSupply, actual maxSupply is expected to deviate by upto -5%, but cannot be measured exactly.
CirculatingSompi uint64 `protobuf:"varint,2,opt,name=circulatingSompi,proto3" json:"circulatingSompi,omitempty"`
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
state protoimpl.MessageState `protogen:"open.v1"`
MaxSompi uint64 `protobuf:"varint,1,opt,name=maxSompi,proto3" json:"maxSompi,omitempty"` // note: this is a hard coded maxSupply, actual maxSupply is expected
// to deviate by upto -5%, but cannot be measured exactly.
CirculatingSompi uint64 `protobuf:"varint,2,opt,name=circulatingSompi,proto3" json:"circulatingSompi,omitempty"`
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@ -7795,6 +7811,286 @@ func (x *SubmitTransactionReplacementResponseMessage) GetError() *RPCError {
return nil
}
type GetPruningWindowRootsRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetPruningWindowRootsRequestMessage) Reset() {
*x = GetPruningWindowRootsRequestMessage{}
mi := &file_rpc_proto_msgTypes[139]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetPruningWindowRootsRequestMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetPruningWindowRootsRequestMessage) ProtoMessage() {}
func (x *GetPruningWindowRootsRequestMessage) ProtoReflect() protoreflect.Message {
mi := &file_rpc_proto_msgTypes[139]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetPruningWindowRootsRequestMessage.ProtoReflect.Descriptor instead.
func (*GetPruningWindowRootsRequestMessage) Descriptor() ([]byte, []int) {
return file_rpc_proto_rawDescGZIP(), []int{139}
}
type PruningWindowRoot struct {
state protoimpl.MessageState `protogen:"open.v1"`
Root string `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"`
PpIndex uint64 `protobuf:"varint,2,opt,name=pp_index,json=ppIndex,proto3" json:"pp_index,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PruningWindowRoot) Reset() {
*x = PruningWindowRoot{}
mi := &file_rpc_proto_msgTypes[140]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PruningWindowRoot) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PruningWindowRoot) ProtoMessage() {}
func (x *PruningWindowRoot) ProtoReflect() protoreflect.Message {
mi := &file_rpc_proto_msgTypes[140]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PruningWindowRoot.ProtoReflect.Descriptor instead.
func (*PruningWindowRoot) Descriptor() ([]byte, []int) {
return file_rpc_proto_rawDescGZIP(), []int{140}
}
func (x *PruningWindowRoot) GetRoot() string {
if x != nil {
return x.Root
}
return ""
}
func (x *PruningWindowRoot) GetPpIndex() uint64 {
if x != nil {
return x.PpIndex
}
return 0
}
type GetPruningWindowRootsResponseMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Roots []*PruningWindowRoot `protobuf:"bytes,1,rep,name=roots,proto3" json:"roots,omitempty"`
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetPruningWindowRootsResponseMessage) Reset() {
*x = GetPruningWindowRootsResponseMessage{}
mi := &file_rpc_proto_msgTypes[141]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetPruningWindowRootsResponseMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetPruningWindowRootsResponseMessage) ProtoMessage() {}
func (x *GetPruningWindowRootsResponseMessage) ProtoReflect() protoreflect.Message {
mi := &file_rpc_proto_msgTypes[141]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetPruningWindowRootsResponseMessage.ProtoReflect.Descriptor instead.
func (*GetPruningWindowRootsResponseMessage) Descriptor() ([]byte, []int) {
return file_rpc_proto_rawDescGZIP(), []int{141}
}
func (x *GetPruningWindowRootsResponseMessage) GetRoots() []*PruningWindowRoot {
if x != nil {
return x.Roots
}
return nil
}
func (x *GetPruningWindowRootsResponseMessage) GetError() *RPCError {
if x != nil {
return x.Error
}
return nil
}
type ArchivalBlock struct {
state protoimpl.MessageState `protogen:"open.v1"`
Child string `protobuf:"bytes,1,opt,name=child,proto3" json:"child,omitempty"`
Block *RpcBlock `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ArchivalBlock) Reset() {
*x = ArchivalBlock{}
mi := &file_rpc_proto_msgTypes[142]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ArchivalBlock) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ArchivalBlock) ProtoMessage() {}
func (x *ArchivalBlock) ProtoReflect() protoreflect.Message {
mi := &file_rpc_proto_msgTypes[142]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ArchivalBlock.ProtoReflect.Descriptor instead.
func (*ArchivalBlock) Descriptor() ([]byte, []int) {
return file_rpc_proto_rawDescGZIP(), []int{142}
}
func (x *ArchivalBlock) GetChild() string {
if x != nil {
return x.Child
}
return ""
}
func (x *ArchivalBlock) GetBlock() *RpcBlock {
if x != nil {
return x.Block
}
return nil
}
type AddArchivalBlocksRequestMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Blocks []*ArchivalBlock `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AddArchivalBlocksRequestMessage) Reset() {
*x = AddArchivalBlocksRequestMessage{}
mi := &file_rpc_proto_msgTypes[143]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AddArchivalBlocksRequestMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddArchivalBlocksRequestMessage) ProtoMessage() {}
func (x *AddArchivalBlocksRequestMessage) ProtoReflect() protoreflect.Message {
mi := &file_rpc_proto_msgTypes[143]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddArchivalBlocksRequestMessage.ProtoReflect.Descriptor instead.
func (*AddArchivalBlocksRequestMessage) Descriptor() ([]byte, []int) {
return file_rpc_proto_rawDescGZIP(), []int{143}
}
func (x *AddArchivalBlocksRequestMessage) GetBlocks() []*ArchivalBlock {
if x != nil {
return x.Blocks
}
return nil
}
type AddArchivalBlocksResponseMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AddArchivalBlocksResponseMessage) Reset() {
*x = AddArchivalBlocksResponseMessage{}
mi := &file_rpc_proto_msgTypes[144]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AddArchivalBlocksResponseMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddArchivalBlocksResponseMessage) ProtoMessage() {}
func (x *AddArchivalBlocksResponseMessage) ProtoReflect() protoreflect.Message {
mi := &file_rpc_proto_msgTypes[144]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddArchivalBlocksResponseMessage.ProtoReflect.Descriptor instead.
func (*AddArchivalBlocksResponseMessage) Descriptor() ([]byte, []int) {
return file_rpc_proto_rawDescGZIP(), []int{144}
}
func (x *AddArchivalBlocksResponseMessage) GetError() *RPCError {
if x != nil {
return x.Error
}
return nil
}
var File_rpc_proto protoreflect.FileDescriptor
var file_rpc_proto_rawDesc = []byte{
@ -8947,10 +9243,40 @@ var file_rpc_proto_rawDesc = []byte{
0x63, 0x74, 0x69, 0x6f, 0x6e, 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,
0x72, 0x22, 0x25, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57,
0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x42, 0x0a, 0x11, 0x50, 0x72, 0x75, 0x6e,
0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f,
0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x70, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20,
0x01, 0x28, 0x04, 0x52, 0x07, 0x70, 0x70, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x86, 0x01, 0x0a,
0x24, 0x47, 0x65, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f,
0x77, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65,
0x2e, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x6f,
0x6f, 0x74, 0x52, 0x05, 0x72, 0x6f, 0x6f, 0x74, 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, 0x22, 0x50, 0x0a, 0x0d, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x61,
0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x29, 0x0a, 0x05,
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x53, 0x0a, 0x1f, 0x41, 0x64, 0x64, 0x41, 0x72,
0x63, 0x68, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x62, 0x6c,
0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x61, 0x6c, 0x42,
0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x4e, 0x0a, 0x20,
0x41, 0x64, 0x64, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
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 (
@ -8966,7 +9292,7 @@ func file_rpc_proto_rawDescGZIP() []byte {
}
var file_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 139)
var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 145)
var file_rpc_proto_goTypes = []any{
(SubmitBlockResponseMessage_RejectReason)(0), // 0: protowire.SubmitBlockResponseMessage.RejectReason
(*RPCError)(nil), // 1: protowire.RPCError
@ -9108,6 +9434,12 @@ var file_rpc_proto_goTypes = []any{
(*GetCurrentBlockColorResponseMessage)(nil), // 137: protowire.GetCurrentBlockColorResponseMessage
(*SubmitTransactionReplacementRequestMessage)(nil), // 138: protowire.SubmitTransactionReplacementRequestMessage
(*SubmitTransactionReplacementResponseMessage)(nil), // 139: protowire.SubmitTransactionReplacementResponseMessage
(*GetPruningWindowRootsRequestMessage)(nil), // 140: protowire.GetPruningWindowRootsRequestMessage
(*PruningWindowRoot)(nil), // 141: protowire.PruningWindowRoot
(*GetPruningWindowRootsResponseMessage)(nil), // 142: protowire.GetPruningWindowRootsResponseMessage
(*ArchivalBlock)(nil), // 143: protowire.ArchivalBlock
(*AddArchivalBlocksRequestMessage)(nil), // 144: protowire.AddArchivalBlocksRequestMessage
(*AddArchivalBlocksResponseMessage)(nil), // 145: protowire.AddArchivalBlocksResponseMessage
}
var file_rpc_proto_depIdxs = []int32{
3, // 0: protowire.RpcBlock.header:type_name -> protowire.RpcBlockHeader
@ -9211,11 +9543,16 @@ var file_rpc_proto_depIdxs = []int32{
6, // 98: protowire.SubmitTransactionReplacementRequestMessage.transaction:type_name -> protowire.RpcTransaction
6, // 99: protowire.SubmitTransactionReplacementResponseMessage.replacedTransaction:type_name -> protowire.RpcTransaction
1, // 100: protowire.SubmitTransactionReplacementResponseMessage.error:type_name -> protowire.RPCError
101, // [101:101] is the sub-list for method output_type
101, // [101:101] is the sub-list for method input_type
101, // [101:101] is the sub-list for extension type_name
101, // [101:101] is the sub-list for extension extendee
0, // [0:101] is the sub-list for field type_name
141, // 101: protowire.GetPruningWindowRootsResponseMessage.roots:type_name -> protowire.PruningWindowRoot
1, // 102: protowire.GetPruningWindowRootsResponseMessage.error:type_name -> protowire.RPCError
2, // 103: protowire.ArchivalBlock.block:type_name -> protowire.RpcBlock
143, // 104: protowire.AddArchivalBlocksRequestMessage.blocks:type_name -> protowire.ArchivalBlock
1, // 105: protowire.AddArchivalBlocksResponseMessage.error:type_name -> protowire.RPCError
106, // [106:106] is the sub-list for method output_type
106, // [106:106] is the sub-list for method input_type
106, // [106:106] is the sub-list for extension type_name
106, // [106:106] is the sub-list for extension extendee
0, // [0:106] is the sub-list for field type_name
}
func init() { file_rpc_proto_init() }
@ -9229,7 +9566,7 @@ func file_rpc_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rpc_proto_rawDesc,
NumEnums: 1,
NumMessages: 139,
NumMessages: 145,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -888,4 +888,25 @@ message SubmitTransactionReplacementResponseMessage {
RpcTransaction replacedTransaction = 2;
RPCError error = 1000;
}
}
message GetPruningWindowRootsRequestMessage {}
message PruningWindowRoot {
string root = 1;
uint64 pp_index = 2;
}
message GetPruningWindowRootsResponseMessage {
repeated PruningWindowRoot roots = 1;
RPCError error = 1000;
}
message ArchivalBlock {
string child = 1;
RpcBlock block = 2;
}
message AddArchivalBlocksRequestMessage { repeated ArchivalBlock blocks = 1; }
message AddArchivalBlocksResponseMessage { RPCError error = 1000; }

View File

@ -0,0 +1,87 @@
package protowire
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/pkg/errors"
)
func (x *KaspadMessage_AddArchivalBlocksRequest) toAppMessage() (appmessage.Message, error) {
if x == nil {
return nil, errors.Wrapf(errorNil, "KaspadMessage_AddArchivalBlocksRequest is nil")
}
blocks := make([]*appmessage.ArchivalBlock, len(x.AddArchivalBlocksRequest.Blocks))
for i, block := range x.AddArchivalBlocksRequest.Blocks {
rpcBlock, err := block.Block.toAppMessage()
if err != nil {
return nil, err
}
blocks[i] = &appmessage.ArchivalBlock{
Block: rpcBlock,
Child: block.Child,
}
}
return &appmessage.AddArchivalBlocksRequestMessage{
Blocks: blocks,
}, nil
}
func (x *KaspadMessage_AddArchivalBlocksRequest) fromAppMessage(message *appmessage.AddArchivalBlocksRequestMessage) error {
blocks := make([]*ArchivalBlock, len(message.Blocks))
for i, block := range message.Blocks {
protoBlock := &ArchivalBlock{
Child: block.Child,
}
if block.Block != nil {
protoBlock.Block = &RpcBlock{}
err := protoBlock.Block.fromAppMessage(block.Block)
if err != nil {
return err
}
}
blocks[i] = protoBlock
}
x.AddArchivalBlocksRequest = &AddArchivalBlocksRequestMessage{
Blocks: make([]*ArchivalBlock, len(message.Blocks)),
}
return nil
}
func (x *KaspadMessage_AddArchivalBlocksResponse) toAppMessage() (appmessage.Message, error) {
if x == nil {
return nil, errors.Wrapf(errorNil, "KaspadMessage_AddArchivalBlocksResponse is nil")
}
return x.AddArchivalBlocksResponse.toAppMessage()
}
func (x *KaspadMessage_AddArchivalBlocksResponse) fromAppMessage(message *appmessage.AddArchivalBlocksResponseMessage) error {
var err *RPCError
if message.Error != nil {
err = &RPCError{Message: message.Error.Message}
}
x.AddArchivalBlocksResponse = &AddArchivalBlocksResponseMessage{
Error: err,
}
return nil
}
func (x *AddArchivalBlocksResponseMessage) toAppMessage() (appmessage.Message, error) {
if x == nil {
return nil, errors.Wrapf(errorNil, "AddArchivalBlocksResponseMessage is nil")
}
rpcErr, err := x.Error.toAppMessage()
// Error is an optional field
if err != nil && !errors.Is(err, errorNil) {
return nil, err
}
return &appmessage.GetPruningWindowRootsResponseMessage{
Error: rpcErr,
}, nil
}

View File

@ -0,0 +1,70 @@
package protowire
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/pkg/errors"
)
func (x *KaspadMessage_GetPruningWindowRootsRequest) toAppMessage() (appmessage.Message, error) {
if x == nil {
return nil, errors.Wrapf(errorNil, "KaspadMessage_GetPruningWindowRootsRequest is nil")
}
return &appmessage.GetPeerAddressesRequestMessage{}, nil
}
func (x *KaspadMessage_GetPruningWindowRootsRequest) fromAppMessage(_ *appmessage.GetPruningWindowRootsRequestMessage) error {
return nil
}
func (x *KaspadMessage_GetPruningWindowRootsResponse) toAppMessage() (appmessage.Message, error) {
if x == nil {
return nil, errors.Wrapf(errorNil, "KaspadMessage_GetPruningWindowRootsResponse is nil")
}
return x.GetPruningWindowRootsResponse.toAppMessage()
}
func (x *KaspadMessage_GetPruningWindowRootsResponse) fromAppMessage(message *appmessage.GetPruningWindowRootsResponseMessage) error {
var err *RPCError
if message.Error != nil {
err = &RPCError{Message: message.Error.Message}
}
roots := make([]*PruningWindowRoot, len(message.Roots))
for i, root := range message.Roots {
roots[i] = &PruningWindowRoot{
Root: root.Root,
PpIndex: root.PPIndex,
}
}
x.GetPruningWindowRootsResponse = &GetPruningWindowRootsResponseMessage{
Roots: roots,
Error: err,
}
return nil
}
func (x *GetPruningWindowRootsResponseMessage) toAppMessage() (appmessage.Message, error) {
if x == nil {
return nil, errors.Wrapf(errorNil, "GetPeerAddressesResponseMessage is nil")
}
rpcErr, err := x.Error.toAppMessage()
// Error is an optional field
if err != nil && !errors.Is(err, errorNil) {
return nil, err
}
roots := make([]*appmessage.PruningWindowRoot, len(x.Roots))
for i, root := range x.Roots {
roots[i] = &appmessage.PruningWindowRoot{
Root: root.Root,
PPIndex: root.PpIndex,
}
}
return &appmessage.GetPruningWindowRootsResponseMessage{
Roots: roots,
Error: rpcErr,
}, nil
}

View File

@ -989,6 +989,34 @@ func toRPCPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
return nil, err
}
return payload, nil
case *appmessage.GetPruningWindowRootsRequestMessage:
payload := new(KaspadMessage_GetPruningWindowRootsRequest)
err := payload.fromAppMessage(message)
if err != nil {
return nil, err
}
return payload, nil
case *appmessage.GetPruningWindowRootsResponseMessage:
payload := new(KaspadMessage_GetPruningWindowRootsResponse)
err := payload.fromAppMessage(message)
if err != nil {
return nil, err
}
return payload, nil
case *appmessage.AddArchivalBlocksRequestMessage:
payload := new(KaspadMessage_AddArchivalBlocksRequest)
err := payload.fromAppMessage(message)
if err != nil {
return nil, err
}
return payload, nil
case *appmessage.AddArchivalBlocksResponseMessage:
payload := new(KaspadMessage_AddArchivalBlocksResponse)
err := payload.fromAppMessage(message)
if err != nil {
return nil, err
}
return payload, nil
default:
return nil, nil
}

View File

@ -0,0 +1,19 @@
package rpcclient
import "github.com/kaspanet/kaspad/app/appmessage"
func (c *RPCClient) AddArchivalBlocks(blocks []*appmessage.ArchivalBlock) (*appmessage.AddArchivalBlocksResponseMessage, error) {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewAddArchivalBlocksRequestMessage(blocks))
if err != nil {
return nil, err
}
response, err := c.route(appmessage.CmdAddArchivalBlocksRequestMessage).DequeueWithTimeout(c.timeout)
if err != nil {
return nil, err
}
convertedResp := response.(*appmessage.AddArchivalBlocksResponseMessage)
if convertedResp.Error != nil {
return nil, c.convertRPCError(convertedResp.Error)
}
return convertedResp, nil
}

View File

@ -0,0 +1,19 @@
package rpcclient
import "github.com/kaspanet/kaspad/app/appmessage"
func (c *RPCClient) GetPruningWindowRoots() (*appmessage.GetPruningWindowRootsResponseMessage, error) {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewGetPeerAddressesRequestMessage())
if err != nil {
return nil, err
}
response, err := c.route(appmessage.CmdGetPruningWindowRootsRequestMessage).DequeueWithTimeout(c.timeout)
if err != nil {
return nil, err
}
convertedResp := response.(*appmessage.GetPruningWindowRootsResponseMessage)
if convertedResp.Error != nil {
return nil, c.convertRPCError(convertedResp.Error)
}
return convertedResp, nil
}