functionland / fula-archived

Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
https://fx.land
MIT License
4 stars 0 forks source link

Print Swarm Listen On #228

Closed farhoud closed 2 years ago

farhoud commented 2 years ago

Fixes #225

gitaaron commented 2 years ago

Yes my concern is it may get mixed up with ipfs. Thanks 👍

On Tue., Jun. 21, 2022, 10:30 a.m. Farhoud, @.***> wrote:

@.**** commented on this pull request.

In apps/box/src/utils.ts https://github.com/functionland/fula/pull/228#discussion_r902696951:

  • // 'IPv4' is in Node <= 17, from 18 it's a number 4 or 6
  • const familyV4Value = typeof net.family === 'string' ? 'IPv4' : 4
  • if (net.family === familyV4Value && !net.internal) {
  • if (net.address)
  • ips.push(net.address);
  • }
  • } +}
  • +export const printSwarm = (peerId, multiaddrs) => {

  • for (const ma of multiaddrs) {
  • if (ma.toString().includes('0.0.0.0')) {
  • for (const localip of ips) {
  • console.log(Swarm listening on ${ma.toString().replace('0.0.0.0', localip)}/p2p/${peerId.toB58String()})}
  • } else {
  • console.log(Swarm listening on ${ma.toString()}/p2p/${peerId.toB58String()})

Oh I just mimic the js-ipfs. We can change it.

— Reply to this email directly, view it on GitHub https://github.com/functionland/fula/pull/228#discussion_r902696951, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFDZ3ILKST37FM3NUSZJLVQHGYDANCNFSM5ZL73Z3A . You are receiving this because your review was requested.Message ID: @.***>