mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 06:25:51 +00:00
Proof of work message structures
This commit is contained in:
@@ -5,6 +5,7 @@ enum MessageType {
|
|||||||
mtHELLO = 1;
|
mtHELLO = 1;
|
||||||
mtERROR_MSG = 2;
|
mtERROR_MSG = 2;
|
||||||
mtPING = 3;
|
mtPING = 3;
|
||||||
|
mtPOW = 4;
|
||||||
|
|
||||||
// network presence detection
|
// network presence detection
|
||||||
mtGET_CONTACTS = 10;
|
mtGET_CONTACTS = 10;
|
||||||
@@ -32,8 +33,31 @@ enum MessageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Sent on connect
|
// empty message (or just result) = request proof of work
|
||||||
|
// token, iterations, target, challenge = give proof of work challenge
|
||||||
|
// token, response = show proof of work
|
||||||
|
// token, result = result of pow attempt
|
||||||
|
message TMProofWork
|
||||||
|
{
|
||||||
|
optional string token = 1;
|
||||||
|
optional uint32 iterations = 2;
|
||||||
|
optional bytes target = 3;
|
||||||
|
optional bytes challenge = 4;
|
||||||
|
optional bytes response = 5;
|
||||||
|
|
||||||
|
enum POWResult
|
||||||
|
{
|
||||||
|
powrOK = 0;
|
||||||
|
powrREUSED = 1;
|
||||||
|
powrEXPIRED = 2; // You took too long solving
|
||||||
|
powrTOOEASY = 3; // Difficulty went way up, sorry
|
||||||
|
powrINVALID = 4;
|
||||||
|
powrDISCONNECT = 5; // We are disconnecting
|
||||||
|
}
|
||||||
|
optional POWResult result = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sent on connect
|
||||||
message TMHello {
|
message TMHello {
|
||||||
required uint32 protoVersion = 1;
|
required uint32 protoVersion = 1;
|
||||||
required uint32 protoVersionMin = 2;
|
required uint32 protoVersionMin = 2;
|
||||||
@@ -46,6 +70,7 @@ message TMHello {
|
|||||||
optional bytes ledgerClosed = 9; // our last closed ledger
|
optional bytes ledgerClosed = 9; // our last closed ledger
|
||||||
optional bytes ledgerPrevious = 10; // the ledger before the last closed ledger
|
optional bytes ledgerPrevious = 10; // the ledger before the last closed ledger
|
||||||
optional bool nodePrivate = 11; // Request to not forward IP.
|
optional bool nodePrivate = 11; // Request to not forward IP.
|
||||||
|
optional TMProofWork proofOfWork = 12; // request/provide proof of work
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user