ceremonyclient/go-libp2p/core/host/helpers.go

12 lines
259 B
Go
Raw Normal View History

2023-08-21 03:50:38 +00:00
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(),
}
}