ceremonyclient/go-libp2p/core/host/helpers.go
2023-08-20 23:07:43 -05:00

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(),
}
}