# Trying orbitdb with jsipfs and webrtc

**URL:** <https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530>\
**Category:** js-ipfs\
**Tags:** js-ipfs, webrtc\
**Created:** [November 18, 2022, 5:09pm UTC](https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530 "2022-11-18T17:09:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshbhatt10](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/rakeshbhatt10/32/7175_2.png) [@rakeshbhatt10](https://discuss.ipfs.tech/u/rakeshbhatt10)\
**Post date:** [November 18, 2022, 5:09pm UTC](https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530/1 "2022-11-18T17:09:40Z")

</div>

Hi,

I am trying to use private network configuration for IPFS node setup.

Tried with custom bootstrap server over aws it worked fine but for better implementation wanted to try WebRTC implementation with IPFS

Requirement is to connect between multiple js-ipfs node through singling server (WebRTC (hosted over public ip)).

For peer discovery i deployed WebRTC server over an public instance made access to ports and everything. Now i just want to use WebRTC server no bootstrap mechanism for peer discovery.

I tried with lot of configuration and but nothing seems to be working if i remove private bootstrap server then ipfs node is taking all public bootstrap nodes by default.

There are no logs of connectivity on WebRTC server deployed

Not sure what should i do.

Should i stick with custom bootstrap implementation or i am not doing something right in configuration

Thanks for help in advance

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [November 18, 2022, 6:56pm UTC](https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530/2 "2022-11-18T18:56:46Z")

</div>

Hey there,

For general js-ipfs debugging tips and trick like logging I’d recommend checking out this video:

[![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/1/102c7db03d9d42b17fdf027aeb3010b85e0801c8.jpeg "Debugging js-ipfs and js-libp2p Like a Pro - Alex Potsides") ](https://www.youtube.com/watch?v=sHHJAVVFYAA)

WebRTC debugging in the browser can be a bit confusing because it doesn’t normally show in the Network tab of the debugger tools. With chrome, you can use the `chrome://webrtc-internals`.

Can you share more information about what kind of WebRTC Server you’re running?  
Is is [https://github.com/libp2p/js-libp2p-webrtc-star/tree/master/packages/webrtc-star-signalling-server](https://github.com/libp2p/js-libp2p-webrtc-star/tree/master/packages/webrtc-star-signalling-server)?

> Requirement is to connect between multiple js-ipfs node through singling server (WebRTC (hosted over public ip)).

I presume you’re trying to establish a connection between multiple browsers.

When instantiating `js-ipfs` in the browser, you should be adding the WebRTC star nodes to the swarm config:

```
  this.ipfs = await Ipfs.create({
    config: {
      Addresses: {
        Swarm: [
          '/dns4/YOU_WEBRTC_STAR_SERVER/tcp/443/wss/p2p-webrtc-star/',
        ]
      },
    }
  });

```

Would be great if you can share more information about your setup (packages, versions) and how you’re instantiating js-ipfs.

---

<div class="post-metadata">

**Author:** ![rakeshbhatt10](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/rakeshbhatt10/32/7175_2.png) [@rakeshbhatt10](https://discuss.ipfs.tech/u/rakeshbhatt10)\
**Post date:** [November 18, 2022, 8:10pm UTC](https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530/3 "2022-11-18T20:10:23Z")

</div>

Hi,

Thanks for quick response?

I am trying server to server connection between two ipfs nodes using WebRTC

i am using jsipfs to create node ,

```auto
{
      repo: 'repo_name',
      start: true,
      // eslint-disable-next-line @typescript-eslint/ban-ts-comment
      //@ts-ignore
      preload: {
        enabled: true,
      },
      EXPERIMENTAL: {
        ipnsPubsub: true,
      },
      relay: {
        enabled: true,
        hop: {
          enabled: true
        }
      },
      config: {
        Addresses: {
          Swarm: [
            // When running outside of the browser we can support TCP connections
            '/ip4/0.0.0.0/tcp/4015/',
            '/ip4/0.0.0.0/tcp/4023/ws',
            '/ip4/<public_ip_webrtc>/tcp/13579/wss/p2p-webrtc-star'
          ]
        },
        Bootstrap: [
          '/ip4/<Bootstrap server ip>/tcp/4003/ws/p2p/12D3KooWDuuNp8dSiuZPX7293Yx8HXTmyb2cALk8x4JiZkVBogcv',
          // '/ip4/127.0.0.1/tcp/4001/ws/p2p/12D3KooWGQdBm2ceUSgggojHNmCdesywimN7tiVcgEYcYViKS8y5',
          // '/dns4/ipfs-staging.steer.finance/tcp/4422/ws/p2p/12D3KooWGQdBm2ceUSgggojHNmCdesywimN7tiVc/gEYcYViKS8y5',
        ],
        Discovery: {
          // MDNS: {
          // Enabled: true,
          // Interval: 10
          // },
          webRTCStar: {
            Enabled: true,
          },
        },
      },
    }

```

I have tried with one more configuration which is below

```auto
{
    repo: 'your-repo-path',
    config: {
      Addresses: {
        Swarm: [
          "/ip4/0.0.0.0/tcp/4002",
          "/ip4/127.0.0.1/tcp/4003/ws",
          // "/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star",
          // "/dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star",
          '/ip4/<PUBLIC_IP_WEBRTC_SERVER>/tcp/13579/wss/p2p-webrtc-star'
        ]
      }
    },
    libp2p: {
      modules: {
        transport: [webRTCStar]
      },
      config: {
        peerDiscovery: {
          webRTCStar: { // <- note the lower-case w - simport * as IPFS from 'ipfs-core'ee https://github.com/libp2p/js-libp2p/issues/576
            enabled: true
          }
        },
        transport: {
          WebRTCStar: { // <- note the upper-case w- see https://github.com/libp2p/js-libp2p/issues/576
            wrtc
          }
        },
        Bootstrap: []
      }
    }
  }

```

WebRTC server [js-libp2p-webrtc-star/packages/webrtc-star-signalling-server at master · libp2p/js-libp2p-webrtc-star · GitHub](https://github.com/libp2p/js-libp2p-webrtc-star/tree/master/packages/webrtc-star-signalling-server)

Let me know if any other information is required

Thanks

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [November 21, 2022, 1:41pm UTC](https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530/4 "2022-11-21T13:41:24Z")

</div>

> [@rakeshbhatt10](#):
>
> I am trying server to server connection between two ipfs nodes using WebRTC

You cannot connect two IPFS nodes running in Node.js with WebRTC since Node.js doesn’t have native WebRTC support.

You can connect two js-ipfs nodes in Node.js with either TCP or WebSockets.

---

<div class="post-metadata">

**Author:** ![rakeshbhatt10](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/rakeshbhatt10/32/7175_2.png) [@rakeshbhatt10](https://discuss.ipfs.tech/u/rakeshbhatt10)\
**Post date:** [November 22, 2022, 7:10pm UTC](https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530/5 "2022-11-22T19:10:42Z")

</div>

Hi danieln,

Thanks for your reply.

Is it doable server to server connection (peer to perr) without browser using WebRTC on Go-ipfs

We are trying to implement rendezvous strategy for peer discovery. So for documentation we figured out its is good to use WebRTC

What should be our implementation in case of this requirement of server to server peer discovery for rendezvous strategy

Thanks

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [November 22, 2022, 7:26pm UTC](https://discuss.ipfs.tech/t/trying-orbitdb-with-jsipfs-and-webrtc/15530/6 "2022-11-22T19:26:23Z")

</div>

I recommend checking out this page [https://connectivity.libp2p.io/](https://connectivity.libp2p.io/)  
to better understand connectivity options.

If you main goal is to connect kubo (go-ipfs) nodes to each other, TCP and QUIC would be your choices (potentially web sockets too but that’s over TCP anyway)

If you plan on connecting browsers to those kubo nodes, that’s where WebRTC would be handy.
