This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,82 @@ | ||
swarm API | ||
========= | ||
|
||
#### `addrs` | ||
|
||
> List of known addresses (from the peer). | ||
##### `Go` **WIP** | ||
|
||
##### `JavaScript` - ipfs.swarm.addrs([callback]) | ||
|
||
`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. | ||
|
||
If no `callback` is passed, a promise is returned. | ||
|
||
Example: | ||
|
||
```JavaScript | ||
ipfs.swarm.addrs(function (err, addrs) {}) | ||
``` | ||
|
||
#### `connect` | ||
|
||
> Open a connection to a given address. | ||
##### `Go` **WIP** | ||
|
||
##### `JavaScript` - ipfs.swarm.SOMETHING(data, [callback]) | ||
|
||
`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: | ||
|
||
If no `callback` is passed, a promise is returned. | ||
|
||
Example: | ||
|
||
|
||
#### `disconnect` | ||
|
||
> Close a connection on a given address. | ||
##### `Go` **WIP** | ||
|
||
##### `JavaScript` - ipfs.swarm.SOMETHING(data, [callback]) | ||
|
||
`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: | ||
|
||
If no `callback` is passed, a promise is returned. | ||
|
||
Example: | ||
|
||
|
||
#### `filters` | ||
|
||
> Manipulate address filters | ||
##### `Go` **WIP** | ||
|
||
##### `JavaScript` - ipfs.swarm.filters(data, [callback]) | ||
|
||
`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: | ||
|
||
If no `callback` is passed, a promise is returned. | ||
|
||
Example: | ||
|
||
|
||
#### `peers` | ||
|
||
> List out the peers that we have connections with. | ||
##### `Go` **WIP** | ||
|
||
##### `JavaScript` - ipfs.swarm.peers(data, [callback]) | ||
|
||
`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` will be an array of: | ||
|
||
If no `callback` is passed, a promise is returned. | ||
|
||
Example: | ||
|
||
|
||
|