diff --git a/BITSWAP.md b/BITSWAP.md index 6c74a7bb5..3c30a15f9 100644 --- a/BITSWAP.md +++ b/BITSWAP.md @@ -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 @@ -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 { @@ -281,7 +281,7 @@ message Message { } ``` -# Implementations +## Implementations - -