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; REGISTER = 3; REGISTERTIMEOUT = 4; UNKNOWN = 5; } // Request type. RequestType type = 1; // The hashes of the blocks we want to download. repeated bytes hashes = 2; bytes peerHash = 3; bytes blockHash = 4; } // 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; }