Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: update docs linking to new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveriosousa committed Aug 23, 2021
1 parent 767a98b commit 6bf176d
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 162 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ We've come a long way, but this project is still in Alpha, lots of development i
## Getting started

* Read the [docs](https://github.com/ipfs/js-ipfs/tree/master/docs)
* Look into the [examples](https://github.com/ipfs/js-ipfs/tree/master/examples) to learn how to spawn an IPFS node in Node.js and in the Browser
* Look into the [examples](https://github.com/ipfs-examples/js-ipfs-examples/tree/master) to learn how to spawn an IPFS node in Node.js and in the Browser
* Consult the [Core API docs](https://github.com/ipfs/js-ipfs/tree/master/docs/core-api) to see what you can do with an IPFS node
* Visit https://dweb-primer.ipfs.io to learn about IPFS and the concepts that underpin it
* Head over to https://proto.school to take interactive tutorials that cover core IPFS APIs
Expand Down Expand Up @@ -98,7 +98,7 @@ console.info(cid)
* [Concepts](https://docs.ipfs.io/concepts/)
* [Config](./docs/CONFIG.md)
* [Core API](./docs/core-api)
* [Examples](./examples)
* [Examples](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples)
* [Development](./docs/DEVELOPMENT.md)

## Structure
Expand All @@ -113,7 +113,7 @@ This project is broken into several modules, their purposes are:
* [`/packages/ipfs-core-utils`](./packages/ipfs-core-utils) Helpers and utilities common to core and the HTTP RPC API client
* [`/packages/ipfs-daemon`](./packages/ipfs-daemon) Run js-IPFS as a background daemon
* [`/packages/ipfs-grpc-client`](./packages/ipfs-grpc-client) A gRPC client for js-IPFS
* [`/packages/ipfs-grpc-protocol`](./packages/ipfs-grpc-protocol]) Shared module between the gRPC client and server
* [`/packages/ipfs-grpc-protocol`](./packages/ipfs-grpc-protocol) Shared module between the gRPC client and server
* [`/packages/ipfs-grpc-server`](./packages/ipfs-grpc-server) A gRPC-over-websockets server for js-IPFS
* [`/packages/ipfs-http-client`](./packages/ipfs-http-client) A client for the RPC-over-HTTP API presented by both js-ipfs and go-ipfs
* [`/packages/ipfs-http-gateway`](./packages/ipfs-http-gateway) JS implementation of the [IPFS HTTP Gateway](https://docs.ipfs.io/concepts/ipfs-gateway/)
Expand Down Expand Up @@ -175,7 +175,7 @@ List of the main packages that make up the IPFS ecosystem.

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

The IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out:
The IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out:

Read the [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md) and [JavaScript Contributing Guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md).

Expand Down
8 changes: 6 additions & 2 deletions docs/IPLD.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Additional bases can be configured using the `bases` config property.
If your application requires support for extra codecs, you can configure them as follows:

1. Configure the [IPLD layer](https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs/docs/MODULE.md#optionsipld) of your IPFS daemon to support the codec. This step is necessary so the node knows how to prepare data received over HTTP to be passed to IPLD for serialization:

```javascript
const ipfs = require('ipfs')

Expand Down Expand Up @@ -83,7 +84,10 @@ If your application requires support for extra codecs, you can configure them as
}
}
})
```

2. Configure your IPFS HTTP API Client to support the codec. This is necessary so that the client can send the data to the IPFS node over HTTP:

```javascript
const ipfsHttpClient = require('ipfs-http-client')
Expand Down Expand Up @@ -125,8 +129,8 @@ If your application requires support for extra codecs, you can configure them as

## Next steps

* See [examples/custom-ipld-formats](https://github.com/ipfs/js-ipfs/tree/master/examples/custom-ipld-formats) for runnable code that demonstrates the above with in-process IPFS nodes, IPFS run as a daemon and also the http client
* Also [examples/traverse-ipld-graphs](https://github.com/ipfs/js-ipfs/tree/master/examples/traverse-ipld-graphs) which uses the [ipld-format-to-blockcodec](https://www.npmjs.com/package/ipld-format-to-blockcodec) module to use older [IPLD format][]s that have not been ported over to the new [BlockCodec][] interface, as well as additional [Multihash Hashers](https://www.npmjs.com/package/multiformats#multihash-hashers).
* See [examples/custom-ipld-formats](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/custom-ipld-formats) for runnable code that demonstrates the above with in-process IPFS nodes, IPFS run as a daemon and also the http client
* Also [examples/traverse-ipld-graphs](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/traverse-ipld-graphs) which uses the [ipld-format-to-blockcodec](https://www.npmjs.com/package/ipld-format-to-blockcodec) module to use older [IPLD format][]s that have not been ported over to the new [BlockCodec][] interface, as well as additional [Multihash Hashers](https://www.npmjs.com/package/multiformats#multihash-hashers).

[cid]: https://docs.ipfs.io/concepts/content-addressing/
[blockcodec]: https://www.npmjs.com/package/multiformats#multicodec-encoders--decoders--codecs
Expand Down
94 changes: 50 additions & 44 deletions docs/MODULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ const node = await IPFS.create({ repo: '/var/ipfs/data' })

### `options.repoAutoMigrate`

| Type | Default |
|------|---------|
| `boolean` | `true` |
| Type | Default |
| --------- | ------- |
| `boolean` | `true` |

`js-ipfs` comes bundled with a tool that automatically migrates your IPFS repository when a new version is available.

Expand All @@ -83,9 +83,9 @@ a case, you should provide a way to trigger migrations manually.**

### `options.init`

| Type | Default |
|------|---------|
| boolean or object | `true` |
| Type | Default |
| ----------------- | ------- |
| boolean or object | `true` |

Perform repo initialization steps when creating the IPFS node.

Expand All @@ -110,24 +110,24 @@ Instead of a boolean, you may provide an object with custom initialization optio

### `options.start`

| Type | Default |
|------|---------|
| `boolean` | `true` |
| Type | Default |
| --------- | ------- |
| `boolean` | `true` |

If `false`, do not automatically start the IPFS node. Instead, you’ll need to manually call [`node.start()`](#nodestart) yourself.
If `false`, do not automatically start the IPFS node. Instead, you’ll need to manually call [`node.start()`](#nodestart) yourself.

### `options.pass`

| Type | Default |
|------|---------|
| string | `null` |
| Type | Default |
| ------ | ------- |
| string | `null` |

A passphrase to encrypt/decrypt your keys.

### `options.silent`

| Type | Default |
|------|---------|
| Type | Default |
| ------- | ------- |
| Boolean | `false` |

Prevents all logging output from the IPFS node.
Expand All @@ -138,25 +138,25 @@ Prevents all logging output from the IPFS node.
|------|---------|
| object | `{ enabled: true, hop: { enabled: false, active: false } }` |

Configure circuit relay (see the [circuit relay tutorial](https://github.com/ipfs/js-ipfs/tree/master/examples/circuit-relaying) to learn more).
Configure circuit relay (see the [circuit relay tutorial](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examplescircuit-relaying) to learn more).

- `enabled` (boolean): Enable circuit relay dialer and listener. (Default: `true`)
- `hop` (object)
- `enabled` (boolean): Make this node a relay (other nodes can connect *through* it). (Default: `false`)
- `active` (boolean): Make this an *active* relay node. Active relay nodes will attempt to dial a destination peer even if that peer is not yet connected to the relay. (Default: `false`)
- `enabled` (boolean): Make this node a relay (other nodes can connect *through* it). (Default: `false`)
- `active` (boolean): Make this an *active* relay node. Active relay nodes will attempt to dial a destination peer even if that peer is not yet connected to the relay. (Default: `false`)

### `options.offline`

| Type | Default |
|------|---------|
| Type | Default |
| ------- | ------- |
| Boolean | `false` |

Run ipfs node offline. The node does not connect to the rest of the network but provides a local API.

### `options.preload`

| Type | Default |
|------|---------|
| Type | Default |
| ------ | ------------------------------------- |
| object | `{ enabled: true, addresses: [...] }` |

Configure remote preload nodes. The remote will preload content added on this node, and also attempt to preload objects requested by this node.
Expand All @@ -166,8 +166,8 @@ Configure remote preload nodes. The remote will preload content added on this no
### `options.EXPERIMENTAL`
| Type | Default |
|------|---------|
| Type | Default |
| ------ | ---------------------------------------- |
| object | `{ ipnsPubsub: false, sharding: false }` |
Enable and configure experimental features.
Expand All @@ -179,23 +179,23 @@ Enable and configure experimental features.
| Type | Default |
|------|---------|
| object | [`config-nodejs.js`](https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-core/src/runtime/config-nodejs.js) in Node.js, [`config-browser.js`](https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-core/src/runtime/config-browser.js) in browsers |
| object | [`config-nodejs.js`](https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-core/src/runtime/config-nodejs.js) in Node.js, [`config-browser.js`](https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-core/src/runtime/config-browser.js) in browsers |
Modify the default IPFS node config. This object will be *merged* with the default config; it will not replace it. The default config is documented in [the js-ipfs config file docs](./CONFIG.md).
### `options.ipld`
| Type | Default |
| Type | Default |
|------|---------|
| object | [`ipld.js`](https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-core/src/runtime/ipld.js) |
| object | [`ipld.js`](https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-core/src/runtime/ipld.js) |
Modify the default IPLD config. This object will be *merged* with the default config; it will not replace it. Check IPLD [docs](https://github.com/ipld/js-ipld#ipld-constructor) for more information on the available options.
Modify the default IPLD config. This object will be *merged* with the default config; it will not replace it. Check IPLD [docs](https://github.com/ipld/js-ipld#ipld-constructor) for more information on the available options.
> Browser config does **NOT** include by default all the IPLD formats. Only `ipld-dag-pb`, `ipld-dag-cbor` and `ipld-raw` are included.
> Browser config does **NOT** include by default all the IPLD formats. Only `ipld-dag-pb`, `ipld-dag-cbor` and `ipld-raw` are included.
To add support for other formats we provide two options, one sync and another async.
To add support for other formats we provide two options, one sync and another async.
Examples for the sync option:
Examples for the sync option:
<details><summary>ESM Environments</summary>
Expand All @@ -209,6 +209,7 @@ const node = await IPFS.create({
}
})
```
</details>
<details><summary>Commonjs Environments</summary>
Expand All @@ -219,6 +220,7 @@ const node = await IPFS.create({
}
})
```
</details>
<details><summary>Using script tags</summary>
Expand All @@ -227,19 +229,20 @@ const node = await IPFS.create({
<script src="https://unpkg.com/ipld-git/dist/index.min.js"></script>
<script src="https://unpkg.com/ipld-bitcoin/dist/index.min.js"></script>
<script>
async function main () {
const node = await self.IPFS.create({
ipld: {
formats: [self.IpldGit, self.IpldBitcoin]
}
})
}
main()
async function main() {
const node = await self.IPFS.create({
ipld: {
formats: [self.IpldGit, self.IpldBitcoin],
},
});
}
main();
</script>
```
</details>
Examples for the async option:
Examples for the async option:
<details><summary>ESM Environments</summary>
Expand All @@ -256,11 +259,13 @@ const node = await IPFS.create({
}
})
```
> For more information about dynamic imports please check [webpack docs](https://webpack.js.org/guides/code-splitting/#dynamic-imports) or search your bundler documention.
Using dynamic imports will tell your bundler to create a separate file (normally called *chunk*) that will **only** be requested by the browser if it's really needed. This strategy will reduce your bundle size and load times without removing any functionality.

With Webpack IPLD formats can even be grouped together using magic comments `import(/* webpackChunkName: "ipld-formats" */ 'ipld-git')` to produce a single file with all of them.

</details>

<details><summary>Commonjs Environments</summary>
Expand All @@ -278,6 +283,7 @@ const node = await IPFS.create({
}
})
```

</details>

<details><summary>Using Script tags</summary>
Expand Down Expand Up @@ -309,19 +315,19 @@ const node = await self.IPFS.create({
})
</script>
```
</details>

</details>

### `options.libp2p`

| Type | Default |
|------|---------|
| object | [`libp2p-nodejs.js`](../src/core/runtime/libp2p-nodejs.js) in Node.js, [`libp2p-browser.js`](../src/core/runtime/libp2p-browser.js) in browsers |
| function | [`libp2p bundle`](https://github.com/ipfs/js-ipfs/tree/master/examples/custom-libp2p) |
| object | [`libp2p-nodejs.js`](../src/core/runtime/libp2p-nodejs.js) in Node.js, [`libp2p-browser.js`](../src/core/runtime/libp2p-browser.js) in browsers |
| function | [`libp2p bundle`](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/custom-libp2p) |

The libp2p option allows you to build your libp2p node by configuration, or via a bundle function. If you are looking to just modify the below options, using the object format is the quickest way to get the default features of libp2p. If you need to create a more customized libp2p node, such as with custom transports or peer/content routers that need some of the ipfs data on startup, a custom bundle is a great way to achieve this.

You can see the bundle in action in the [custom libp2p example](https://github.com/ipfs/js-ipfs/tree/master/examples/custom-libp2p).
You can see the bundle in action in the [custom libp2p example](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/custom-libp2p).

Please see [libp2p/docs/CONFIGURATION.md](https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md) for the list of options libp2p supports.

Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"postinstall": "lerna bootstrap",
"link": "lerna link",
"reset": "lerna run clean && rimraf packages/*/node_modules examples/*/node_modules node_modules",
"reset": "lerna run clean && rimraf packages/*/node_modules node_modules",
"test": "lerna run test",
"test:node": "lerna run test:node",
"test:browser": "lerna run test:browser",
Expand All @@ -26,9 +26,6 @@
"clean": "lerna run clean",
"lint": "lerna run lint",
"dep-check": "lerna run dep-check",
"configure-examples": "run-s configure-examples:* release:pre:reinstall release:pre:bundle",
"configure-examples:add-examples": "json -I -f ./lerna.json -e \"this.packages.push('examples/*'); this.packages = [...new Set(this.packages)]\"",
"configure-examples:add-hoisted-modules": "json -I -f ./lerna.json -e \"this.command.bootstrap.nohoist = ['ipfs-css', 'tachyons']; this.command.bootstrap.nohoist = [...new Set(this.command.bootstrap.nohoist)]\"",
"release": "run-s release:pre:* release:publish docker:release release:post:*",
"release:pre:non-dirty-repo": "git diff --quiet",
"release:pre:update-contributors": "aegir release --lint=false --test=false --bump=false --build=false --changelog=false --commit=false --tag=false --push=false --ghrelease=false --docs=false --publish=false --types=false",
Expand All @@ -41,7 +38,6 @@
"docker:release:tag-version": "docker tag js-ipfs:latest docker.io/ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
"docker:release:push-latest": "docker push ipfs/js-ipfs:latest",
"docker:release:push-version": "docker push ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
"release:post:update-example-dependencies": "node scripts/update-example-deps.js",
"release:rc": "run-s release:pre:* release:canary",
"release:canary": "lerna publish --canary --preid rc --dist-tag next --force-publish --yes",
"docker:rc": "run-s docker:rc:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/ipfs-core/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface Options {
pass?: string

/**
* Configure circuit relay (see the [circuit relay tutorial](https://github.com/ipfs/js-ipfs/tree/master/examples/circuit-relaying)
* Configure circuit relay (see the [circuit relay tutorial](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/circuit-relaying)
* to learn more)
*/
relay?: RelayOptions
Expand Down Expand Up @@ -113,7 +113,7 @@ export interface Options {
* more customized libp2p node, such as with custom transports or peer/content
* routers that need some of the ipfs data on startup, a custom bundle is a
* great way to achieve this.
* - You can see the bundle in action in the [custom libp2p example](https://github.com/ipfs/js-ipfs/tree/master/examples/custom-libp2p).
* - You can see the bundle in action in the [custom libp2p example](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examplescustom-libp2p).
* - Please see [libp2p/docs/CONFIGURATION.md](https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md)
* for the list of options libp2p supports.
* - Default: [`libp2p-nodejs.js`](../src/core/runtime/libp2p-nodejs.js)
Expand Down
16 changes: 9 additions & 7 deletions packages/ipfs-http-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ Alternatively it can be an object which may have the following keys:
#### Returns

| Type | Description |
| -------- | -------- |
| `Object` | An object that conforms to the [IPFS Core API](https://github.com/ipfs/js-ipfs/tree/master/docs/core-api) |
| ---- | ----------- |
| `Object` | An object that conforms to the [IPFS Core API](https://github.com/ipfs/js-ipfs/tree/master/docs/core-api) |

#### Example

Expand Down Expand Up @@ -284,11 +284,11 @@ const ipfs = create({ host: '1.1.1.1', port: '80', apiPath: '/ipfs/api/v0' })

Same as in Node.js, you just have to [browserify](http://browserify.org) the code before serving it. See the browserify repo for how to do that.

See the example in the [examples folder](/examples/http-client-browser-browserify) to get a boilerplate.
See the example in the [examples folder](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples) to get a boilerplate.

**through webpack**

See the example in the [examples folder](/examples/http-client-bundle-webpack) to get an idea on how to use `js-ipfs-http-client` with webpack.
See the example in the [examples folder](https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/http-client-bundle-webpack) to get an idea on how to use `js-ipfs-http-client` with webpack.

**from CDN**

Expand All @@ -310,9 +310,11 @@ For maximum security you may also decide to:
Example:

```html
<script src="https://www.jsdelivr.com/package/npm/ipfs-http-client"
integrity="sha384-5bXRcW9kyxxnSMbOoHzraqa7Z0PQWIao+cgeg327zit1hz5LZCEbIMx/LWKPReuB"
crossorigin="anonymous"></script>
<script
src="https://www.jsdelivr.com/package/npm/ipfs-http-client"
integrity="sha384-5bXRcW9kyxxnSMbOoHzraqa7Z0PQWIao+cgeg327zit1hz5LZCEbIMx/LWKPReuB"
crossorigin="anonymous"
></script>
```

CDN-based IPFS API provides the `IpfsHttpClient` constructor as a method of the global `window` object. Example:
Expand Down
Loading

0 comments on commit 6bf176d

Please sign in to comment.