Ejemplo n.º 1
0
func toPeerInfo(bootstrap config.BootstrapPeer) (p peer.PeerInfo, err error) {
	p = peer.PeerInfo{
		ID:    bootstrap.ID(),
		Addrs: []ma.Multiaddr{bootstrap.Multiaddr()},
	}
	return p, nil
}
Ejemplo n.º 2
0
func toPeerInfo(bp config.BootstrapPeer) peer.PeerInfo {
	// for now, we drop the "ipfs addr" part of the multiaddr. the rest
	// of the codebase currently uses addresses without the peerid part.
	m := bp.Multiaddr()
	s := ma.Split(m)
	m = ma.Join(s[:len(s)-1]...)

	return peer.PeerInfo{
		ID:    bp.ID(),
		Addrs: []ma.Multiaddr{m},
	}
}