Skip to content

Commit 10e8682

Browse files
docs: consolidate API docs and update readme files (ipfs#2944)
* docs: consolidate API docs and update readme files Moves api docs into `/docs` folder similarly to how js-libp2p has organised their docs. Tries to trim readmes down a bit to make them more digestible and adds links to futher information on different topics. Also reinstates dependency statuses. Co-authored-by: Hugo Dias <hugomrdias@gmail.com>
1 parent a2e0f2f commit 10e8682

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1430
-1625
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ node_modules
1818
# Build artefacts
1919
dist
2020

21-
# Doc generation
22-
docs
23-
2421
# Deployment files
2522
.npmrc
2623

packages/ipfs/ISSUE_TEMPLATE.md ISSUE_TEMPLATE.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<!--
22
Thank you for reporting an issue.
33
4-
This issue tracker is for bugs and issues found within the JavaScript implementation of IPFS.
5-
If you require more general support please file an issue on our discuss forum. https://discuss.ipfs.io/
4+
This issue tracker is for bugs found within the JavaScript implementation of IPFS.
65
7-
Please fill in as much of the template below as you're able.
6+
If you are asking a question about how to use IPFS, please ask on https://discuss.ipfs.io
7+
8+
Otherwise please fill in as much of the template below as possible.
89
910
Version: output of `jsipfs version --all` if using the CLI or `ipfs.version((err, version) => {})` if using the instance.
11+
1012
Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows). If using in a Browser, please share the browser version as well.
13+
1114
Subsystem: if known, please specify affected core module name (e.g Bitswap, libp2p, etc).
1215
1316
If possible, please provide code that demonstrates the problem, keeping it as
@@ -21,7 +24,7 @@ simple and free of external dependencies as you are able.
2124
<!-- Bug, Feature, Question, Enhancement, Etc -->
2225
#### Type:
2326

24-
<!--
27+
<!--
2528
One of following:
2629
Critical - System crash, application panic.
2730
High - The main functionality of the application does not work, API breakage, repo format breakage, etc.

README.md

+30-93
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
</a>
55
</p>
66

7-
<h3 align="center">The JavaScript implementation of the IPFS protocol.</h3>
8-
9-
<p align="center">
10-
<a href="http://protocol.ai"><img src="https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat" /></a>
11-
<a href="http://ipfs.io/"><img src="https://img.shields.io/badge/project-IPFS-blue.svg?style=flat" /></a>
12-
</p>
7+
<h3 align="center">The JavaScript implementation of the IPFS protocol</h3>
138

149
<p align="center">
1510
<a href="https://riot.im/app/#/room/#ipfs-dev:matrix.org"><img src="https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat" /> </a>
@@ -27,122 +22,64 @@
2722

