You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
**Important to note:** DHT and Relay are not finalized yet, you won't have resource discovery happening by default as you get in go-ipfs, we are working actively on these pieces, please follow:
45
+
**Please read this:** DHT (automatic content discovery) and Circuit Relay (pierce through NATs and dial between any node in the network) are two fundamental pieces that are not finalized yet. There are multiple applications that can be built without these two services but nevertheless they are fundamental to get that magic IPFS experience. If you want to track progress or contribute, please follow:
@@ -54,10 +55,10 @@ You can check the development status at the [Waffle Board](https://waffle.io/ipf
54
55
-[Through command line tool](#through-command-line-tool)
55
56
-[Use in the browser](#use-in-the-browser)
56
57
-[Usage](#usage)
57
-
-[CLI](#cli)
58
-
-[HTTP-API](#http-api)
59
-
-[IPFS Core (use IPFS as a module in Node.js or in the Browser)](#ipfs-core-use-ipfs-as-a-module)
60
-
-[Create a IPFS node instance](#create-a-ipfs-node-instance)
58
+
-[IPFS CLI](#ipfs-cli)
59
+
-[IPFS Daemon](#ipfs-daemon)
60
+
-[IPFS Module (use IPFS as a module in Node.js or in the Browser)](#ipfs-module)
61
+
-[How to create a IPFS node instance](#create-a-ipfs-node-instance)
61
62
-[Tutorials and Examples](#tutorials-and-examples)
62
63
-[API Docs](#api)
63
64
-[Files](#files)
@@ -124,7 +125,7 @@ Inserting one of the above lines will make an `Ipfs` object available in the glo
124
125
125
126
## Usage
126
127
127
-
### CLI
128
+
### IPFS CLI
128
129
129
130
The `jsipfs` CLI, available when `js-ipfs` is installed globally, follows(should, it is a WIP) the same interface defined by `go-ipfs`, you can always use the `help` command for help menus.
130
131
@@ -150,11 +151,13 @@ Commands:
150
151
- default Bootstrap is off, to enable it set `IPFS_BOOTSTRAP=1`
151
152
152
153
153
-
### HTTP-API
154
+
### IPFS Daemon
155
+
156
+
The IPFS Daemon exposes the API defined [`http-api-spec`](https://github.com/ipfs/http-api-spec). You can use any of the IPFS HTTP-API client libraries with it, such as: [js-ipfs-api](https://github.com/ipfs/js-ipfs-api).
154
157
155
-
The HTTP-API exposed by the js-ipfs daemon follows the [`http-api-spec`](https://github.com/ipfs/http-api-spec). You can use any of the IPFS HTTP-API client libraries with it, such as: [js-ipfs-api](https://github.com/ipfs/js-ipfs-api).
158
+
### IPFS Module
156
159
157
-
### IPFS Core (use IPFS as a module)
160
+
Use the IPFS Module as a dependency of a project to spawn in process instances of IPFS.
158
161
159
162
#### Create a IPFS node instance
160
163
@@ -191,14 +194,14 @@ const node = new IPFS({
191
194
// init: {
192
195
// bits: 1024 // size of the RSA key generated
193
196
// },
194
-
start:true,
197
+
start:true,// default
195
198
// start: false,
196
199
EXPERIMENTAL: { // enable experimental features
197
200
pubsub:true,
198
201
sharding:true, // enable dir sharding
199
202
dht:true// enable KadDHT, currently not interopable with go-ipfs
200
203
},
201
-
config: { // overload the default IPFS node config
204
+
config: { // overload the default IPFS node config, find defaults at https://github.com/ipfs/js-ipfs/tree/master/src/core/runtime
202
205
Addresses: {
203
206
Swarm: [
204
207
'/ip4/127.0.0.1/tcp/1337'
@@ -322,6 +325,28 @@ A set of data types are exposed directly from the IPFS instance under `ipfs.type
322
325
323
326
## FAQ
324
327
328
+
#### How to enable WebRTC support for js-ipfs in the Browser
329
+
330
+
To add a WebRTC transport to your js-ipfs node, you must add a WebRTC multiaddr. To do that, simple override the config.Addresses.Swarm array which contains all the multiaddrs which the IPFS node will use. See below:
**Important:** This transport usage is kind of unstable and several users have experienced crashes. Track development of a solution at https://github.com/ipfs/js-ipfs/issues/1088.
349
+
325
350
#### Is there WebRTC support for js-ipfs with Node.js?
326
351
327
352
Yes, however, bare in mind that there isn't a 100% stable solution to use WebRTC in Node.js, use it at your own risk. The most tested options are:
Then, update your IPFS Daemon config to include the multiaddr for this new transport on the `Addresses.Swarm` array. Add: `"/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star"`
373
-
374
-
#### I see some slowness when hopping between tabs Chrome with IPFS nodes, is there a reason why?
375
-
376
-
Yes, unfortunately, due to [Chrome aggressive resource throttling policy](https://github.com/ipfs/js-ipfs/issues/611), it cuts freezes the execution of any background tab, turning an IPFS node that was running on that webpage into a vegetable state.
397
+
Then, update your IPFS Daemon config to include the multiaddr for this new transport on the `Addresses.Swarm` array. Add: `"/dns4/wrtc-star.discovery.libp2p.io/wss/p2p-webrtc-star"`
377
398
378
-
A way to mitigate this in Chrome, is to run your IPFS node inside a Service Worker, so that the IPFS instance runs in a background process. You can learn how to install an IPFS node as a service worker in here the repo [ipfs-service-worker](https://github.com/ipfs/ipfs-service-worker)
379
-
380
-
#### How can I configure an IPFS node to use a custom `signaling server`?
399
+
#### How can I configure an IPFS node to use a custom `signaling endpoint` for my WebRTC transport?
381
400
382
401
You'll need to execute a compatible `signaling server` ([libp2p-webrtc-star](https://github.com/libp2p/js-libp2p-webrtc-star) works) and include the correct configuration param for your IPFS node:
383
402
@@ -398,6 +417,33 @@ const node = new IPFS({
398
417
399
418
The code above assumes you are running a local `signaling server` on port `9090`. Provide the correct values accordingly.
400
419
420
+
#### Is there a more stable alternative to webrtc-star that offers a similar functionality?
421
+
422
+
Yes, websocket-star! A WebSockets based transport that uses a Relay to route the messages. To enable it, just do:
#### I see some slowness when hopping between tabs Chrome with IPFS nodes, is there a reason why?
441
+
442
+
Yes, unfortunately, due to [Chrome aggressive resource throttling policy](https://github.com/ipfs/js-ipfs/issues/611), it cuts freezes the execution of any background tab, turning an IPFS node that was running on that webpage into a vegetable state.
443
+
444
+
A way to mitigate this in Chrome, is to run your IPFS node inside a Service Worker, so that the IPFS instance runs in a background process. You can learn how to install an IPFS node as a service worker in here the repo [ipfs-service-worker](https://github.com/ipfs/ipfs-service-worker)
0 commit comments