-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsbf.proto
66 lines (54 loc) · 1.68 KB
/
sbf.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
syntax = "proto3";
package streambigfile;
message BigFileChunk {
// Filepath is just an arbitrary
// name for this file.
string Filepath = 1;
// SizeInBytes should match
// len(Data) exactly.
int64 SizeInBytes = 2;
// According to the sender's clock,
// when did this chunk get put
// on the wire?
fixed64 SendTime = 3;
fixed64 OriginalStartSendTime = 10;
// Blake2B checksum of Data.
bytes Blake2B = 4;
// Cumulative Blake2B of all
// Chunks of the file, up to
// and including this one.
bytes Blake2BCumulative = 5;
// How big can Data be? I
// recommend no more than 1MB.
// I suggest 1MB chunking to be
// on the safe side. Above
// 2MB, I observe that gRPC
// starts to return EOF instead
// of conveying the messages.
//
// Fields Data and Blake2B are
// for just a single chunk.
bytes Data = 6;
// gRPC guarantees in-order delivery
// of the stream, so ChunkNumber may
// seem unnecessary. It is still
// useful for/as a delivery progress
// meter.
int64 ChunkNumber = 7;
// Be sure to set IsLastChunk to true
// if this is the last chunk.
bool IsLastChunk = 8;
// IsBcastSetRequest? (else by default it is a BcastGetReply)
bool IsBcastSet = 9;
}
message BigFileAck {
string Filepath = 1;
int64 SizeInBytes = 2;
fixed64 RecvTime = 3;
bytes WholeFileBlake2B = 4;
string Err = 5;
}
service Peer {
// client always sends a big file to the server.
rpc SendFile(stream BigFileChunk) returns (BigFileAck) {}
}