-
Notifications
You must be signed in to change notification settings - Fork 188
/
Copy pathrpc.proto
987 lines (810 loc) · 25.7 KB
/
rpc.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
// RPC-related types. Request messages, response messages, and dependant types.
//
// 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.
//
//
syntax = "proto3";
package protowire;
// RPCError represents a generic non-internal error.
//
// Receivers of any ResponseMessage are expected to check whether its error field is not null.
message RPCError{
string message = 1;
}
message RpcBlock {
RpcBlockHeader header = 1;
repeated RpcTransaction transactions = 2;
RpcBlockVerboseData verboseData = 3;
}
message RpcBlockHeader {
uint32 version = 1;
repeated RpcBlockLevelParents parents = 12;
string hashMerkleRoot = 3;
string acceptedIdMerkleRoot = 4;
string utxoCommitment = 5;
int64 timestamp = 6;
uint32 bits = 7;
uint64 nonce = 8;
uint64 daaScore = 9;
string blueWork = 10;
string pruningPoint = 14;
uint64 blueScore = 13;
}
message RpcBlockLevelParents {
repeated string parentHashes = 1;
}
message RpcBlockVerboseData{
string hash = 1;
double difficulty = 11;
string selectedParentHash = 13;
repeated string transactionIds = 14;
bool isHeaderOnly = 15;
uint64 blueScore = 16;
repeated string childrenHashes = 17;
repeated string mergeSetBluesHashes = 18;
repeated string mergeSetRedsHashes = 19;
bool isChainBlock = 20;
}
message RpcTransaction {
uint32 version = 1;
repeated RpcTransactionInput inputs = 2;
repeated RpcTransactionOutput outputs = 3;
uint64 lockTime = 4;
string subnetworkId = 5;
uint64 gas = 6;
string payload = 8;
RpcTransactionVerboseData verboseData = 9;
uint64 mass = 10;
}
message RpcTransactionInput {
RpcOutpoint previousOutpoint = 1;
string signatureScript = 2;
uint64 sequence = 3;
uint32 sigOpCount = 5;
RpcTransactionInputVerboseData verboseData = 4;
}
message RpcScriptPublicKey {
uint32 version = 1;
string scriptPublicKey = 2;
}
message RpcTransactionOutput {
uint64 amount = 1;
RpcScriptPublicKey scriptPublicKey = 2;
RpcTransactionOutputVerboseData verboseData = 3;
}
message RpcOutpoint {
string transactionId = 1;
uint32 index = 2;
}
message RpcUtxoEntry {
uint64 amount = 1;
RpcScriptPublicKey scriptPublicKey = 2;
uint64 blockDaaScore = 3;
bool isCoinbase = 4;
}
message RpcTransactionVerboseData{
string transactionId = 1;
string hash = 2;
uint64 computeMass = 4;
string blockHash = 12;
uint64 blockTime = 14;
}
message RpcTransactionInputVerboseData{
}
message RpcTransactionOutputVerboseData{
string scriptPublicKeyType = 5;
string scriptPublicKeyAddress = 6;
}
enum RpcNotifyCommand {
NOTIFY_START = 0;
NOTIFY_STOP = 1;
}
// GetCurrentNetworkRequestMessage requests the network kaspad is currently running against.
//
// Possible networks are: Mainnet, Testnet, Simnet, Devnet
message GetCurrentNetworkRequestMessage{
}
message GetCurrentNetworkResponseMessage{
string currentNetwork = 1;
RPCError error = 1000;
}
// SubmitBlockRequestMessage requests to submit a block into the DAG.
// Blocks are generally expected to have been generated using the getBlockTemplate call.
//
// See: GetBlockTemplateRequestMessage
message SubmitBlockRequestMessage{
RpcBlock block = 2;
bool allowNonDAABlocks = 3;
}
message SubmitBlockResponseMessage{
enum RejectReason {
NONE = 0;
BLOCK_INVALID = 1;
IS_IN_IBD = 2;
}
RejectReason rejectReason = 1;
RPCError error = 1000;
}
// GetBlockTemplateRequestMessage requests a current block template.
// Callers are expected to solve the block template and submit it using the submitBlock call
//
// See: SubmitBlockRequestMessage
message GetBlockTemplateRequestMessage{
// Which kaspa address should the coinbase block reward transaction pay into
string payAddress = 1;
string extraData = 2;
}
message GetBlockTemplateResponseMessage{
RpcBlock block = 3;
// 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.
bool isSynced = 2;
RPCError error = 1000;
}
// NotifyBlockAddedRequestMessage registers this connection for blockAdded notifications.
//
// See: BlockAddedNotificationMessage
message NotifyBlockAddedRequestMessage{
RpcNotifyCommand command = 101;
}
message NotifyBlockAddedResponseMessage{
RPCError error = 1000;
}
// BlockAddedNotificationMessage is sent whenever a blocks has been added (NOT accepted)
// into the DAG.
//
// See: NotifyBlockAddedRequestMessage
message BlockAddedNotificationMessage{
RpcBlock block = 3;
}
// GetPeerAddressesRequestMessage requests the list of known kaspad addresses in the
// current network. (mainnet, testnet, etc.)
message GetPeerAddressesRequestMessage{
}
message GetPeerAddressesResponseMessage{
repeated GetPeerAddressesKnownAddressMessage addresses = 1;
repeated GetPeerAddressesKnownAddressMessage bannedAddresses = 2;
RPCError error = 1000;
}
message GetPeerAddressesKnownAddressMessage {
string Addr = 1;
}
// GetSinkRequestMessage requests the hash of the current virtual's
// selected parent.
message GetSinkRequestMessage{
}
message GetSinkResponseMessage{
string sink = 1;
RPCError error = 1000;
}
// GetMempoolEntryRequestMessage requests information about a specific transaction
// in the mempool.
message GetMempoolEntryRequestMessage{
// The transaction's TransactionID.
string txId = 1;
bool includeOrphanPool = 2;
bool filterTransactionPool = 3;
}
message GetMempoolEntryResponseMessage{
RpcMempoolEntry entry = 1;
RPCError error = 1000;
}
// GetMempoolEntriesRequestMessage requests information about all the transactions
// currently in the mempool.
message GetMempoolEntriesRequestMessage{
bool includeOrphanPool = 1;
bool filterTransactionPool = 2;
}
message GetMempoolEntriesResponseMessage{
repeated RpcMempoolEntry entries = 1;
RPCError error = 1000;
}
message RpcMempoolEntry{
uint64 fee = 1;
RpcTransaction transaction = 3;
bool isOrphan = 4;
}
// GetConnectedPeerInfoRequestMessage requests information about all the p2p peers
// currently connected to this kaspad.
message GetConnectedPeerInfoRequestMessage{
}
message GetConnectedPeerInfoResponseMessage{
repeated GetConnectedPeerInfoMessage infos = 1;
RPCError error = 1000;
}
message GetConnectedPeerInfoMessage{
string id = 1;
string address = 2;
// How long did the last ping/pong exchange take
int64 lastPingDuration = 3;
// Whether this kaspad initiated the connection
bool isOutbound = 6;
int64 timeOffset = 7;
string userAgent = 8;
// The protocol version that this peer claims to support
uint32 advertisedProtocolVersion = 9;
// The timestamp of when this peer connected to this kaspad
int64 timeConnected = 10;
// Whether this peer is the IBD peer (if IBD is running)
bool isIbdPeer = 11;
}
// AddPeerRequestMessage adds a peer to kaspad's outgoing connection list.
// This will, in most cases, result in kaspad connecting to said peer.
message AddPeerRequestMessage{
string address = 1;
// Whether to keep attempting to connect to this peer after disconnection
bool isPermanent = 2;
}
message AddPeerResponseMessage{
RPCError error = 1000;
}
// SubmitTransactionRequestMessage submits a transaction to the mempool
message SubmitTransactionRequestMessage{
RpcTransaction transaction = 1;
bool allowOrphan = 2;
}
message SubmitTransactionResponseMessage{
// The transaction ID of the submitted transaction
string transactionId = 1;
RPCError error = 1000;
}
// SubmitTransactionReplacementRequestMessage submits a transaction to the mempool, applying a mandatory Replace by Fee policy
message SubmitTransactionReplacementRequestMessage{
RpcTransaction transaction = 1;
}
message SubmitTransactionReplacementResponseMessage{
// The transaction ID of the submitted transaction
string transactionId = 1;
// The previous transaction replaced in the mempool by the newly submitted one
RpcTransaction replacedTransaction = 2;
RPCError error = 1000;
}
// NotifyVirtualChainChangedRequestMessage registers this connection for virtualChainChanged notifications.
//
// See: VirtualChainChangedNotificationMessage
message NotifyVirtualChainChangedRequestMessage{
bool includeAcceptedTransactionIds = 1;
RpcNotifyCommand command = 101;
}
message NotifyVirtualChainChangedResponseMessage{
RPCError error = 1000;
}
// VirtualChainChangedNotificationMessage is sent whenever the DAG's selected parent
// chain had changed.
//
// See: NotifyVirtualChainChangedRequestMessage
message VirtualChainChangedNotificationMessage{
// The chain blocks that were removed, in high-to-low order
repeated string removedChainBlockHashes = 1;
// The chain blocks that were added, in low-to-high order
repeated string addedChainBlockHashes = 3;
// Will be filled only if `includeAcceptedTransactionIds = true` in the notify request.
repeated RpcAcceptedTransactionIds acceptedTransactionIds = 2;
}
// GetBlockRequestMessage requests information about a specific block
message GetBlockRequestMessage{
// The hash of the requested block
string hash = 1;
// Whether to include transaction data in the response
bool includeTransactions = 3;
}
message GetBlockResponseMessage{
RpcBlock block = 3;
RPCError error = 1000;
}
// GetSubnetworkRequestMessage requests information about a specific subnetwork
//
// Currently unimplemented
message GetSubnetworkRequestMessage{
string subnetworkId = 1;
}
message GetSubnetworkResponseMessage{
uint64 gasLimit = 1;
RPCError error = 1000;
}
/// GetVirtualChainFromBlockRequestMessage requests the virtual selected
/// parent chain from some startHash to this kaspad's current virtual
/// Note:
/// this call batches the response to:
/// a. the network's `mergeset size limit * 10` amount of added chain blocks, if `includeAcceptedTransactionIds = false`
/// b. or `mergeset size limit * 10` amount of merged blocks, if `includeAcceptedTransactionIds = true`
/// c. it does not batch the removed chain blocks, only the added ones.
message GetVirtualChainFromBlockRequestMessage{
string startHash = 1;
bool includeAcceptedTransactionIds = 2;
}
message RpcAcceptedTransactionIds{
string acceptingBlockHash = 1;
repeated string acceptedTransactionIds = 2;
}
message GetVirtualChainFromBlockResponseMessage{
// The chain blocks that were removed, in high-to-low order
repeated string removedChainBlockHashes = 1;
// The chain blocks that were added, in low-to-high order
repeated string addedChainBlockHashes = 3;
// The transactions accepted by each block in addedChainBlockHashes.
// Will be filled only if `includeAcceptedTransactionIds = true` in the request.
repeated RpcAcceptedTransactionIds acceptedTransactionIds = 2;
RPCError error = 1000;
}
// GetBlocksRequestMessage requests blocks between a certain block lowHash up to this
// kaspad's current virtual.
message GetBlocksRequestMessage{
string lowHash = 1;
bool includeBlocks = 2;
bool includeTransactions = 3;
}
message GetBlocksResponseMessage{
repeated string blockHashes = 4;
repeated RpcBlock blocks = 3;
RPCError error = 1000;
}
// GetBlockCountRequestMessage requests the current number of blocks in this kaspad.
// Note that this number may decrease as pruning occurs.
message GetBlockCountRequestMessage{
}
message GetBlockCountResponseMessage{
uint64 blockCount = 1;
uint64 headerCount = 2;
RPCError error = 1000;
}
// GetBlockDagInfoRequestMessage requests general information about the current state
// of this kaspad's DAG.
message GetBlockDagInfoRequestMessage{
}
message GetBlockDagInfoResponseMessage{
string networkName = 1;
uint64 blockCount = 2;
uint64 headerCount = 3;
repeated string tipHashes = 4;
double difficulty = 5;
int64 pastMedianTime = 6;
repeated string virtualParentHashes = 7;
string pruningPointHash = 8;
uint64 virtualDaaScore = 9;
string sink = 10;
RPCError error = 1000;
}
message ResolveFinalityConflictRequestMessage{
string finalityBlockHash = 1;
}
message ResolveFinalityConflictResponseMessage{
RPCError error = 1000;
}
message NotifyFinalityConflictRequestMessage{
RpcNotifyCommand command = 101;
}
message NotifyFinalityConflictResponseMessage{
RPCError error = 1000;
}
message FinalityConflictNotificationMessage{
string violatingBlockHash = 1;
}
message FinalityConflictResolvedNotificationMessage{
string finalityBlockHash = 1;
}
// ShutdownRequestMessage shuts down this kaspad.
message ShutdownRequestMessage{
}
message ShutdownResponseMessage{
RPCError error = 1000;
}
// GetHeadersRequestMessage requests headers between the given startHash and the
// current virtual, up to the given limit.
message GetHeadersRequestMessage{
string startHash = 1;
uint64 limit = 2;
bool isAscending = 3;
}
message GetHeadersResponseMessage{
repeated string headers = 1;
RPCError error = 1000;
}
// NotifyUtxosChangedRequestMessage registers this connection for utxoChanged notifications
// for the given addresses.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
// See: UtxosChangedNotificationMessage
message NotifyUtxosChangedRequestMessage {
// UTXOs addresses to start/stop getting notified about
// Leave empty to start/stop all updates
repeated string addresses = 1;
RpcNotifyCommand command = 101;
}
message NotifyUtxosChangedResponseMessage {
RPCError error = 1000;
}
// UtxosChangedNotificationMessage is sent whenever the UTXO index had been updated.
//
// See: NotifyUtxosChangedRequestMessage
message UtxosChangedNotificationMessage {
repeated RpcUtxosByAddressesEntry added = 1;
repeated RpcUtxosByAddressesEntry removed = 2;
}
message RpcUtxosByAddressesEntry {
string address = 1;
RpcOutpoint outpoint = 2;
RpcUtxoEntry utxoEntry = 3;
}
// StopNotifyingUtxosChangedRequestMessage unregisters this connection for utxoChanged notifications
// for the given addresses.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
// See: UtxosChangedNotificationMessage
//
// This message only exists for backward compatibility reason with kaspad and is deprecated.
// Use instead UtxosChangedNotificationMessage with command = NOTIFY_STOP.
message StopNotifyingUtxosChangedRequestMessage {
repeated string addresses = 1;
}
message StopNotifyingUtxosChangedResponseMessage {
RPCError error = 1000;
}
// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given kaspad addresses
//
// This call is only available when this kaspad was started with `--utxoindex`
message GetUtxosByAddressesRequestMessage {
repeated string addresses = 1;
}
message GetUtxosByAddressesResponseMessage {
repeated RpcUtxosByAddressesEntry entries = 1;
RPCError error = 1000;
}
// GetBalanceByAddressRequest returns the total balance in unspent transactions towards a given address
//
// This call is only available when this kaspad was started with `--utxoindex`
message GetBalanceByAddressRequestMessage {
string address = 1;
}
message GetBalanceByAddressResponseMessage {
uint64 balance = 1;
RPCError error = 1000;
}
message GetBalancesByAddressesRequestMessage {
repeated string addresses = 1;
}
message RpcBalancesByAddressesEntry{
string address = 1;
uint64 balance = 2;
RPCError error = 1000;
}
message GetBalancesByAddressesResponseMessage {
repeated RpcBalancesByAddressesEntry entries = 1;
RPCError error = 1000;
}
// GetSinkBlueScoreRequestMessage requests the blue score of the current selected parent
// of the virtual block.
message GetSinkBlueScoreRequestMessage {
}
message GetSinkBlueScoreResponseMessage {
uint64 blueScore = 1;
RPCError error = 1000;
}
// NotifySinkBlueScoreChangedRequestMessage registers this connection for
// sinkBlueScoreChanged notifications.
//
// See: SinkBlueScoreChangedNotificationMessage
message NotifySinkBlueScoreChangedRequestMessage {
RpcNotifyCommand command = 101;
}
message NotifySinkBlueScoreChangedResponseMessage {
RPCError error = 1000;
}
// SinkBlueScoreChangedNotificationMessage is sent whenever the blue score
// of the virtual's selected parent changes.
//
// See NotifySinkBlueScoreChangedRequestMessage
message SinkBlueScoreChangedNotificationMessage {
uint64 sinkBlueScore = 1;
}
// NotifyVirtualDaaScoreChangedRequestMessage registers this connection for
// virtualDaaScoreChanged notifications.
//
// See: VirtualDaaScoreChangedNotificationMessage
message NotifyVirtualDaaScoreChangedRequestMessage {
RpcNotifyCommand command = 101;
}
message NotifyVirtualDaaScoreChangedResponseMessage {
RPCError error = 1000;
}
// VirtualDaaScoreChangedNotificationMessage is sent whenever the DAA score
// of the virtual changes.
//
// See NotifyVirtualDaaScoreChangedRequestMessage
message VirtualDaaScoreChangedNotificationMessage {
uint64 virtualDaaScore = 1;
}
// NotifyPruningPointUtxoSetOverrideRequestMessage registers this connection for
// pruning point UTXO set override notifications.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
// See: NotifyPruningPointUtxoSetOverrideResponseMessage
message NotifyPruningPointUtxoSetOverrideRequestMessage {
RpcNotifyCommand command = 101;
}
message NotifyPruningPointUtxoSetOverrideResponseMessage {
RPCError error = 1000;
}
// PruningPointUtxoSetOverrideNotificationMessage is sent whenever the UTXO index
// resets due to pruning point change via IBD.
//
// See NotifyPruningPointUtxoSetOverrideRequestMessage
message PruningPointUtxoSetOverrideNotificationMessage {
}
// StopNotifyingPruningPointUtxoSetOverrideRequestMessage unregisters this connection for
// pruning point UTXO set override notifications.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
// See: PruningPointUtxoSetOverrideNotificationMessage
//
// This message only exists for backward compatibility reason with kaspad and is deprecated.
// Use instead NotifyPruningPointUtxoSetOverrideRequestMessage with command = NOTIFY_STOP.
message StopNotifyingPruningPointUtxoSetOverrideRequestMessage {
}
message StopNotifyingPruningPointUtxoSetOverrideResponseMessage {
RPCError error = 1000;
}
// BanRequestMessage bans the given ip.
message BanRequestMessage{
string ip = 1;
}
message BanResponseMessage{
RPCError error = 1000;
}
// UnbanRequestMessage unbans the given ip.
message UnbanRequestMessage{
string ip = 1;
}
message UnbanResponseMessage{
RPCError error = 1000;
}
// GetInfoRequestMessage returns info about the node.
message GetInfoRequestMessage{
}
message GetInfoResponseMessage{
string p2pId = 1;
uint64 mempoolSize = 2;
string serverVersion = 3;
bool isUtxoIndexed = 4;
bool isSynced = 5;
repeated string namespaces = 6;
bool hasNotifyCommand = 11;
bool hasMessageId = 12;
RPCError error = 1000;
}
message EstimateNetworkHashesPerSecondRequestMessage{
uint32 windowSize = 1;
string startHash = 2;
}
message EstimateNetworkHashesPerSecondResponseMessage{
uint64 networkHashesPerSecond = 1;
RPCError error = 1000;
}
// NotifyNewBlockTemplateRequestMessage registers this connection for
// NewBlockTemplate notifications.
//
// See: NewBlockTemplateNotificationMessage
message NotifyNewBlockTemplateRequestMessage {
RpcNotifyCommand command = 101;
}
message NotifyNewBlockTemplateResponseMessage {
RPCError error = 1000;
}
// NewBlockTemplateNotificationMessage is sent whenever a new updated block template is
// available for miners.
//
// See NotifyNewBlockTemplateRequestMessage
message NewBlockTemplateNotificationMessage {
}
message RpcMempoolEntryByAddress{
string address = 1;
repeated RpcMempoolEntry sending = 2;
repeated RpcMempoolEntry receiving = 3;
}
message GetMempoolEntriesByAddressesRequestMessage{
repeated string addresses = 1;
bool includeOrphanPool = 2;
bool filterTransactionPool = 3;
}
message GetMempoolEntriesByAddressesResponseMessage{
repeated RpcMempoolEntryByAddress entries = 1;
RPCError error = 1000;
}
message GetCoinSupplyRequestMessage{
}
message GetCoinSupplyResponseMessage{
uint64 maxSompi = 1; // note: this is a hard coded maxSupply, actual maxSupply is expected to deviate by upto -5%, but cannot be measured exactly.
uint64 circulatingSompi = 2;
RPCError error = 1000;
}
message PingRequestMessage{
}
message PingResponseMessage{
RPCError error = 1000;
}
message ProcessMetrics{
uint64 residentSetSize = 1;
uint64 virtualMemorySize = 2;
uint32 coreNum = 3;
float cpuUsage = 4;
uint32 fdNum = 5;
uint64 diskIoReadBytes = 6;
uint64 diskIoWriteBytes = 7;
float diskIoReadPerSec = 8;
float diskIoWritePerSec = 9;
}
message ConnectionMetrics {
uint32 borshLiveConnections = 31;
uint64 borshConnectionAttempts = 32;
uint64 borshHandshakeFailures = 33;
uint32 jsonLiveConnections = 41;
uint64 jsonConnectionAttempts = 42;
uint64 jsonHandshakeFailures = 43;
uint32 activePeers = 51;
}
message BandwidthMetrics {
uint64 borshBytesTx = 61;
uint64 borshBytesRx = 62;
uint64 jsonBytesTx = 63;
uint64 jsonBytesRx = 64;
uint64 grpcP2pBytesTx = 65;
uint64 grpcP2pBytesRx = 66;
uint64 grpcUserBytesTx = 67;
uint64 grpcUserBytesRx = 68;
}
message ConsensusMetrics{
uint64 blocksSubmitted = 1;
uint64 headerCounts = 2;
uint64 depCounts = 3;
uint64 bodyCounts = 4;
uint64 txsCounts = 5;
uint64 chainBlockCounts = 6;
uint64 massCounts = 7;
uint64 blockCount = 11;
uint64 headerCount = 12;
uint64 mempoolSize = 13;
uint32 tipHashesCount = 14;
double difficulty = 15;
uint64 pastMedianTime = 16;
uint32 virtualParentHashesCount = 17;
uint64 virtualDaaScore = 18;
}
message StorageMetrics{
uint64 storageSizeBytes = 1;
}
message GetConnectionsRequestMessage{
bool includeProfileData = 1;
}
message ConnectionsProfileData {
double cpuUsage = 1;
uint64 memoryUsage = 2;
}
message GetConnectionsResponseMessage{
uint32 clients = 1;
uint32 peers = 2;
ConnectionsProfileData profileData = 3;
RPCError error = 1000;
}
message GetSystemInfoRequestMessage{
}
message GetSystemInfoResponseMessage{
string version = 1;
string systemId = 2;
string gitHash = 3;
uint32 coreNum = 4;
uint64 totalMemory = 5;
uint32 fdLimit = 6;
uint32 proxySocketLimitPerCpuCore = 7;
RPCError error = 1000;
}
message GetMetricsRequestMessage{
bool processMetrics = 1;
bool connectionMetrics = 2;
bool bandwidthMetrics = 3;
bool consensusMetrics = 4;
bool storageMetrics = 5;
bool customMetrics = 6;
}
message GetMetricsResponseMessage{
uint64 serverTime = 1;
ProcessMetrics processMetrics = 11;
ConnectionMetrics connectionMetrics = 12;
BandwidthMetrics bandwidthMetrics = 13;
ConsensusMetrics consensusMetrics = 14;
StorageMetrics storageMetrics = 15;
RPCError error = 1000;
}
message GetServerInfoRequestMessage{
}
message GetServerInfoResponseMessage{
uint32 rpcApiVersion = 1;
uint32 rpcApiRevision = 2;
string serverVersion = 3;
string networkId = 4;
bool hasUtxoIndex = 5;
bool isSynced = 6;
uint64 virtualDaaScore = 7;
RPCError error = 1000;
}
message GetSyncStatusRequestMessage{
}
message GetSyncStatusResponseMessage{
bool isSynced = 1;
RPCError error = 1000;
}
message GetDaaScoreTimestampEstimateRequestMessage {
repeated uint64 daaScores = 1;
}
message GetDaaScoreTimestampEstimateResponseMessage {
repeated uint64 timestamps = 1;
RPCError error = 1000;
}
message RpcFeerateBucket {
// Fee/mass of a transaction in `sompi/gram` units
double feerate = 1;
double estimatedSeconds = 2;
}
// Data required for making fee estimates.
//
// Feerate values represent fee/mass of a transaction in `sompi/gram` units.
// Given a feerate value recommendation, calculate the required fee by
// taking the transaction mass and multiplying it by feerate: `fee = feerate * mass(tx)`
message RpcFeeEstimate {
// Top-priority feerate bucket. Provides an estimation of the feerate required for sub-second DAG inclusion.
RpcFeerateBucket priorityBucket = 1;
// A vector of *normal* priority feerate values. The first value of this vector is guaranteed to exist and
// provide an estimation for sub-*minute* DAG inclusion. All other values will have shorter estimation
// times than all `lowBucket` values. Therefor by chaining `[priority] | normal | low` and interpolating
// between them, one can compose a complete feerate function on the client side. The API makes an effort
// to sample enough "interesting" points on the feerate-to-time curve, so that the interpolation is meaningful.
repeated RpcFeerateBucket normalBuckets = 2;
// A vector of *low* priority feerate values. The first value of this vector is guaranteed to
// exist and provide an estimation for sub-*hour* DAG inclusion.
repeated RpcFeerateBucket lowBuckets = 3;
}
message RpcFeeEstimateVerboseExperimentalData {
uint64 mempoolReadyTransactionsCount = 1;
uint64 mempoolReadyTransactionsTotalMass = 2;
uint64 networkMassPerSecond = 3;
double nextBlockTemplateFeerateMin = 11;
double nextBlockTemplateFeerateMedian = 12;
double nextBlockTemplateFeerateMax = 13;
}
message GetFeeEstimateRequestMessage {
}
message GetFeeEstimateResponseMessage {
RpcFeeEstimate estimate = 1;
RPCError error = 1000;
}
message GetFeeEstimateExperimentalRequestMessage {
bool verbose = 1;
}
message GetFeeEstimateExperimentalResponseMessage {
RpcFeeEstimate estimate = 1;
RpcFeeEstimateVerboseExperimentalData verbose = 2;
RPCError error = 1000;
}
message GetCurrentBlockColorRequestMessage {
string hash = 1;
}
message GetCurrentBlockColorResponseMessage {
bool blue = 1;
RPCError error = 1000;
}
message GetUtxoReturnAddressRequestMessage {
string txid = 1;
uint64 accepting_block_daa_score = 2;
}
message GetUtxoReturnAddressResponseMessage {
string return_address = 1;
RPCError error = 1000;
}