2823
> **Upgrading from <=0.40 to 0.41?** See the [release notes](https://github.com/ipfs/js-ipfs/issues/2656) for the list of API changes and the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26).
2924
30-
### Project status - `Alpha` <!-- omit in toc -->
31-
32-
We've come a long way, but this project is still in Alpha, lots of development is happening, API might change, beware of the Dragons 🐉.
25+
We've come a long way, but this project is still in Alpha, lots of development is happening, APIs might change, beware of 🐉..
3326

34-
**Want to get started?** Check our [examples folder](/examples) to learn how to spawn an IPFS node in Node.js and in the Browser.
27+
## Getting started
3528

36-
🚨 **Please read this** 🚨 The [DHT](https://en.wikipedia.org/wiki/Distributed_hash_table), a fundamental piece for automatic content and peer discovery is not yet complete. There are multiple applications that can be built without this service but nevertheless it is fundamental to getting that magic IPFS experience. The current status is that implementation is done and merged and we're working on performance issues. Expect the DHT to be available in a release very soon.
37-
38-
[**`Weekly Core Implementations Call`**](https://github.com/ipfs/team-mgmt/issues/992)
29+
* Look into the [examples folder](https://github.com/ipfs/js-ipfs/tree/master/examples) to learn how to spawn an IPFS node in Node.js and in the Browser
30+
* Read 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
31+
* Visit https://dweb-primer.ipfs.io to learn about IPFS and the concepts that underpin it
32+
* Head over to https://proto.school to take interactive tutorials that cover core IPFS APIs
33+
* Check out https://docs-beta.ipfs.io for tips, how-tos and more
3934

4035
## Tech Lead <!-- omit in toc -->
4136

4237
[David Dias](https://github.com/daviddias)
4338

4439
## Lead Maintainer <!-- omit in toc -->
4540

46-
[Alan Shaw](https://github.com/alanshaw)
41+
[Alex Potsides](http://github.com/achingbrain)
4742

4843
## Table of Contents <!-- omit in toc -->
4944

45+
- [Getting started](#getting-started)
46+
- [Documentation](#documentation)
5047
- [Structure](#structure)
51-
- [Development](#development)
52-
- [Clone and install dependencies](#clone-and-install-dependencies)
53-
- [Run tests](#run-tests)
54-
- [Lint](#lint)
55-
- [Build a dist version](#build-a-dist-version)
56-
- [Publishing new versions](#publishing-new-versions)
57-
- [Using prerelease versions](#using-prerelease-versions)
58-
- [Contribute](#contribute)
59-
- [Want to hack on IPFS?](#want-to-hack-on-ipfs)
48+
- [Want to hack on IPFS?](#want-to-hack-on-ipfs)
6049
- [License](#license)
6150

51+
## Documentation
52+
53+
* [Core API](./docs/core-api)
54+
* [Examples](./examples)
55+
* [Development](./docs/DEVELOPMENT.md)
56+
6257
## Structure
6358

6459
This project is broken into several modules, their purposes are:
6560

6661
* [`/packages/ipfs`](./packages/ipfs) The core implementation
6762
* [`/packages/ipfs-http-client`](./packages/ipfs-http-client) A client for the RPC-over-HTTP API presented by both js-ipfs and go-ipfs
6863
* [`/packages/interface-ipfs-core`](./packages/interface-ipfs-core) Tests to ensure adherance of an implementation to the spec
69-
* [`/packages/ipfs-utils`](./packages/ipfs-utils) Helpers and utilities common to core and the HTTP RPC API client
70-
* [`/packages/ipfs-mfs`](./packages/ipfs-mfs) The mfs implementation
71-
* [`/packages/ipfs-multipart`](./packages/ipfs-multipart) A module that handles adding files via multipart HTTP requests for core and the mfs
72-
73-
## Development
74-
75-
### Clone and install dependencies
76-
77-
```sh
78-
> git clone https://github.com/ipfs/js-ipfs.git
79-
> cd js-ipfs
80-
> npm install
81-
```
82-
83-
This will install [lerna](https://www.npmjs.com/package/lerna) and bootstrap the various packages, deduping and hoisting dependencies into the root folder.
84-
85-
If later you add new dependencies to submodules or just wish to remove all the `node_modules`/`dist` folders and start again, run `npm run reset && npm install` from the root.
86-
87-
See the scripts section of the root [`package.json`](./package.json) for more commands.
88-
89-
### Run tests
90-
91-
```sh
92-
# run all the unit tests
93-
> npm test
94-
95-
# run just IPFS tests in Node.js
96-
> npm run test:node
64+
* [`/packages/ipfs-core-utils`](./packages/ipfs-core-utils) Helpers and utilities common to core and the HTTP RPC API client
9765

98-
# run just IPFS tests in a browser
99-
> npm run test:browser
66+
## Want to hack on IPFS?
10067

101-
# run just IPFS tests in a webworker
102-
> npm run test:webworker
103-
```
104-
105-
More granular test suites can be run from each submodule.
106-
107-
Please see the `package.json` in each submodule for available commands.
108-
109-
### Lint
110-
111-
Please run the linter before submitting a PR, the build will not pass if it fails:
112-
113-
```sh
114-
> npm run lint
115-
```
116-
117-
### Build a dist version
118-
119-
```sh
120-
> npm run build
121-
```
122-
123-
### Publishing new versions
124-
125-
1. Ensure you have a `GH_TOKEN` env var containing a GitHub [Personal Access Token](https://github.com/settings/tokens) with `public_repo` permissions
126-
2. From the root of this repo run `npm run release` and follow the on screen prompts. It will use [conventional commits](https://www.conventionalcommits.org) to work out the new package version
127-
128-
### Using prerelease versions
129-
130-
Any changed packages from each successful build of master are published to npm as canary builds under the npm tag `next`.
68+
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
13169

132-
## Contribute
70+
The IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out:
13371

134-
IPFS implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out:
72+
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).
13573

136-
- Go through the modules below and **check out existing issues**. This would be especially useful for modules in active development. Some knowledge of IPFS may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
137-
- **Perform code reviews**. More eyes will help (a) speed the project along, (b) ensure quality, and (c) reduce possible future bugs.
138-
- Take a look at go-ipfs and some of the planning repositories or issues: for instance, the [libp2p spec](https://github.com/ipfs/specs/pull/19). Contributions here that would be most helpful are **top-level comments** about how it should look based on our understanding. Again, the more eyes the better.
74+
- **Check out existing issues** The [issue list](https://github.com/ipfs/js-ipfs/issues) has many that are marked as ['help wanted'](https://github.com/ipfs/js-ipfs/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22) or ['difficulty:easy'](https://github.com/ipfs/js-ipfs/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Adifficulty%3Aeasy) which make great starting points for development, many of which can be tackled with no prior IPFS knowledge
75+
- **Look at the [IPFS Roadmap](https://github.com/ipfs/roadmap)** This are the high priority items being worked on right now
76+
- **Perform code reviews** More eyes will help
77+
a. speed the project along
78+
b. ensure quality, and
79+
c. reduce possible future bugs.
13980
- **Add tests**. There can never be enough tests.
81+
- **Join the [Weekly Core Implementations Call](https://github.com/ipfs/team-mgmt/issues/992)** it's where everyone discusses what's going on with IPFS and what's next
14082

141-
### Want to hack on IPFS?
142-
143-
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
144-
145-
Check out [ipfs/community/CONTRIBUTING_JS.md](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for details on coding standards, commit messages and other project conventions
14683

14784
## License
14885

File renamed without changes.

packages/ipfs/docs/config.md docs/CONFIG.md

+27-24
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1-
# The js-ipfs config file
1+
# The js-ipfs config file <!-- omit in toc -->
22

33
The js-ipfs config file is a JSON document located in the root directory of the js-ipfs repository.
44

5-
#### Profiles
5+
## Table of Contents <!-- omit in toc -->
6+
7+
- [Profiles](#profiles)
8+
- [`Addresses`](#addresses)
9+
- [`API`](#api)
10+
- [`Delegates`](#delegates)
11+
- [`Gateway`](#gateway)
12+
- [`Swarm`](#swarm)
13+
- [`Bootstrap`](#bootstrap)
14+
- [`Datastore`](#datastore)
15+
- [`Spec`](#spec)
16+
- [`Discovery`](#discovery)
17+
- [`MDNS`](#mdns)
18+
- [`webRTCStar`](#webrtcstar)
19+
- [`Identity`](#identity)
20+
- [`PeerID`](#peerid)
21+
- [`PrivKey`](#privkey)
22+
- [`Keychain`](#keychain)
23+
- [`Pubsub`](#pubsub)
24+
- [`Router`](#router)
25+
- [`Enabled`](#enabled)
26+
- [`Swarm`](#swarm-1)
27+
- [`ConnMgr`](#connmgr)
28+
29+
## Profiles
630

731
Configuration profiles allow to tweak configuration quickly. Profiles can be
832
applied with `--profile` flag to `ipfs init` or with the `ipfs config profile
@@ -40,29 +64,8 @@ Available profiles:
4064

4165
Inverse of "lowpower" profile.
4266

43-
## Table of Contents
44-
45-
- [`Addresses`](#addresses)
46-
- [`API`](#api)
47-
- [`Delegates`](#delegates)
48-
- [`Gateway`](#gateway)
49-
- [`Swarm`](#swarm)
50-
- [`Bootstrap`](#bootstrap)
51-
- [`Datastore`](#datastore)
52-
- [`Spec`](#spec)
53-
- [`Discovery`](#discovery)
54-
- [`MDNS`](#mdns)
55-
- [`webRTCStar`](#webrtcstar)
56-
- [`Identity`](#identity)
57-
- [`PeerID`](#peerid)
58-
- [`PrivKey`](#privkey)
59-
- [`Keychain`](#keychain)
60-
- [`Pubsub`](#pubsub)
61-
- [`Router`](#router)
62-
- [`Swarm`](#swarm)
63-
- [`ConnMgr`](#connmgr)
64-
6567
## `Addresses`
68+
6669
Contains information about various listener addresses to be used by this node.
6770

6871
### `API`

docs/DEVELOPMENT.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Development <!-- omit in toc -->
2+
3+
- [Clone and install dependencies](#clone-and-install-dependencies)
4+
- [Run tests](#run-tests)
5+
- [Lint](#lint)
6+
- [Build a dist version](#build-a-dist-version)
7+
- [Publishing new versions](#publishing-new-versions)
8+
- [Using prerelease versions](#using-prerelease-versions)
9+
10+
## Clone and install dependencies
11+
12+
```sh
13+
> git clone https://github.com/ipfs/js-ipfs.git
14+
> cd js-ipfs
15+
> npm install
16+
```
17+
18+
This will install [lerna](https://www.npmjs.com/package/lerna) and bootstrap the various packages, deduping and hoisting dependencies into the root folder.
19+
20+
If later you add new dependencies to submodules or just wish to remove all the `node_modules`/`dist` folders and start again, run `npm run reset && npm install` from the root.
21+
22+
See the scripts section of the root [`package.json`](./package.json) for more commands.
23+
24+
## Run tests
25+
26+
```sh
27+
# run all the unit tests
28+
> npm test
29+
30+
# run just IPFS tests in Node.js
31+
> npm run test:node
32+
33+
# run just IPFS tests in a browser
34+
> npm run test:browser
35+
36+
# run just IPFS tests in a webworker
37+
> npm run test:webworker
38+
```
39+
40+
More granular test suites can be run from each submodule.
41+
42+
Please see the `package.json` in each submodule for available commands.
43+
44+
## Lint
45+
46+
Please run the linter before submitting a PR, the build will not pass if it fails:
47+
48+
```sh
49+
> npm run lint
50+
```
51+
52+
## Build a dist version
53+
54+
```sh
55+
> npm run build
56+
```
57+
58+
## Publishing new versions
59+
60+
1. Ensure you have a `GH_TOKEN` env var containing a GitHub [Personal Access Token](https://github.com/settings/tokens) with `public_repo` permissions
61+
2. From the root of this repo run `npm run release` and follow the on screen prompts. It will use [conventional commits](https://www.conventionalcommits.org) to work out the new package version
62+
63+
## Using prerelease versions
64+
65+
Any changed packages from each successful build of master are published to npm as canary builds under the npm tag `next`.
File renamed without changes.

docs/IPFS.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# IPFS module <!-- omit in toc -->
2+
3+
These are functions not in the [Core API](#core-api) but that are specific to [`ipfs`](../packages/ipfs).
4+
5+
## Table of contents <!-- omit in toc -->
6+
7+
- [Constructor](#constructor)
8+
- [`options.repo`](#optionsrepo)
9+
- [`options.repoAutoMigrate`](#optionsrepoautomigrate)
10+
- [`options.init`](#optionsinit)
11+
- [`options.start`](#optionsstart)
12+
- [`options.pass`](#optionspass)
13+
- [`options.silent`](#optionssilent)
14+
- [`options.relay`](#optionsrelay)
15+
- [`options.offline`](#optionsoffline)
16+
- [`options.preload`](#optionspreload)
17+
- [`options.EXPERIMENTAL`](#optionsexperimental)
18+
- [`options.config`](#optionsconfig)
19+
- [`options.ipld`](#optionsipld)
20+
- [`options.libp2p`](#optionslibp2p)
21+
- [`options.connectionManager`](#optionsconnectionmanager)
22+
- [Instance methods](#instance-methods)
23+
- [`node.start()`](#nodestart)
24+
- [`node.stop()`](#nodestop)
25+

docs/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# IPFS Docs <!-- omit in toc -->
2+
3+
- [API Docs](#api-docs)
4+
- [How tos and other documentation](#how-tos-and-other-documentation)
5+
- [Development documentation](#development-documentation)
6+
7+
## API Docs
8+
9+
`ipfs` can run as part of your program (an in-process node) or as a standalone daemon process that can be communicated with via an HTTP RPC API using the [`ipfs-http-client`](../packages/ipfs-http-api) module.
10+
11+
Whether accessed directly or over HTTP, both methods support the full [Core API](#core-api). In addition other methods are available to construct instances of each module, etc.
12+
13+
* [Core API docs](./core-api/README.md)
14+
* [IPFS API](../packages/ipfs/README.md)
15+
* [IPFS-HTTP-CLIENT API](../packages/ipfs-http-client/README.md)
16+
17+
## How tos and other documentation
18+
19+
* [How to run js-IPFS in the browser](./BROWSERS.md)
20+
* [js-IPFS configuration options](./CONFIG.md)
21+
22+
## Development documentation
23+
24+
* [Release issue template](./RELEASE_ISSUE_TEMPLATE.md)
25+
* [Early testers](./EARLY_TESTERS.md)
26+
* [Releases](./RELEASES.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)