How to get a public IP address with IPFS-JS

by orangeMint   Last Updated August 01, 2020 04:28 AM - source

With IPFS JS when I run this:

const ipfsNode = await IPFS.create();
const addresses = await ipfsNode.swarm.localAddrs();

I get this:

Swarm listening on /ip4/
Swarm listening on /ip4/
Swarm listening on /ip4/

But all of these are local/LAN addresses. How do I get a public ID so that from another node I can connect to this node over the internet like so: jsipfs swarm connect PUBLIC ADDRESS HERE?

Tags : nodejs ipfs

Related Questions

Ipfs.files.add promise throws error

Updated August 19, 2018 13:28 PM

how to retrieve stored data from blockchain?

Updated July 09, 2017 01:28 AM

uploading files to ipfs without refreshing page

Updated October 10, 2019 05:28 AM