Skip to content

Commit 18e8d00

Browse files
SgtPookilidelElPaisano
authored
feat: update /concepts/nodes page (#1624)
--------- Co-authored-by: Marcin Rataj <[email protected]> Co-authored-by: ElPaisano <[email protected]>
1 parent 721df2e commit 18e8d00

File tree

1 file changed

+30
-91
lines changed

1 file changed

+30
-91
lines changed

docs/concepts/nodes.md

Lines changed: 30 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
22
title: "Nodes"
3-
description: "Participants in the IPFS network are called nodes. Nodes are the most important aspect of IPFS - without nodes running the IPFS daemon, there would be no IPFS network. This page discusses what nodes are, current IPFS implementations, and the types of services different nodes can offer."
3+
description: "Participants in the IPFS network are called nodes. Nodes are the most important aspect of IPFS - without nodes running the IPFS daemon, there would be no IPFS network. This page discusses what nodes are, current IPFS implementations, and the types of services different nodes can offer."
44
sidebarDepth: 2
55
---
66

77
# Nodes
88

9-
Participants in the IPFS network are called _nodes_. Nodes are an IPFS program that you run on your local computer to store files and connect to the IPFS network. They're the most crucial aspect of IPFS. Without nodes running the IPFS daemon (explained below), there would be no IPFS Network.
9+
Participants in the IPFS network are called _nodes_. A _node_ is a program or process implementing IPFS that you run on your local computer (directly or via a browser) to store files and connect to the IPFS network. They're the most crucial aspect of IPFS. Without nodes running as an IPFS _daemon_ (explained below), there would be no IPFS Network.
1010

1111
You're likely to see the term _node_ throughout the IPFS docs, issues, and related code. It's a very general term, so its meaning depends on the context. There are three main categories of nodes: IPFS nodes, data nodes, and libp2p nodes for applications.
1212

1313
* __IPFS Nodes__ are programs that run on a computer that can exchange data with other IPFS nodes. They go by several different names, but we refer to them by a different term, depending on the context:
14-
* _node_: Use _node_ when you're referring to an individual point on the network. It's a very general term. For example, when you open IPFS Desktop, you establish yourself as a node with the potential to interact with other nodes. See [Configure a node](https://docs.ipfs.tech/how-to/configure-node/).
15-
* _peer_: Use _peer_ when you're talking about the relationship of one node (even your own) to other nodes. It refers to their relationship as equals, with no central authority, so your node is a peer to other peers. See [Observe peers](../how-to/observe-peers.md) and [Peering with content providers](../how-to/peering-with-content-providers.md).
16-
* _daemon_: Use _daemon_ when talking about a node's activity status. When a node is online and running in the background, listening for requests for its data, it's called a _daemon_. See [Take your node online](../how-to/command-line-quick-start.md#take-your-node-online)
17-
* _instance_: Use _instance_ when talking about a library or program, such as a Go or JS version, running on an IPFS node at a particular point in time. The peer ID is the same, so it's still the same _node_ as far as the IPFS network is concerned. See [Kubo](../reference/go/api.md) and [JS-IPFS](../reference/js/api.md#ipfs-and-javascript).
14+
15+
* _node_: Use _node_ when you're referring to an individual point on the network. It's a very general term. For example, when you open IPFS Desktop, you establish yourself as a node with the potential to interact with other nodes. See [Configure a node](../how-to/configure-node.md).
16+
* _peer_: Use _peer_ when you're talking about the relationship of one node (even your own) to other nodes. It refers to their relationship as equals, with no central authority, so your node is a peer to other peers. See [Observe peers](../how-to/observe-peers.md), [Exchange files between nodes](../how-to/exchange-files-between-nodes.md), and [Peering with content providers](../how-to/peering-with-content-providers.md).
17+
* _daemon_: Use _daemon_ when talking about a node's activity status. When a node is online and running in the background, listening for requests for its data, it's called a _daemon_. See [Take your node online](../how-to/command-line-quick-start.md#take-your-node-online). Note that an IPFS Helia _node_ in the browser is not generally referred to as a _daemon_. However, in the context of this document, we will refer to a Helia _instance_ acting as a _node_ in the browser as a _daemon_ . For more information, see the [Helia documentation](https://github.com/ipfs/helia/wiki).
18+
* _instance_: Use _instance_ when talking about a library or program, such as a Go or JS version, running on as an IPFS node at a particular point in time. The peer ID is the same, so it's still the same _node_ as far as the IPFS network is concerned. See [Kubo](../reference/go/api.md) and [Helia](../reference/js/api.md#TODO_JS_IPFS_DEPRECATION).
1819

1920
* __Data nodes__, Use _data nodes_ when talking about actual pieces of data on IPFS, such as DAG nodes, UnixFS nodes, and IPLD nodes. When you add a file with the `ipfs add myfile.txt` command, IPFS breaks them up into several nodes that each contain a chunk of the file and are linked to each other. See [Merkle Directed Acyclic Graphs (DAGs)](../concepts/merkle-dag.md), [Unix File System (UnixFS)](../concepts/file-systems.md#unix-file-system-unixfs), and stay tuned for [InterPlanetary Linked Data (IPLD) model](../concepts/ipld.md) docs, which is in progress.
2021

@@ -25,128 +26,66 @@ You're likely to see the term _node_ throughout the IPFS docs, issues, and relat
2526

2627
There are different types of IPFS nodes. And depending on the use-case, a single IPFS node can serve one of many functions:
2728

28-
- [Preload](#preload)
2929
- [Relay](#relay)
3030
- [Bootstrap](#bootstrap)
3131
- [Delegate routing](#delegate-routing-node)
3232

33-
### Preload
34-
35-
Use to make a UnixFS DAG publicly available by calling `ipfs refs -r <CID>` on a randomly chosen preload node's HTTP API. This puts the CID in the preload nodes' wantlist, causing it to fetch the data from the user. Other nodes requesting the content can then resolve it from the preload node using bitswap, as the data is now present in the preload node’s blockstore.
36-
37-
#### Features of a preload node
38-
39-
- They are Kubo nodes with API ports exposed. Some HTTP API commands are accessible.
40-
- Used by JS-IPFS nodes running in browser contexts.
41-
- JS-ipfs nodes remain connected to the libp2p swarm ports of all preload nodes by having preload nodes on the bootstrap list.
42-
- Often on the same _server_ as a [delegate routing node](#delegate-routing-node), though both the delegate routing service and preload service are addressed differently. This is done by having different multiaddrs that resolve to the same machine.
43-
- Preload nodes are in the default JS-IPFS configuration as bootstrap nodes, so they will maintain libp2p swarm connections to them at all times.
44-
- They are configured as regular bootstrap nodes, but as a convention have the string 'preload' in their `/dnsaddr` multiaddrs.
45-
46-
#### Limitations of a preload node:
47-
48-
- Default preload nodes provided by Protocol Labs garbage collect every hour, so preloaded content only survives for that long. However, this is configurable. You can run nodes with customized policies.
49-
- Requires client to be smart about what gets preloaded: recursive preload of a big DAG.
50-
- Only works with dag-pb CIDs because that's all the refs command understands. It's harder to find non-dag-pb content, e.g., you need a connection to the publishing js-ipfs instance or it needs to be put on the DHT by a delegate node.
51-
5233
### Relay
5334

5435
If an IPFS node deems itself unreachable by the public internet, IPFS nodes may choose to use a relay node as a kind of VPN in an attempt to reach the unreachable node.
5536

5637
#### Features of a relay node
5738

58-
- Implements either [v1](https://github.com/libp2p/specs/blob/master/relay/circuit-v1.md) or [v2](https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md) of the Circuit Relay protocol.
59-
- Can be either Kubo or JS-IPFS nodes; however there are standalone implementations as well:
60-
- [js-libp2p-relay-server](https://github.com/libp2p/js-libp2p-relay-server) (supports circuit v1)
61-
- [go-libp2p-relay-daemon](https://github.com/libp2p/go-libp2p-relay-daemon) (supports circuit v1 & v2)
62-
- They're used by both Kubo and JS-IPFS nodes.
63-
- JS-IPFS nodes can also use relay nodes to overcome the lack of transport compatibility within the JS-IPFS implementation. A browser node with WebSockets/webRTC transports can talk with a Kubo node that only communicates through TCP using a relay that supports both transports. This is not enabled by default and needs to be set up.
39+
- Implements [v2](https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md) of the Circuit Relay protocol.
40+
- Can be either Kubo or Helia nodes; however there are standalone implementations as well:
41+
- [js-libp2p/circuit-relay](https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md#setup-with-relay)
42+
- [go-libp2p-relay-daemon](https://github.com/libp2p/go-libp2p-relay-daemon)
43+
- They're used by both Kubo and Helia nodes.
44+
- A Helia _node_ in the browser can't talk TCP, so a relay can help increase the number of _peers_ that can be communicated with. A Helia _node_ with browser-supported [transports](https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md#transport) can talk with a Kubo _peer_ with no overlapping transports using a relay _peer_ if that relay supports one transport from each other _peer_:
45+
1. At least one browser-supported transport (appropriate transports are [enabled by default in Helia browser _nodes_](https://github.com/ipfs/helia/blob/d2a928aa1590d5aa642c4c6747d5282f665af43f/packages/helia/src/utils/libp2p-defaults.browser.ts))
46+
2. At least one Kubo _peer_ supported transport.
6447

6548
#### Limitations of relay nodes:
66-
- v1 relays can be used by anyone without any limits, unless [go-libp2p-relay-daemon](https://github.com/libp2p/go-libp2p-relay-daemon) is used with ACLs (Access Control Lists) set up.
6749
- v2 relays are "limited relays" that are designed to be used for [Direct Connection Upgrade through Relay](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md) (aka hole punching).
6850
- Not configurable in Kubo; uses a preset list of relays
6951

7052
See [p2p-circuit relay](https://github.com/libp2p/specs/tree/master/relay)
7153

7254
### Bootstrap
7355

74-
Both Kubo and JS-IPFS nodes use bootstrap nodes to initially enter the DHT.
56+
Both Kubo and Helia _nodes_ use bootstrap _nodes_ to initially enter the DHT.
7557

7658
#### Features of a bootstrap node:
7759

78-
- All default bootstrap nodes are part of the public DHT.
79-
- The list of bootstrap nodes a JS-IPFS node connects to is configurable in their config files.
60+
- All default bootstrap _nodes_ are part of the public DHT.
61+
- The list of bootstrap _nodes_ a Helia _node_ connects to is controlled by configuring [libp2p's peerDiscovery option](https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md#peer-discovery).
8062

8163
#### Limitations of a bootstrap node:
8264

83-
- If an IPFS node only has one bootstrap node listed in that configuration and that bootstrap node goes offline, the IPFS node will lose access to the public DHT if it were to restart.
65+
- If an IPFS _node_ only has one bootstrap _node_ listed in that configuration and that bootstrap node goes offline, the IPFS node will lose access to the public DHT if it were to restart.
66+
- Note that you should be able to configure your _peer_ store in your implementation to cache healthy connectable _peers_ so you can connect to them again after a restart, instead of bootstrap _nodes_. [Kubo recently added support for this](https://github.com/ipfs/kubo/pull/8856).
8467

8568
[More about Bootstrapping](../how-to/modify-bootstrap-list.md)
8669

8770
### Delegate routing node
8871

89-
When IPFS nodes are unable to run Distributed Hash Table (DHT) logic on their own, they _delegate_ the task to a delegate routing node. Publishing works with arbitrary CID codecs (compression/decompression technology), as the [js-delegate-content module](https://github.com/libp2p/js-libp2p-delegated-content-routing/blob/master/src/index.ts) publishes CIDs at the block level rather than the IPLD or DAG level.
72+
When IPFS nodes are unable to run Distributed Hash Table (DHT) logic on their own, they _delegate_ the task to a delegate routing node. Publishing works with arbitrary CID codecs (compression/decompression technology), as the [js-libp2p-delegated-content-routing module](https://github.com/libp2p/js-libp2p-delegated-content-routing/blob/master/src/index.ts) publishes CIDs at the block level rather than the IPLD or DAG level.
9073

9174
#### Features of a delegate routing node:
9275

93-
- They are Kubo nodes with their API ports exposed and some API commands accessible under `/api/v0`.
94-
- Usable by both Kubo and JS-IPFS nodes.
95-
- JS-IPFS nodes use them to query the DHT and also publish content without having to actually run DHT logic on their own.
96-
- Often on the same _server_ as a [preload](#preload) node, though both the delegate routing service and preload service are addressed differently. This is done by having different multiaddrs that resolve to the same machine.
97-
- Delegate routing nodes are in the default JS-IPFS configuration as bootstrap nodes, so they will maintain libp2p swarm connections to them at all times.
98-
- They are configured as regular bootstrap nodes, but have the string 'preload' in their multiaddrs.
76+
- They are IPFS _nodes_ with their API ports exposed and some [Kubo RPC API](../reference/kubo/rpc.md) commands accessible at path `/api/v0`.
77+
- Usable by both Kubo and Helia _nodes_.
78+
- Helia _nodes_ can use them to query the DHT and also publish content without having to actually run DHT logic on their own.
79+
- The libp2p _node_ configured for a Helia _node_ can be configured for delegate routing by following instructions at in the [js-libp2p configuration doc](https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md#setup-with-content-and-peer-routing)
9980

10081
#### Limitations of a delegate routing node:
10182

102-
- On default delegate nodes provided by Protocol Labs, the garbage collection happens every hour, so provided content only survives for that long. If the uploading JS-IPFS node is still running, it will issue periodic re-provides using the same publishing mechanic, which extends the life of the content on the DHT.
83+
- On default delegate _nodes_ provided by Protocol Labs, the garbage collection happens every hour, so provided content only survives for that long.
84+
- Only Kubo is known to implement the [Kubo RPC API](../reference/kubo/rpc.md) at the time of writing.
85+
- There is a successor to the delegated routing functionality of the Kubo RPC API called [Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/)
10386

10487
## Implementations
10588

106-
Protocol Labs manages two implementations of the IPFS spec: Kubo and JS-IPFS. These implementations use specific types of nodes to perform server, browser, and other client functions.
107-
108-
### Kubo
109-
110-
An implementation of IPFS in Go. Designed to run on servers and user machines with full IPFS capabilities, enabling experimentation. New IPFS features are usually created on Kubo before any other implementation.
111-
More at [Github](https://github.com/ipfs/kubo#readme).
112-
113-
Features include:
114-
115-
- TCP and QUIC transports are enabled by default.
116-
- `/ws/` transport disabled by default.
117-
- HTTP gateway with subdomain support for origin isolation between content roots.
118-
- Various [experimental features](https://github.com/ipfs/kubo/blob/master/docs/experimental-features.md)
119-
120-
See [Working with Go](../reference/go/api.md#working-with-go) and [CLI Quick Start](../how-to/command-line-quick-start.md)
121-
122-
### JS-IPFS
123-
124-
:::warning
125-
#### js-ipfs being discontinued
126-
Development of the [js-ipfs project](https://github.com/ipfs/js-ipfs) is being discontinued to focus on [Helia](https://github.com/ipfs/helia), a leaner, more modular, modern implementation of IPFS in JavaScript scheduled for release in 2023. To learn more about Helia and the current state of IPFS in JS, see the [blog post](https://blog.ipfs.tech/state-of-ipfs-in-js/).
127-
128-
Because of this, js-ipfs tutorials may be out of date, and will eventually be archived.
129-
130-
:::
131-
132-
An implementation of IPFS written entirely in JavaScript. It runs in a browser, a Service Worker, Electron and Node.js. Capabilities depend on the runtime.
133-
134-
More at [js.ipfs.io](https://js.ipfs.io) and [Github](https://github.com/ipfs/js-ipfs#readme).
135-
136-
#### JS-IPFS node in a browser
137-
138-
When in a browser, runs with a limited set of IPFS capabilities.
139-
140-
Browser features include:
141-
142-
- Can connect to server nodes using secure WebSockets.
143-
- WSS requires manual setup of TLS at the server.
144-
- Can connect to a browser node using WebRTC using a centralized [ws-webrtc-star signaling service](https://github.com/libp2p/js-libp2p-webrtc-star).
145-
146-
Specific limitations of the JS-IPFS implementation are:
147-
148-
- Unless using WSS, a JS-IPFS node cannot connect to the main public DHT. They will only connect to other JS-IPFS nodes.
149-
- The performance of the DHT is not on-par with the Kubo implementation.
150-
- The HTTP gateway is present, but it has no subdomain support (can't open TCP port)
89+
Protocol Labs manages two implementations of the IPFS spec: Kubo and Helia. These implementations use specific types of _nodes_ to perform server, browser, and other client functions.
15190

152-
More at [js.ipfs.io](https://js.ipfs.io) and [Github](https://github.com/ipfs/js-ipfs#readme).
91+
[Read more about our implementations](./ipfs-implementations.md)

0 commit comments

Comments
 (0)