Skip to content

Commit

Permalink
make linter happier
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Aug 25, 2022
1 parent 72cc2ff commit 231112f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions BITSWAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ Bitswap is a data exchange protocol for sending and receiving content addressed

## Introduction

Bitswap is a message-based protocol, as opposed to request-response. All messages contain wantlists, and/or blocks. Upon receiving a wantlist, a Bitswap server should eventually process and respond to the requester with either information about the block or the block itself. Upon receiving blocks, the client should send a `Cancel` notification to peers that have asked for the data, signifying that the client no longer wants the block.
Bitswap is a message-based protocol, as opposed to request-response. All messages contain wantlists, and/or blocks.
Upon receiving a wantlist, a Bitswap server should eventually process and respond to the requester with either information about the block or the block itself.
Upon receiving blocks, the client should send a `Cancel` notification to peers that have asked for the data, signifying that the client no longer wants the block.

Bitswap aims to be a simple protocol, so that implementations can balance aspects such as throughput, latency, fairness, memory usage, etc. for their specific requirements.

Expand Down Expand Up @@ -88,7 +90,7 @@ message Message {

All protocol messages sent over a stream are prefixed with the message length in
bytes, encoded as an unsigned variable length integer as defined by the
[multiformats unsigned-varint spec][uvarint-spec].
[multiformats unsigned-varint spec](https://github.com/multiformats/unsigned-varint).

All protocol messages must be less than or equal to 4MiB in size

Expand All @@ -108,11 +110,11 @@ It is otherwise identical to 1.0.0
message Message {
message Entry {
bytes block = 1; // CID of the block
int32 priority = 2; // the priority (normalized). default to 1
int32 priority = 2; // the priority (normalized). default to 1
bool cancel = 3; // whether this revokes an entry
}
repeated Entry entries = 1; // a list of wantlist entries
repeated Entry entries = 1; // a list of wantlist entries
bool full = 2; // whether this is the full wantlist. default to false
}
Expand Down Expand Up @@ -160,13 +162,13 @@ message Message {
message Entry {
bytes block = 1; // CID of the block
int32 priority = 2; // the priority (normalized). default to 1
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
repeated Entry entries = 1; // a list of wantlist entries
bool full = 2; // whether this is the full wantlist. default to false
}
message Block {
Expand Down

0 comments on commit 231112f

Please sign in to comment.