Launch public circuit relays

I’m building a chat app using ipfs and orbitdb. I currently have a desktop app which works perfectly on local networks but as soon as the greater internet is involve, databases do not sync anymore. I think this can be resolved using circuit-relays and in the future the autoRelay feature, but I can’t find how to deploy my own circuit relay.

±----------------------------+               ±-----------------------------------+             ±---------------------------+
| Desktop app          |                | Public circuit relay      |               | Desktop app       |
| behind NAT            |    <==>    | on heroku or aws       |    <==>   | behind NAT        |
±----------------------------+               ±-----------------------------------+              ±----------------------------+

I followed the circuit-relaying tutorial, which works very well but is all run locally. But when deploying on an AWS instance for example I get a bunch of errors as the node being unreachable.

My ipfs config

const ipfsOptions = {
  //preload: { enabled: false },
  repo: "./ipfs",
  relay:{ enabled:true, hop: { enabled:true, active: true}},
  EXPERIMENTAL: { pubsub: true },
  config: {
    Bootstrap: [],
    Addresses: { Swarm: [
    "Gateway": "/ip4/"

Once the ipfs node is running inside the app, I’m trying to connect to the circuit relay as such
await ipfsNode.swarm.connect("/ip4/");

Anyone know what I’m doing wrong or if what I want to do can work?

You are trying to dial a node using a TCP address, when your node does not have a TCP transport.

Browser does not support TCP, so you will need to connect to a websockets address of the relay.

1 Like