This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: consolidate and update docs (#3364)
* Consolidates docs under `/docs` * Adds missing licenses, CoC, READMEs, etc * Updates docs where information was incorrect
- Loading branch information
1 parent
dc2795a
commit 308baa4
Showing
73 changed files
with
909 additions
and
365 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Contributing guidelines | ||
|
||
IPFS as a project, including js-ipfs and all of its modules, follows the [standard IPFS Community contributing guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md). | ||
|
||
We also adhere to the [IPFS JavaScript Community contributing guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) which provide additional information of how to collaborate and contribute in the JavaScript implementation of IPFS. | ||
|
||
We appreciate your time and attention for going over these. Please open an issue on [ipfs/community](https://github.com/ipfs/community) if you have any question. | ||
|
||
Thank you. |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This project is transitioning from an MIT-only license to a dual MIT/Apache-2.0 license. | ||
Unless otherwise noted, all code contributed prior to 2019-11-21 and not contributed by | ||
a user listed in [this signoff issue](https://github.com/ipfs/js-ipfs/issues/2624) is | ||
licensed under MIT-only. All new contributions (and past contributions since 2019-11-21) | ||
are licensed under a dual MIT/Apache-2.0 license. |
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
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
File renamed without changes.
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# CORS <!-- omit in toc --> | ||
|
||
## Table of Contents <!-- omit in toc --> | ||
|
||
- [Overview](#overview) | ||
- [Configure CORS headers](#configure-cors-headers) | ||
|
||
## Overview | ||
|
||
Cross-origin Resource Sharing is a browser security mechanism that prevents unauthorized scripts from accessing resources from different domains. | ||
|
||
By default the HTTP RPC API of js-IPFS will cause any request sent from a CORS-respecting browser to fail. | ||
|
||
## Configure CORS headers | ||
|
||
You can configure your node to allow requests from other domains to proceed by setting the appropriate headers in the node config: | ||
|
||
```console | ||
$ jsipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://example.com"]' | ||
$ jsipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST", "GET"]' | ||
``` | ||
|
||
Restart the daemon for the settings to take effect. |
File renamed without changes.
7 changes: 5 additions & 2 deletions
7
packages/ipfs/docs/DELEGATE_ROUTERS.md → docs/DELEGATE_ROUTERS.md
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
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
File renamed without changes.
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
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
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# IPLD Codecs <!-- omit in toc --> | ||
|
||
## Table of Contents <!-- omit in toc --> | ||
|
||
- [Overview](#overview) | ||
- [Bundled Codecs](#bundled-codecs) | ||
- [Adding additional codecs](#adding-additional-codecs) | ||
- [Next steps](#next-steps) | ||
|
||
## Overview | ||
|
||
The IPFS repo contains a blockstore that holds [Blocks](https://github.com/ipld/js-ipld-block). These blocks can be thought of as a [CID][] and associated byte array. | ||
|
||
The [CID][] contains a `codec` property that lets us know how to interpret the byte array associated with it. | ||
|
||
In order to perform that interpretation, an [IPLD Format][] must be loaded that corresponds to the `codec` property of the [CID][]. | ||
|
||
## Bundled Codecs | ||
|
||
js-IPFS ships with three bundled codecs, the ones that are required to create and interpret [UnixFS][] structures. | ||
|
||
These are: | ||
|
||
1. [ipld-dag-pb](https://github.com/ipld/js-ipld-dag-pb) - used for file and directory structures | ||
2. [ipld-raw](https://github.com/ipld/js-ipld-raw) - used for file data where imported with `raw-leaves=true` | ||
3. [ipld-dag-cbor](https://github.com/ipld/js-ipld-dag-cbor) - used for general storage of JavaScript Objects | ||
|
||
## Adding additional codecs | ||
|
||
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') | ||
|
||
const node = await ipfs({ | ||
ipld: { | ||
// either specify them as part of the `formats` list | ||
formats: [ | ||
require('my-format') | ||
], | ||
|
||
// or supply a function to load them dynamically | ||
loadFormat: async (format) => { | ||
return require(format) | ||
} | ||
} | ||
}) | ||
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') | ||
const client = ipfsHttpClient({ | ||
url: 'http://127.0.0.1:5002', | ||
ipld: { | ||
// either specify them as part of the `formats` list | ||
formats: [ | ||
require('my-format') | ||
], | ||
// or supply a function to load them dynamically | ||
loadFormat: async (format) => { | ||
return require(format) | ||
} | ||
} | ||
}) | ||
``` | ||
|
||
## 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 | ||
|
||
[cid]: https://www.npmjs.com/package/cids | ||
[ipld format]: https://github.com/ipld/interface-ipld-format | ||
[unixfs]: https://github.com/ipfs/specs/blob/master/UNIXFS.md |
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
File renamed without changes.
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Contributor Code of Conduct | ||
|
||
The `js-ipfs` project follows the [`IPFS Community Code of Conduct`](https://github.com/ipfs/community/blob/master/code-of-conduct.md) |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Contributing guidelines | ||
|
||
IPFS as a project, including js-ipfs and all of its modules, follows the [standard IPFS Community contributing guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md). | ||
|
||
We also adhere to the [IPFS JavaScript Community contributing guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) which provide additional information of how to collaborate and contribute in the JavaScript implementation of IPFS. | ||
|
||
We appreciate your time and attention for going over these. Please open an issue on [ipfs/community](https://github.com/ipfs/community) if you have any question. | ||
|
||
Thank you. |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This project is transitioning from an MIT-only license to a dual MIT/Apache-2.0 license. | ||
Unless otherwise noted, all code contributed prior to 2019-11-21 and not contributed by | ||
a user listed in [this signoff issue](https://github.com/ipfs/js-ipfs/issues/2624) is | ||
licensed under MIT-only. All new contributions (and past contributions since 2019-11-21) | ||
are licensed under a dual MIT/Apache-2.0 license. |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Oops, something went wrong.