|
10 | 10 |
|
11 | 11 | ##### `Go` **WIP**
|
12 | 12 |
|
13 |
| -##### `JavaScript` - ipfs.bitswap.unwant(cid) |
| 13 | +##### `JavaScript` - ipfs.bitswap.unwant(cid, [callback]) |
14 | 14 |
|
15 | 15 | `cid` is a [cid][cid] which can be passed as:
|
16 | 16 |
|
17 | 17 | - CID, a CID instance
|
18 | 18 | - String, the base58 encoded version of the multihash
|
19 | 19 |
|
| 20 | +`callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful. |
| 21 | + |
| 22 | + **Example:** |
| 23 | + |
| 24 | + ```JavaScript |
| 25 | + ipfs.bitswap.unwant('QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu', (err) => { |
| 26 | + if (err) throw err |
| 27 | + console.log('Done') |
| 28 | + }) |
| 29 | + ``` |
| 30 | + |
20 | 31 | ##### `Go` **WIP**
|
21 | 32 |
|
22 | 33 | ### `bitswap.wantlist`
|
23 | 34 |
|
24 |
| -> Returns the wantlist, optionally limited by peerID |
| 35 | +> Returns the wantlist, optionally filtered by peer ID |
25 | 36 |
|
26 | 37 | #### `Go` **WIP**
|
27 | 38 |
|
28 |
| -#### `JavaScript` - ipfs.bitswap.wantlist([peerId]) |
| 39 | +#### `JavaScript` - ipfs.bitswap.wantlist([peerId], [callback]) |
| 40 | + |
| 41 | +`callback` must follow `function (err, list) {}` signature, where `err` is an error if the operation was not successful. `list` is an Object containing the following keys: |
| 42 | + |
| 43 | +- `Keys` An array of objects containing the following keys: |
| 44 | + - `/` A string multihash |
| 45 | + |
| 46 | +If no `callback` is passed, a promise is returned. |
| 47 | + |
| 48 | +**Example:** |
29 | 49 |
|
30 | 50 | ```JavaScript
|
31 | 51 | ipfs.bitswap.wantlist((err, list) => console.log(list))
|
32 | 52 |
|
33 |
| -//[ { Wantlist object }, ... ] |
| 53 | +// { Keys: [{ '/': 'QmHash' }] } |
34 | 54 |
|
35 | 55 | ipfs.bitswap.wantlist(peerId, (err, list) => console.log(list))
|
36 | 56 |
|
37 |
| -//[ { Wantlist object }, ... ] |
| 57 | +// { Keys: [{ '/': 'QmHash' }] } |
| 58 | +``` |
38 | 59 |
|
39 | 60 | #### `bitswap.stat`
|
40 | 61 |
|
|
0 commit comments