How to get a public IP address with IPFS-JS

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

With IPFS JS when I run this:

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

I get this:

Swarm listening on /ip4/127.0.0.1/tcp/4002/p2p/PeeridFooBar
Swarm listening on /ip4/192.168.0.113/tcp/4002/p2p/PeeridFooBar
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/p2p/PeeridFooBar

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