this.node.swarm.peers() seems to return an array of objects containing both multiaddress and peerId. Since the next section (Chapter 5) relies on getIpfsPeers returning an array of peerIds as strings in connectToCompanions, we need to get the peerId form the object.
this.node.swarm.peers()
seems to return an array of objects containing both multiaddress and peerId. Since the next section (Chapter 5) relies ongetIpfsPeers
returning an array of peerIds as strings inconnectToCompanions
, we need to get the peerId form the object.