examples
examples copied to clipboard
How to get peer info to make a peer connection?
In https://github.com/ipfs/examples/tree/master/examples/network, I'm looking at
ipfs swarm connect /ip4/104.236.176.52/tcp/4001/ipfs/qmsolnsgccfuzqjzradhn95w2crsfmzutddwp8hxahca9z
and I'm curious if there is a simple way to get /ip4/104.236.176.52/tcp/4001/ipfs/qmsolnsgccfuzqjzradhn95w2crsfmzutddwp8hxahca9z
from the peer.
You should probably add that to the example :)
Seems like there's a couple ways. You could use the web UI or the command line. At the command line ipfs id will list the possible addresses under "Addresses":. Just pick the one you want to use. Any are likely to work except for the localhost if listed.
ipfs id is the best way. ipfs id needs some improvement:
- nice text format
-
<addrs>
formay key.
we could also add a command to ipfs swarm
like
> ipfs swarm addrs local
/ip4/127.0.0.1/tcp/4001/ipfs/QmbBHw1Xx9pUpAbrVZUKTPL5Rsph5Q9GQhRvcWVBPFgGtC
/ip4/127.94.0.1/tcp/4001/ipfs/QmbBHw1Xx9pUpAbrVZUKTPL5Rsph5Q9GQhRvcWVBPFgGtC
/ip4/192.168.1.103/tcp/4001/ipfs/QmbBHw1Xx9pUpAbrVZUKTPL5Rsph5Q9GQhRvcWVBPFgGtC
/ip4/76.176.168.65/tcp/4001/ipfs/QmbBHw1Xx9pUpAbrVZUKTPL5Rsph5Q9GQhRvcWVBPFgGtC
/ip4/192.168.0.2/tcp/56406/ipfs/QmbBHw1Xx9pUpAbrVZUKTPL5Rsph5Q9GQhRvcWVBPFgGtC
or something.