MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / GetHostAddress

Function GetHostAddress

IceFireDB-SQLProxy/utils/util.go:75–83  ·  view source on GitHub ↗
(ha host.Host)

Source from the content-addressed store, hash-verified

73}
74
75func 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}

Callers

nothing calls this directly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected