Ws-star configuration options

Hi all!

I’m trying to figure out what the new config should be for ws-star. Previously this used to work ( from https://github.com/orbitdb/orbit-db/blob/master/examples/browser/example.js#L48-L68 )

const ipfs = new Ipfs({
    repo: '/orbitdb/examples/browser/new/ipfs/0.33.1',
    start: true,
    preload: { 
      enabled: false
    },
    EXPERIMENTAL: {
      pubsub: true,
    },
    config: {
      Addresses: {
        Swarm: [
          // Use IPFS dev signal server
          // '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
          '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
          // Use local signal server
          // '/ip4/0.0.0.0/tcp/9090/wss/p2p-webrtc-star',
        ]
      },
    }
  })

But now that results in a no valid addresses were provided for transports [WebSockets,WebRTCStar,Circuit]

What’s the right config?

1 Like

libp2p-websocket-star has not yet made the jump to async iterators so is not compatible with the latest libp2p - https://github.com/libp2p/js-libp2p-websocket-star/pull/77

I believe the intention is to replace it with libp2p-stardust instead - https://github.com/libp2p/js-libp2p-stardust

In the meantime libp2p-webrtc-star has been converted so should be good to use - https://github.com/libp2p/js-libp2p-webrtc-star

The exchange-files-in-browser js-ipfs example shows how to use libp2p-webrtc-star: https://github.com/ipfs/js-ipfs/blob/master/examples/exchange-files-in-browser/public/app.js#L49-L62 - see the readme for full details: https://github.com/ipfs/js-ipfs/blob/master/examples/exchange-files-in-browser/README.md

1 Like

Thank you for the thorough reply! I was getting a 502 from the webrtc rendevous the other day and I knw from before that the ws one worked which is why I was checking out.

I’ll go back to trying webrtc. Thank you for the links and info!

As a suggestion for the IPFS team… if you’re going to take something out that big players use (like orbitdb) then a little note would be nice in the docs. Also there’s a broken link here: https://github.com/ipfs/js-ipfs/blob/10e8682e44ed06fdcad849b7cb7e6a38dbd9ba49/docs/BROWSERS.md

2 Likes

Hmm - The public randevous server here: https://github.com/libp2p/js-libp2p-webrtc-star has a MA of /dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star/p2p/ and there is also an example here: https://github.com/ipfs/js-ipfs/blob/master/examples/exchange-files-in-browser/public/app.js#L55 but my code says those are invalid MAs. I think that’s because they are missing the /tcp/443 ?