|
1 | 1 | swarm API
|
2 | 2 | =========
|
3 | 3 |
|
| 4 | +#### `addrs` |
| 5 | + |
| 6 | +> List of known addresses (from the peer). |
| 7 | +
|
| 8 | +##### `Go` **WIP** |
| 9 | + |
| 10 | +##### `JavaScript` - ipfs.swarm.addrs([callback]) |
| 11 | + |
| 12 | +`callback` must follow `function (err, addrs) {}` signature, where `err` is an error if the operation was not successful. `addrs` will be an array of multiaddrs. |
| 13 | + |
| 14 | +If no `callback` is passed, a promise is returned. |
| 15 | + |
| 16 | +Example: |
| 17 | + |
| 18 | +```JavaScript |
| 19 | +ipfs.swarm.addrs(function (err, addrs) {}) |
| 20 | +``` |
| 21 | + |
| 22 | +#### `connect` |
| 23 | + |
| 24 | +> Open a connection to a given address. |
| 25 | +
|
| 26 | +##### `Go` **WIP** |
| 27 | + |
| 28 | +##### `JavaScript` - ipfs.swarm.SOMETHING(data, [callback]) |
| 29 | + |
| 30 | +`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: |
| 31 | + |
| 32 | +If no `callback` is passed, a promise is returned. |
| 33 | + |
| 34 | +Example: |
| 35 | + |
| 36 | + |
| 37 | +#### `disconnect` |
| 38 | + |
| 39 | +> Close a connection on a given address. |
| 40 | +
|
| 41 | +##### `Go` **WIP** |
| 42 | + |
| 43 | +##### `JavaScript` - ipfs.swarm.SOMETHING(data, [callback]) |
| 44 | + |
| 45 | +`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: |
| 46 | + |
| 47 | +If no `callback` is passed, a promise is returned. |
| 48 | + |
| 49 | +Example: |
| 50 | + |
| 51 | + |
| 52 | +#### `filters` |
| 53 | + |
| 54 | +> Manipulate address filters |
| 55 | +
|
| 56 | +##### `Go` **WIP** |
| 57 | + |
| 58 | +##### `JavaScript` - ipfs.swarm.filters(data, [callback]) |
| 59 | + |
| 60 | +`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: |
| 61 | + |
| 62 | +If no `callback` is passed, a promise is returned. |
| 63 | + |
| 64 | +Example: |
| 65 | + |
| 66 | + |
| 67 | +#### `peers` |
| 68 | + |
| 69 | +> List out the peers that we have connections with. |
| 70 | +
|
| 71 | +##### `Go` **WIP** |
| 72 | + |
| 73 | +##### `JavaScript` - ipfs.swarm.peers(data, [callback]) |
| 74 | + |
| 75 | +`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: |
| 76 | + |
| 77 | +If no `callback` is passed, a promise is returned. |
| 78 | + |
| 79 | +Example: |
| 80 | + |
| 81 | + |
| 82 | + |
0 commit comments