Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ USAGE:
FLAGS:
-d, --debug Enable debug logging level
-h, --help Prints help information
--mine-when-not-synced Mine even when kaspad says it is not synced, only useful when passing `--allow-submit-
block-when-not-synced` to kaspad [default: false]
--mine-when-not-synced Mine even when kaspad says it is not synced, only useful when passing
`--enable-unsynced-mining` to kaspad [default: false]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--allow-block-when-not-synced was the correct parameter for go-kaspad, it's changed in rk to --enable-unsynced-mining

--testnet Use testnet instead of mainnet [default: false]
-V, --version Prints version information

Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let protowire_files = &["proto/messages.proto", "proto/rpc.proto", "proto/p2p.proto"];
let protowire_files = &["proto/messages.proto", "proto/rpc.proto"];
let dirs = &["proto"];

println!("cargo:rerun-if-changed=proto");
Expand Down
190 changes: 98 additions & 92 deletions proto/messages.proto
Original file line number Diff line number Diff line change
@@ -1,136 +1,142 @@
syntax = "proto3";
package protowire;

option go_package = "github.com/kaspanet/kaspad/protowire";

import "p2p.proto";
import "rpc.proto";

message KaspadMessage {
message KaspadRequest {
uint64 id = 101;
oneof payload {
AddressesMessage addresses = 1;
BlockMessage block = 2;
TransactionMessage transaction = 3;
BlockLocatorMessage blockLocator = 5;
RequestAddressesMessage requestAddresses = 6;
RequestRelayBlocksMessage requestRelayBlocks = 10;
RequestTransactionsMessage requestTransactions = 12;
BlockMessage ibdBlock = 13;
InvRelayBlockMessage invRelayBlock = 14;
InvTransactionsMessage invTransactions = 15;
PingMessage ping = 16;
PongMessage pong = 17;
VerackMessage verack = 19;
VersionMessage version = 20;
TransactionNotFoundMessage transactionNotFound = 21;
RejectMessage reject = 22;
PruningPointUtxoSetChunkMessage pruningPointUtxoSetChunk = 25;
RequestIBDBlocksMessage requestIBDBlocks = 26;
UnexpectedPruningPointMessage unexpectedPruningPoint = 27;
IbdBlockLocatorMessage ibdBlockLocator = 30;
IbdBlockLocatorHighestHashMessage ibdBlockLocatorHighestHash = 31;
RequestNextPruningPointUtxoSetChunkMessage requestNextPruningPointUtxoSetChunk = 33;
DonePruningPointUtxoSetChunksMessage donePruningPointUtxoSetChunks = 34;
IbdBlockLocatorHighestHashNotFoundMessage ibdBlockLocatorHighestHashNotFound = 35;
BlockWithTrustedDataMessage blockWithTrustedData = 36;
DoneBlocksWithTrustedDataMessage doneBlocksWithTrustedData = 37;
RequestPruningPointAndItsAnticoneMessage requestPruningPointAndItsAnticone = 40;
BlockHeadersMessage blockHeaders = 41;
RequestNextHeadersMessage requestNextHeaders = 42;
DoneHeadersMessage DoneHeaders = 43;
RequestPruningPointUTXOSetMessage requestPruningPointUTXOSet = 44;
RequestHeadersMessage requestHeaders = 45;
RequestBlockLocatorMessage requestBlockLocator = 46;
PruningPointsMessage pruningPoints = 47;
RequestPruningPointProofMessage requestPruningPointProof = 48;
PruningPointProofMessage pruningPointProof = 49;

GetCurrentNetworkRequestMessage getCurrentNetworkRequest = 1001;
GetCurrentNetworkResponseMessage getCurrentNetworkResponse = 1002;
SubmitBlockRequestMessage submitBlockRequest = 1003;
SubmitBlockResponseMessage submitBlockResponse = 1004;
GetBlockTemplateRequestMessage getBlockTemplateRequest = 1005;
GetBlockTemplateResponseMessage getBlockTemplateResponse = 1006;
NotifyBlockAddedRequestMessage notifyBlockAddedRequest = 1007;
// BlockAddedNotificationMessage blockAddedNotification = 1009;
GetPeerAddressesRequestMessage getPeerAddressesRequest = 1010;
GetSinkRequestMessage GetSinkRequest = 1012;
GetMempoolEntryRequestMessage getMempoolEntryRequest = 1014;
GetConnectedPeerInfoRequestMessage getConnectedPeerInfoRequest = 1016;
AddPeerRequestMessage addPeerRequest = 1018;
SubmitTransactionRequestMessage submitTransactionRequest = 1020;
NotifyVirtualChainChangedRequestMessage notifyVirtualChainChangedRequest = 1022;
// VirtualChainChangedNotificationMessage virtualChainChangedNotification = 1024;
GetBlockRequestMessage getBlockRequest = 1025;
GetSubnetworkRequestMessage getSubnetworkRequest = 1027;
GetVirtualChainFromBlockRequestMessage getVirtualChainFromBlockRequest = 1029;
GetBlocksRequestMessage getBlocksRequest = 1031;
GetBlockCountRequestMessage getBlockCountRequest = 1033;
GetBlockDagInfoRequestMessage getBlockDagInfoRequest = 1035;
ResolveFinalityConflictRequestMessage resolveFinalityConflictRequest = 1037;
NotifyFinalityConflictRequestMessage notifyFinalityConflictRequest = 1039;
// FinalityConflictNotificationMessage finalityConflictNotification = 1041;
// FinalityConflictResolvedNotificationMessage finalityConflictResolvedNotification = 1042;
GetMempoolEntriesRequestMessage getMempoolEntriesRequest = 1043;
ShutdownRequestMessage shutdownRequest = 1045;
GetHeadersRequestMessage getHeadersRequest = 1047;
NotifyUtxosChangedRequestMessage notifyUtxosChangedRequest = 1049;
// UtxosChangedNotificationMessage utxosChangedNotification = 1051;
GetUtxosByAddressesRequestMessage getUtxosByAddressesRequest = 1052;
GetSinkBlueScoreRequestMessage getSinkBlueScoreRequest = 1054;
NotifySinkBlueScoreChangedRequestMessage notifySinkBlueScoreChangedRequest = 1056;
// SinkBlueScoreChangedNotificationMessage sinkBlueScoreChangedNotification = 1058;
BanRequestMessage banRequest = 1059;
UnbanRequestMessage unbanRequest = 1061;
GetInfoRequestMessage getInfoRequest = 1063;
StopNotifyingUtxosChangedRequestMessage stopNotifyingUtxosChangedRequest = 1065;
NotifyPruningPointUtxoSetOverrideRequestMessage notifyPruningPointUtxoSetOverrideRequest = 1067;
// PruningPointUtxoSetOverrideNotificationMessage pruningPointUtxoSetOverrideNotification = 1069;
StopNotifyingPruningPointUtxoSetOverrideRequestMessage stopNotifyingPruningPointUtxoSetOverrideRequest = 1070;
EstimateNetworkHashesPerSecondRequestMessage estimateNetworkHashesPerSecondRequest = 1072;
NotifyVirtualDaaScoreChangedRequestMessage notifyVirtualDaaScoreChangedRequest = 1074;
// VirtualDaaScoreChangedNotificationMessage virtualDaaScoreChangedNotification = 1076;
GetBalanceByAddressRequestMessage getBalanceByAddressRequest = 1077;
GetBalancesByAddressesRequestMessage getBalancesByAddressesRequest = 1079;
NotifyNewBlockTemplateRequestMessage notifyNewBlockTemplateRequest = 1081;
// NewBlockTemplateNotificationMessage newBlockTemplateNotification = 1083;
GetMempoolEntriesByAddressesRequestMessage getMempoolEntriesByAddressesRequest = 1084;
GetCoinSupplyRequestMessage getCoinSupplyRequest = 1086;
PingRequestMessage pingRequest = 1088;
GetMetricsRequestMessage getMetricsRequest = 1090;
GetServerInfoRequestMessage getServerInfoRequest = 1092;
GetSyncStatusRequestMessage getSyncStatusRequest = 1094;
GetDaaScoreTimestampEstimateRequestMessage getDaaScoreTimestampEstimateRequest = 1096;
SubmitTransactionReplacementRequestMessage submitTransactionReplacementRequest = 1100;
GetConnectionsRequestMessage getConnectionsRequest = 1102;
GetSystemInfoRequestMessage getSystemInfoRequest = 1104;
GetFeeEstimateRequestMessage getFeeEstimateRequest = 1106;
GetFeeEstimateExperimentalRequestMessage getFeeEstimateExperimentalRequest = 1108;
GetCurrentBlockColorRequestMessage getCurrentBlockColorRequest = 1110;
GetUtxoReturnAddressRequestMessage getUtxoReturnAddressRequest = 1112;
GetVirtualChainFromBlockV2RequestMessage getVirtualChainFromBlockV2Request = 1114;
}
}

message KaspadResponse {
uint64 id = 101;
oneof payload {
GetCurrentNetworkResponseMessage getCurrentNetworkResponse = 1002;
SubmitBlockResponseMessage submitBlockResponse = 1004;
GetBlockTemplateResponseMessage getBlockTemplateResponse = 1006;
NotifyBlockAddedResponseMessage notifyBlockAddedResponse = 1008;
BlockAddedNotificationMessage blockAddedNotification = 1009;
GetPeerAddressesRequestMessage getPeerAddressesRequest = 1010;
GetPeerAddressesResponseMessage getPeerAddressesResponse = 1011;
GetSelectedTipHashRequestMessage getSelectedTipHashRequest = 1012;
GetSelectedTipHashResponseMessage getSelectedTipHashResponse = 1013;
GetMempoolEntryRequestMessage getMempoolEntryRequest = 1014;
GetSinkResponseMessage GetSinkResponse = 1013;
GetMempoolEntryResponseMessage getMempoolEntryResponse = 1015;
GetConnectedPeerInfoRequestMessage getConnectedPeerInfoRequest = 1016;
GetConnectedPeerInfoResponseMessage getConnectedPeerInfoResponse = 1017;
AddPeerRequestMessage addPeerRequest = 1018;
AddPeerResponseMessage addPeerResponse = 1019;
SubmitTransactionRequestMessage submitTransactionRequest = 1020;
SubmitTransactionResponseMessage submitTransactionResponse = 1021;
NotifyVirtualSelectedParentChainChangedRequestMessage notifyVirtualSelectedParentChainChangedRequest = 1022;
NotifyVirtualSelectedParentChainChangedResponseMessage notifyVirtualSelectedParentChainChangedResponse = 1023;
VirtualSelectedParentChainChangedNotificationMessage virtualSelectedParentChainChangedNotification = 1024;
GetBlockRequestMessage getBlockRequest = 1025;
NotifyVirtualChainChangedResponseMessage notifyVirtualChainChangedResponse = 1023;
VirtualChainChangedNotificationMessage virtualChainChangedNotification = 1024;
GetBlockResponseMessage getBlockResponse = 1026;
GetSubnetworkRequestMessage getSubnetworkRequest = 1027;
GetSubnetworkResponseMessage getSubnetworkResponse = 1028;
GetVirtualSelectedParentChainFromBlockRequestMessage getVirtualSelectedParentChainFromBlockRequest = 1029;
GetVirtualSelectedParentChainFromBlockResponseMessage getVirtualSelectedParentChainFromBlockResponse = 1030;
GetBlocksRequestMessage getBlocksRequest = 1031;
GetVirtualChainFromBlockResponseMessage getVirtualChainFromBlockResponse = 1030;
GetBlocksResponseMessage getBlocksResponse = 1032;
GetBlockCountRequestMessage getBlockCountRequest = 1033;
GetBlockCountResponseMessage getBlockCountResponse = 1034;
GetBlockDagInfoRequestMessage getBlockDagInfoRequest = 1035;
GetBlockDagInfoResponseMessage getBlockDagInfoResponse = 1036;
ResolveFinalityConflictRequestMessage resolveFinalityConflictRequest = 1037;
ResolveFinalityConflictResponseMessage resolveFinalityConflictResponse = 1038;
NotifyFinalityConflictsRequestMessage notifyFinalityConflictsRequest = 1039;
NotifyFinalityConflictsResponseMessage notifyFinalityConflictsResponse = 1040;
NotifyFinalityConflictResponseMessage notifyFinalityConflictResponse = 1040;
FinalityConflictNotificationMessage finalityConflictNotification = 1041;
FinalityConflictResolvedNotificationMessage finalityConflictResolvedNotification = 1042;
GetMempoolEntriesRequestMessage getMempoolEntriesRequest = 1043;
GetMempoolEntriesResponseMessage getMempoolEntriesResponse = 1044;
ShutDownRequestMessage shutDownRequest = 1045;
ShutDownResponseMessage shutDownResponse = 1046;
GetHeadersRequestMessage getHeadersRequest = 1047;
ShutdownResponseMessage shutdownResponse = 1046;
GetHeadersResponseMessage getHeadersResponse = 1048;
NotifyUtxosChangedRequestMessage notifyUtxosChangedRequest = 1049;
NotifyUtxosChangedResponseMessage notifyUtxosChangedResponse = 1050;
UtxosChangedNotificationMessage utxosChangedNotification = 1051;
GetUtxosByAddressesRequestMessage getUtxosByAddressesRequest = 1052;
GetUtxosByAddressesResponseMessage getUtxosByAddressesResponse = 1053;
GetVirtualSelectedParentBlueScoreRequestMessage getVirtualSelectedParentBlueScoreRequest = 1054;
GetVirtualSelectedParentBlueScoreResponseMessage getVirtualSelectedParentBlueScoreResponse = 1055;
NotifyVirtualSelectedParentBlueScoreChangedRequestMessage notifyVirtualSelectedParentBlueScoreChangedRequest = 1056;
NotifyVirtualSelectedParentBlueScoreChangedResponseMessage notifyVirtualSelectedParentBlueScoreChangedResponse = 1057;
VirtualSelectedParentBlueScoreChangedNotificationMessage virtualSelectedParentBlueScoreChangedNotification = 1058;
BanRequestMessage banRequest = 1059;
GetSinkBlueScoreResponseMessage getSinkBlueScoreResponse = 1055;
NotifySinkBlueScoreChangedResponseMessage notifySinkBlueScoreChangedResponse = 1057;
SinkBlueScoreChangedNotificationMessage sinkBlueScoreChangedNotification = 1058;
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;
NotifyPruningPointUtxoSetOverrideResponseMessage notifyPruningPointUtxoSetOverrideResponse = 1068;
PruningPointUtxoSetOverrideNotificationMessage pruningPointUtxoSetOverrideNotification = 1069;
StopNotifyingPruningPointUtxoSetOverrideResponseMessage stopNotifyingPruningPointUtxoSetOverrideResponse = 1071;
EstimateNetworkHashesPerSecondResponseMessage estimateNetworkHashesPerSecondResponse = 1073;
NotifyVirtualDaaScoreChangedRequestMessage notifyVirtualDaaScoreChangedRequest = 1074;
NotifyVirtualDaaScoreChangedResponseMessage notifyVirtualDaaScoreChangedResponse = 1075;
VirtualDaaScoreChangedNotificationMessage virtualDaaScoreChangedNotification = 1076;
NotifyNewBlockTemplateRequestMessage notifyNewBlockTemplateRequest = 1081;
GetBalanceByAddressResponseMessage getBalanceByAddressResponse = 1078;
GetBalancesByAddressesResponseMessage getBalancesByAddressesResponse = 1080;
NotifyNewBlockTemplateResponseMessage notifyNewBlockTemplateResponse = 1082;
NewBlockTemplateNotificationMessage newBlockTemplateNotification = 1083;
GetMempoolEntriesByAddressesResponseMessage getMempoolEntriesByAddressesResponse = 1085;
GetCoinSupplyResponseMessage getCoinSupplyResponse= 1087;
PingResponseMessage pingResponse= 1089;
GetMetricsResponseMessage getMetricsResponse= 1091;
GetServerInfoResponseMessage getServerInfoResponse = 1093;
GetSyncStatusResponseMessage getSyncStatusResponse = 1095;
GetDaaScoreTimestampEstimateResponseMessage getDaaScoreTimestampEstimateResponse = 1097;
SubmitTransactionReplacementResponseMessage submitTransactionReplacementResponse = 1101;
GetConnectionsResponseMessage getConnectionsResponse= 1103;
GetSystemInfoResponseMessage getSystemInfoResponse= 1105;
GetFeeEstimateResponseMessage getFeeEstimateResponse = 1107;
GetFeeEstimateExperimentalResponseMessage getFeeEstimateExperimentalResponse = 1109;
GetCurrentBlockColorResponseMessage getCurrentBlockColorResponse = 1111;
GetUtxoReturnAddressResponseMessage getUtxoReturnAddressResponse = 1113;
GetVirtualChainFromBlockV2ResponseMessage getVirtualChainFromBlockV2Response = 1115;
}
}

service P2P {
rpc MessageStream (stream KaspadMessage) returns (stream KaspadMessage) {}
}

service RPC {
rpc MessageStream (stream KaspadMessage) returns (stream KaspadMessage) {}
rpc MessageStream (stream KaspadRequest) returns (stream KaspadResponse) {}
}
Loading