Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Aug 26, 2022
1 parent 661ab5b commit 4f2c10e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions BITSWAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ Given that a client C wants to fetch data from some server S:
1. If C sends S a Have request for data S has (and is willing to give to C) it should respond with a Have, although it may instead respond with the block itself (e.g. if the block is very small)
1. For each of the items that S sends back Blocks or BlockPresences for they may append any `tokens` they want
2. If C sends S a Have request for data S has but is not currently willing to give to C, S may respond with an `AuthRequired` BlockPresence
1. For each of the items that S sends back Blocks or BlockPresences for they may append any `tokens` they want. Recommended tokens include those that would inform C how they could convince S to give them access to the blocks they want.
2. If C sends S a Have request for data S does not have (or has but is not willing to tell C it has) and C has requested for DontHave responses then S should respond with DontHave
3. S may choose to include the number of bytes that are pending to be sent to C in the response message
4. If C asked for a block that S has but it is bigger than the maximum block size it should return `BlockTooBig`
1. For each of the items that S sends back Blocks or BlockPresences for they may append any `tokens` they want. Recommended tokens include those that would inform C how they could convince S to give them access to the blocks they want.
2. If C sends S a Have request for data S does not have (or has but is not willing to tell C it has) and C has requested for DontHave responses then S should respond with DontHave
3. S may choose to include the number of bytes that are pending to be sent to C in the response message
4. If C asked for a block that S has but it is bigger than the maximum block size it should return `BlockTooBig`
3. When C no longer needs a block it previously asked for it should send a Cancel message for that request to any peers that have not already responded about that particular block. It should particularly send Cancel messages for Block requests (as opposed to Have requests) that have not yet been answered.

### Tokens
Expand All @@ -245,14 +245,14 @@ 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 tokens int32 = 7; // the indices of the tokens in the token list
}
}
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 Expand Up @@ -281,7 +281,7 @@ message Message {
}
```

# Implementations
## Implementations

- <https://github.com/ipfs/go-bitswap>
- <https://github.com/ipfs/js-ipfs-bitswap>

0 comments on commit 4f2c10e

Please sign in to comment.