You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
46 lines
1.0 KiB
syntax = "proto3";
|
|
|
|
package downloader;
|
|
|
|
// Downloader is the service used for downloading/sycning blocks.
|
|
service Downloader {
|
|
rpc Query(DownloaderRequest) returns (DownloaderResponse) {}
|
|
}
|
|
|
|
// DownloaderRequest is the generic download request.
|
|
message DownloaderRequest {
|
|
enum RequestType {
|
|
HEADER = 0;
|
|
BLOCK = 1;
|
|
NEWBLOCK = 2;
|
|
BLOCKHEIGHT = 3;
|
|
REGISTER = 4;
|
|
REGISTERTIMEOUT = 5;
|
|
UNKNOWN = 6;
|
|
}
|
|
|
|
// Request type.
|
|
RequestType type = 1;
|
|
|
|
// The hashes of the blocks we want to download.
|
|
repeated bytes hashes = 2;
|
|
bytes peerHash = 3;
|
|
bytes blockHash = 4;
|
|
string ip = 5;
|
|
string port = 6;
|
|
uint32 size = 7;
|
|
}
|
|
|
|
// DownloaderResponse is the generic response of DownloaderRequest.
|
|
message DownloaderResponse {
|
|
enum RegisterResponseType {
|
|
SUCCESS = 0;
|
|
FAIL = 1;
|
|
INSYNC = 2; // node is now in sync, remove it from the broadcast list
|
|
}
|
|
// payload of Block.
|
|
repeated bytes payload = 1;
|
|
// response of registration request
|
|
RegisterResponseType type = 2;
|
|
uint64 blockHeight = 3;
|
|
}
|
|
|