Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: code blocks for the code
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
  • Loading branch information
Alan Shaw authored and daviddias committed Nov 29, 2018
1 parent 0ca86fa commit 36cf442
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 201 deletions.
8 changes: 4 additions & 4 deletions SPEC/BITSWAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

> Returns the wantlist, optionally filtered by peer ID
#### `Go` **WIP**
#### Go **WIP**

#### `JavaScript` - ipfs.bitswap.wantlist([peerId], [callback])
#### JavaScript - `ipfs.bitswap.wantlist([peerId], [callback])`

`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:

Expand All @@ -34,9 +34,9 @@ ipfs.bitswap.wantlist(peerId, (err, list) => console.log(list))

> Show diagnostic information on the bitswap agent.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.bitswap.stat([callback])
##### JavaScript - `ipfs.bitswap.stat([callback])`

Note: `bitswap.stat` and `stats.bitswap` can be used interchangeably.

Expand Down
12 changes: 6 additions & 6 deletions SPEC/BLOCK.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

> Get a raw IPFS block.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.block.get(cid, [options, callback])
##### JavaScript - `ipfs.block.get(cid, [options], [callback])`

`cid` is a [cid][cid] which can be passed as:

Expand Down Expand Up @@ -44,9 +44,9 @@ A great source of [examples][] can be found in the tests for this API.

> Stores input as an IPFS block.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.block.put(block [, options], [callback])
##### JavaScript - `ipfs.block.put(block, [options], [callback])`

Where `block` can be:

Expand Down Expand Up @@ -114,9 +114,9 @@ A great source of [examples][] can be found in the tests for this API.

> Print information of a raw IPFS block.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.block.stat(cid, [callback])
##### JavaScript - `ipfs.block.stat(cid, [callback])`

`cid` is a [cid][cid] which can be passed as:

Expand Down
16 changes: 8 additions & 8 deletions SPEC/BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

> Add a peer address to the bootstrap list
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.bootstrap.add(addr, [opts,] callback)
##### JavaScript - `ipfs.bootstrap.add(addr, [options], [callback])`

- `addr` is a [multiaddr](https://github.com/multiformats/js-multiaddr) to a peer node
- `opts.default` if true, add the default peers to the list
- `options.default` if true, add the default peers to the list
- `callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res.Peers` is an array of added addresses.

#### `bootstrap.list`

> List all peer addresses in the bootstrap list
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.bootstrap.list(callback)
##### JavaScript - `ipfs.bootstrap.list([callback])``

- `callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res.Peers` is an array of addresses.

Expand All @@ -37,10 +37,10 @@

> Remove a peer address from the bootstrap list
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.bootstrap.rm(peer, [opt,] callback)
##### JavaScript - `ipfs.bootstrap.rm(peer, [options], [callback])`

- `addr` is a [multiaddr](https://github.com/multiformats/js-multiaddr) to a peer node
- `opts.all` if true, remove all peers from the list
- `options.all` if true, remove all peers from the list
- `callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res.Peers` is an array of removed addresses.
12 changes: 6 additions & 6 deletions SPEC/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

> Returns the currently being used config. If the daemon is off, it returns the stored config.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.config.get([key, callback])
##### JavaScript - `ipfs.config.get([key], [callback])`

`key` is the key of the value that should be fetched from the config file. If no key is passed, then the whole config should be returned. `key` should be of type String.

Expand All @@ -35,9 +35,9 @@ A great source of [examples][] can be found in the tests for this API.

> Adds or replaces a config value.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.config.set(key, value, [callback])
##### JavaScript - `ipfs.config.set(key, value, [callback])`

`key` is the key value that will be added or replaced (in case of the value already). `key` should be of type String.

Expand Down Expand Up @@ -66,9 +66,9 @@ A great source of [examples][] can be found in the tests for this API.

> Adds or replaces a config file.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.config.replace(config, [callback])
##### JavaScript - `ipfs.config.replace(config, [callback])`

`config` is a JSON object that contains the new config.

Expand Down
12 changes: 6 additions & 6 deletions SPEC/DAG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

> Store an IPLD format node
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dag.put(dagNode, [options], [callback])
##### JavaScript - `ipfs.dag.put(dagNode, [options], [callback])`

- `dagNode` - a DAG node that follows one of the supported IPLD formats.
- `options` - a object that might contain the following values:
Expand Down Expand Up @@ -46,9 +46,9 @@ A great source of [examples][] can be found in the tests for this API.

> Retrieve an IPLD format node
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dag.get(cid, [path], [options], [callback])
##### JavaScript - `ipfs.dag.get(cid, [path], [options], [callback])`

- `cid` - can be one of the following:
- a [CID](https://github.com/ipfs/js-cid) instance.
Expand Down Expand Up @@ -117,9 +117,9 @@ A great source of [examples][] can be found in the tests for this API.

> Enumerate all the entries in a graph
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dag.tree(cid, [path], [options], [callback])
##### JavaScript - `ipfs.dag.tree(cid, [path], [options], [callback])`

- `cid` - can be one of the following:
- a [CID](https://github.com/ipfs/js-cid) instance.
Expand Down
24 changes: 12 additions & 12 deletions SPEC/DHT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

> Retrieve the Peer Info of a reachable node in the network.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dht.findpeer(peerId, [callback])
##### JavaScript - `ipfs.dht.findpeer(peerId, [callback])`

Where `peerId` is a IPFS/libp2p Id of type [PeerId](https://github.com/libp2p/js-peer-id).

Expand All @@ -37,9 +37,9 @@ A great source of [examples][] can be found in the tests for this API.

> Retrieve the providers for content that is addressed by an hash.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dht.findprovs(hash, [options], callback])
##### JavaScript - `ipfs.dht.findprovs(hash, [options], [callback])`

Where `hash` is a multihash.

Expand All @@ -64,9 +64,9 @@ A great source of [examples][] can be found in the tests for this API.

> Retrieve a value from DHT
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dht.get(key, [callback])
##### JavaScript - `ipfs.dht.get(key, [callback])`

Where `key` is a string.

Expand All @@ -86,9 +86,9 @@ A great source of [examples][] can be found in the tests for this API.

> Announce to the network that you are providing given values.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dht.provide(cid, [callback])
##### JavaScript - `ipfs.dht.provide(cid, [callback])`

Where `cid` is a CID or array of CIDs.

Expand All @@ -108,9 +108,9 @@ A great source of [examples][] can be found in the tests for this API.

> Store a value on the DHT
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dht.put(key, value, [callback])
##### JavaScript - `ipfs.dht.put(key, value, [callback])`

Where `key` is a string and `value` can be of any type.

Expand All @@ -130,9 +130,9 @@ A great source of [examples][] can be found in the tests for this API.

> Queries the network for the 'closest peers' to a given key. 'closest' is defined by the rules of the underlying Peer Routing mechanism.
##### `Go` **WIP**
##### Go **WIP**

##### `JavaScript` - ipfs.dht.query(peerId, [callback])
##### JavaScript - `ipfs.dht.query(peerId, [callback])`

Where `peerId` is a IPFS/libp2p Id of type [PeerId](https://github.com/libp2p/js-peer-id).

Expand Down
Loading

0 comments on commit 36cf442

Please sign in to comment.