go-libp2p-core/host/helpers.go

12 lines
259 B
Go

package host
import "github.com/libp2p/go-libp2p-core/peer"
// InfoFromHost returns a peer.AddrInfo struct with the Host's ID and all of its Addrs.
func InfoFromHost(h Host) *peer.AddrInfo {
return &peer.AddrInfo{
ID: h.ID(),
Addrs: h.Addrs(),
}
}