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
Copy file name to clipboardExpand all lines: docs/how-to/companion-node-types.md
+62-45
Original file line number
Diff line number
Diff line change
@@ -5,77 +5,94 @@ description: Learn about the available node types in IPFS Companion.
5
5
6
6
# Understand node types in IPFS Companion
7
7
8
-
There are four available node typesin IPFS Companion:
8
+
IPFS Companion's preferences screen allows you to choose from several different node types. The available types you'll see in your Companion preferences depends on the browser you're using (i.e. Firefox, Chrome, Brave), but the full list is as follows:
9
9
10
-
1. External
11
-
2. Embedded
12
-
3. Embedded + `chrome.sockets`
13
-
4. Public
10
+
[[toc]]
14
11
15
-

12
+

16
13
17
-
When in doubt, use the _External_node type running on your localhost. Some options for doing so:
14
+
**If you're already running a local IPFS node, choose _External_.** If not, do one of the following:
18
15
19
-
- Use the [IPFS Desktop](https://github.com/ipfs-shipyard/ipfs-desktop) GUI app (for Windows/Linux/Mac), which installs and manages a local IPFS node for you
20
-
- If you prefer a more hands-on approach:
21
-
- Install IPFS by following the [command line quick-start guide](command-line-quick-start.md)
22
-
- Or run it in [Docker](https://github.com/ipfs/go-ipfs#running-ipfs-inside-docker)
23
-
- If you are using [Brave](https://brave.com/), feel you may want to experiment with _embedded + `chrome.sockets`_ (see below); you can always switch back to _External_ with local IPFS Desktop
16
+
-[Install](/install) and run IPFS as an [external node](#external) (recommended).
17
+
- Use a [native node](#native) built into your browser (Brave v1.19 or later only) or the [embedded node](#embedded) built into Companion.
24
18
25
19
## External
26
20
27
-
An _external_ node can be any instance of an IPFS daemon that runs outside of a web browser process and exposes _Gateway_ and writable _API_ over HTTP at TCP ports.
21
+
An _external_ node can be any instance of an IPFS daemon that:
28
22
29
-
At this time, the [go-ipfs](https://github.com/ipfs/go-ipfs) daemon is the preferred implementation. It is easier on CPU, and provides `dhtclient` mode, which
30
-
decreases ambient bandwidth use and smaller battery drain (key characteristics of something that is expected to run in the background all the time).
23
+
- Runs outside of your web browser.
24
+
- Exposes a _gateway_ and writeable _API_ over HTTP at TCP ports.
31
25
32
-
A good practice is to run it on localhost (`127.0.0.1`), as it provides:
26
+
The [go-ipfs](https://github.com/ipfs/go-ipfs) implementation of IPFS is the recommended choice for running an external IPFS node. It's less power-hungry than other implementations and uses the `dhtclient` mode to decrease ambient bandwidth use and reduce battery drain.
33
27
34
-
- Increased security (native IPFS used as end-to-end transport)
35
-
- Better UX in the browser (no mixed-content warnings)
36
-
- Improved performance (local loopback is used, no network overhead)
28
+
A good practice is to run your go-ipfs daemon on localhost (`127.0.0.1`), as it provides:
37
29
38
-
Don't know where to start? See the [command line quick-start guide](command-line-quick-start.md).
30
+
- Increased security: native IPFS used as end-to-end transport.
31
+
- Better UX in the browser: no mixed-content warnings.
32
+
- Improved performance: local loopback is used, so no network overhead.
39
33
40
-
## Embedded
34
+
You can get started with running a go-ipfs node on your local machine in several ways:
41
35
42
-
An _embedded_ node is a js-ipfs instance running in the browser (in-memory), without the need for any external software. It is a work in progress, but can be used for development and experimentation (e.g. for testing a dApp that uses `window.ipfs` without having to install and start up your own IPFS daemon).
36
+
-[IPFS Desktop](https://github.com/ipfs-shipyard/ipfs-desktop) installs and manages a local node for you, as well as offering an easy, convenient user interface for managing files and peers.
37
+
- If you're comfortable with the command line and don't need the convenience of the IPFS Desktop UI, follow the directions in the [command line quick-start guide](/how-to/command-line-quick-start/).
38
+
- Docker fans can run and use go-ipfs from [inside a Docker container](https://github.com/ipfs/go-ipfs#running-ipfs-inside-docker).
43
39
44
-
Power users can provide [custom config](https://github.com/ipfs/js-ipfs#faq) (e.g. to enable experimental pubsub) via the IPFS Companion [Preferences](https://user-images.githubusercontent.com/157609/38084660-0b97c0cc-334e-11e8-9368-823345ced67f.png)
40
+
## Native
45
41
46
-
**Note:** At present, embedded js-ipfs running within webextension (browser context) comes with some limitations:
42
+
### Provided by Brave
47
43
48
-
- Can't act as an HTTP gateway (extension uses public one as a fallback)
49
-
- Known to be CPU-hungry
50
-
([#450](https://github.com/ipfs-shipyard/ipfs-companion/issues/450), [ipfs/js-ipfs#1190](https://github.com/ipfs/js-ipfs/issues/1190)) over time, which may drain your battery
- An embedded node _does not run_ when external node is selected.; every time you switch back to the embedded node, a new instance is created on-demand, and it can take a few seconds for a brand new node to find peers
44
+
Users of the [Brave](https://brave.com/) browser (v1.19 or later) can enable native support for IPFS using a go-ipfs node built directly into the browser itself. This is a great way to experiment with IPFS without having to install or run IPFS Desktop or the command-line daemon.
56
45
57
-
**When in doubt, run go-ipfs as an external node instead.**
46
+
This node type offers the same benefits as an [external](#external) node, with additional features provided within Brave itself:
58
47
59
-
## Embedded + `chrome.sockets`
48
+
- Native support for `ipfs://` and `ipns://` URIs:
49
+
- Built-in fallback to a public gateway.
50
+
- Ability to change your preferred public gateway from Brave's settings page.
51
+
- Options for default resolution of IPFS resources: through a public gateway, through a local node, or asking each time.
52
+
- The IPFS node is managed by Brave itself:
53
+
- Automatic go-ipfs updates and migrations.
54
+
- Your node is only running when Brave is open.
55
+
- You can start/stop your Brave-based node by clicking the power button icon in IPFS Companion's main menu.
60
56
61
-
This node type replaces the regular _embedded_ type if the browser vendor grants us access to `chrome.sockets` APIs. These powerful APIs enable embedded js-ipfs to provide a true p2p experience without the need for an external daemon:
Popular URI for triggering and testing native IPFS support
61
+
-`brave://settings/extensions`
62
+
One-click Companion install and URI resolution settings
63
+
-`brave://ipfs`
64
+
Status page for Brave's built-in go-ipfs node
65
+
66
+
:::
67
+
68
+
## Embedded
64
69
65
-
- Access IPFS resources over HTTP without relying on a public gateway
66
-
- Automatically pick a free localhost port
70
+
An _embedded_ node is a js-ipfs instance running in the browser in-memory, without the need for any external software.
67
71
68
-
### TCP transport
72
+
::: warning
69
73
70
-
- Embedded js-ipfs is able to connect to go-ipfs
71
-
- go-ipfs is able to connect to embedded js-ipfs
74
+
This node type is only for development and experimentation. Most users should use [external](#external) or [native](#native) node types instead.
72
75
73
-
### Local discovery (mDNS/DNS-SD)
76
+
:::
77
+
78
+
Power users can provide [custom config](https://github.com/ipfs/js-ipfs#faq) (e.g. to enable experimental pubsub) via the IPFS Companion [Preferences](https://user-images.githubusercontent.com/157609/38084660-0b97c0cc-334e-11e8-9368-823345ced67f.png)
79
+
80
+
Please note that there are some limitations when running an embedded js-ipfs instance in the browser context using Companion:
81
+
82
+
- Embedded js-ipfs cannot act as an HTTP gateway; the extension uses a public one as a fallback.
83
+
- Running an embedded js-ipfs instance is known to be CPU-hungry over time, which may drain your battery. See GitHub issues ([#450](https://github.com/ipfs-shipyard/ipfs-companion/issues/450) and [ipfs/js-ipfs#1190](https://github.com/ipfs/js-ipfs/issues/1190)) for further details
84
+
- Missing DHT (see [js-ipfs/#856](https://github.com/ipfs/js-ipfs/pull/856)).
85
+
- Default transports limited to websockets ([js-ipfs/#1088](https://github.com/ipfs/js-ipfs/issues/1088)):
86
+
- Lack of connection closing ([ipfs/js-ipfs#962](https://github.com/ipfs/js-ipfs/issues/962))
- An embedded node _does not run_ when an external node is selected; every time you switch back to the embedded node, a new instance is created on demand, and it can take a few seconds for a newly running node to find peers.
74
89
75
-
- Embedded node discovers go-ipfs in the LAN and automatically connects to it
90
+
###Embedded + `chrome.sockets` (deprecated)
76
91
77
-
**Note:** This is still a work in progress. see [Embedded JS-IPFS in Brave](https://github.com/ipfs-shipyard/ipfs-companion/issues/716) for the current status.
92
+
::: warning
93
+
This node type has been deprecated and is no longer supported by Chromium browsers. While this option still appears in IPFS Companion preferences, users of this node type are strongly urged to migrate to a different node type.
94
+
:::
78
95
79
96
## Public
80
97
81
-
A _public_ node is not a part of the toggle UI. It is used as an implicit fallback for its gateway functionality when an external node is offline or an embedded node is used. It does not expose the API port.
98
+
A _public_ node is used as a fallback for gateway functionality when an external node is offline or an embedded node is used. It does not expose the API port. This type of node is not included as an option in Companion's preferences.
0 commit comments