mirror of
https://github.com/status-im/nim-dagger.git
synced 2025-01-26 14:41:28 +00:00
02ef50ab46
Only a single message type is forwarded to the rpc handler, so we add pricing and payment info to that message type.
58 lines
1.6 KiB
Protocol Buffer
58 lines
1.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package bitswap.message.pb;
|
|
|
|
message Message {
|
|
|
|
message Wantlist {
|
|
enum WantType {
|
|
wantBlock = 0;
|
|
wantHave = 1;
|
|
}
|
|
|
|
message Entry {
|
|
bytes block = 1; // the block cid (cidV0 in bitswap 1.0.0, cidV1 in bitswap 1.1.0)
|
|
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;
|
|
}
|
|
|
|
message PricingMessage {
|
|
bytes address = 1; // Ethereum address to which payments should be made
|
|
bytes asset = 2; // Asset (coin) with which to pay
|
|
bytes price = 3; // Amount of assets to pay per byte (UInt256)
|
|
}
|
|
|
|
message StateChannelUpdate {
|
|
bytes update = 1; // Signed Nitro state, serialized as JSON
|
|
}
|
|
|
|
Wantlist wantlist = 1;
|
|
repeated bytes blocks = 2; // used to send Blocks in bitswap 1.0.0
|
|
repeated Block payload = 3; // used to send Blocks in bitswap 1.1.0
|
|
repeated BlockPresence blockPresences = 4;
|
|
int32 pendingBytes = 5;
|
|
PricingMessage pricing = 6;
|
|
StateChannelUpdate payment = 7;
|
|
}
|