How does js-ipfs node join the cluster

I have a JS IPFs node running in the browser. How can I connect to the cluster of remote servers?

IPFS Cluster is a way of orchestrating storage across multiple go-IPFS nodes -

js-IPFS in the browser would not typically take part in an IPFS Cluster as it’s available storage space is comparatively small and it’s hard for remote nodes to dial in-browser nodes so it’s difficult to get content out of them without using content routing. The only transport you can really use is webrtc-star and go-IPFS doesn’t support it. You can go the other direction and dial a go-IPFS node from an in-browser node over websockets though.

Do you mean how do you connect to the IPFS network in general? If you’re running the latest js-IPFS (0.48.0 at the time of writing) it will connect to the bootstrappers, then use the DHT delegate nodes to search for content and find more peers.

Thank you for your reply, it is very useful to me.
When I run js-ipfs on node.js, how do I start and join the cluster?
I tried to run these lines of code, but the operation will report an error,

  1. Code:
    function ipfs_cluster() {
    const cluster = ipfsCluster(“localhost”, “9094”, {protocol: “http” });, id) => {
    err? console.error(err): console.log(id);

  2. Error:
    Error: connect ECONNREFUSED
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
    address: ‘’,
    port: 9094

I’m sure I started the “jsipfs daemon” command locally,
Or the second way is to run this line of code on node.js: const node = await IPFS.create(),
The node running on node.js has successfully connected to other peer nodes, indicating that jsipfs has been successfully started.
But it still reports errors when starting the cluster.

Am I missing something?

You are not running an ipfs-cluster peer.