Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Dec 9, 2023
1 parent c86352e commit afcc2ed
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions downloader/downloader.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ option go_package = "./downloader;downloader";
package downloader;

service Downloader {
rpc Download (DownloadRequest) returns (google.protobuf.Empty) {}
// Erigon's invariant: download new files only at first sync cycle. All other files erigon produce by self and seed.
// after this request: downloader will skip all download requests - if corresponding file doesn't exists on FS yet.
// But next things will work: add new file for seeding, download some uncomplete parts of existing files (because of Verify found some bad parts)
rpc ProhibitNewDownloads (ProhibitNewDownloadsRequest) returns (google.protobuf.Empty) {}

rpc Add (AddRequest) returns (google.protobuf.Empty) {}
rpc Delete (DeleteRequest) returns (google.protobuf.Empty) {}
rpc Verify (VerifyRequest) returns (google.protobuf.Empty) {}
rpc Stats (StatsRequest) returns (StatsReply) {}
Expand All @@ -17,12 +22,12 @@ service Downloader {
// DownloadItem:
// - if Erigon created new snapshot and want seed it
// - if Erigon wnat download files - it fills only "torrent_hash" field
message DownloadItem {
message AddItem {
string path = 1;
types.H160 torrent_hash = 2; // will be resolved as magnet link
}
message DownloadRequest {
repeated DownloadItem items = 1; // single hash will be resolved as magnet link
message AddRequest {
repeated AddItem items = 1; // single hash will be resolved as magnet link
}

// DeleteRequest: stop seeding, delete file, delete .torrent
Expand All @@ -37,6 +42,9 @@ message VerifyRequest {
message StatsRequest {
}

message ProhibitNewDownloadsRequest {
}

message StatsReply {
// First step on startup - "resolve metadata":
// - understand total amount of data to download
Expand Down

0 comments on commit afcc2ed

Please sign in to comment.