peerInfos function

Future<List<AddrInfo>> peerInfos(
  1. Peerstore ps,
  2. List<PeerId> peers
)

PeerInfos converts a slice of peer IDs to a slice of peer address information using a peerstore.

Implementation

Future<List<AddrInfo>> peerInfos(Peerstore ps, List<PeerId> peers) async {
  final futures = <Future<AddrInfo>>[];
  for (final p in peers) {
    futures.add(ps.peerInfo(p));
  }
  return await Future.wait(futures);
}