(ha host.Host)
| 73 | } |
| 74 | |
| 75 | func GetHostAddress(ha host.Host) string { |
| 76 | // Build host multiaddress |
| 77 | hostAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s", ha.ID().String())) |
| 78 | |
| 79 | // Now we can build a full multiaddress to reach this host |
| 80 | // by encapsulating both addresses: |
| 81 | addr := ha.Addrs()[0] |
| 82 | return addr.Encapsulate(hostAddr).String() |
| 83 | } |