Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloader: prohibit new downloads #203

Merged
merged 7 commits into from
Dec 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions downloader/downloader.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@ option go_package = "./downloader;downloader";
package downloader;

service Downloader {
rpc Download (DownloadRequest) returns (google.protobuf.Empty) {}
// Erigon "download once" - means restart/upgrade/downgrade will not download files (and will be fast)
// After "download once" - Erigon will produce and seed new files
// Downloader will able: seed new files (already existing on FS), download uncomplete parts of existing files (if Verify found some bad parts)
rpc ProhibitNewDownloads (ProhibitNewDownloadsRequest) returns (google.protobuf.Empty) {}

// Adding new file to downloader: non-existing files it will download, existing - seed
rpc Add (AddRequest) returns (google.protobuf.Empty) {}
rpc Delete (DeleteRequest) returns (google.protobuf.Empty) {}

// Trigger verification of files
// If some part of file is bad - such part will be re-downloaded (without returning error)
rpc Verify (VerifyRequest) returns (google.protobuf.Empty) {}
rpc Stats (StatsRequest) returns (StatsReply) {}
}

// 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 +46,9 @@ message VerifyRequest {
message StatsRequest {
}

message ProhibitNewDownloadsRequest {
}

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