2025-12-18 18:23:09 +01:00
|
|
|
// Protocol of data exchange between Logos Storage nodes.
|
2022-10-14 02:58:57 +03:00
|
|
|
// Extended version of https://github.com/ipfs/specs/blob/main/BITSWAP.md
|
|
|
|
|
|
2021-02-25 18:23:22 -06:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
2021-08-30 13:25:20 -06:00
|
|
|
package blockexc.message.pb;
|
2021-02-25 18:23:22 -06:00
|
|
|
|
|
|
|
|
message Message {
|
|
|
|
|
|
|
|
|
|
message Wantlist {
|
|
|
|
|
enum WantType {
|
|
|
|
|
wantBlock = 0;
|
|
|
|
|
wantHave = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Entry {
|
2021-08-30 13:25:20 -06:00
|
|
|
bytes block = 1; // the block cid
|
2021-02-25 18:23:22 -06:00
|
|
|
int32 priority = 2; // the priority (normalized). default to 1
|
|
|
|
|
bool cancel = 3; // whether this revokes an entry
|
|
|
|
|
WantType wantType = 4; // Note: defaults to enum 0, ie Block
|
|
|
|
|
bool sendDontHave = 5; // Note: defaults to false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
repeated Entry entries = 1; // a list of wantlist entries
|
|
|
|
|
bool full = 2; // whether this is the full wantlist. default to false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Block {
|
|
|
|
|
bytes prefix = 1; // CID prefix (cid version, multicodec and multihash prefix (type + length)
|
|
|
|
|
bytes data = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum BlockPresenceType {
|
|
|
|
|
presenceHave = 0;
|
|
|
|
|
presenceDontHave = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message BlockPresence {
|
|
|
|
|
bytes cid = 1;
|
|
|
|
|
BlockPresenceType type = 2;
|
2021-04-08 09:22:41 +02:00
|
|
|
}
|
|
|
|
|
|
2021-02-25 18:23:22 -06:00
|
|
|
Wantlist wantlist = 1;
|
2025-12-17 15:20:48 +11:00
|
|
|
repeated Block payload = 3; // what happened to 2?
|
2022-09-13 06:32:12 +03:00
|
|
|
repeated BlockPresence blockPresences = 4;
|
|
|
|
|
int32 pendingBytes = 5;
|
2021-02-25 18:23:22 -06:00
|
|
|
}
|