providePeer = async (remoteNodeId, cancelPeer, peerCancelled) => {
    const remoteControl = provideRemoteControl(remoteNodeId);
    return remoteControl.connect(
      async () => {
        // eslint-disable-next-line no-use-before-define
        const peerId = await getPeerIdForNodeIdentifier(remoteNodeId);
        return provide(peerId, 'peer');
      },
      cancelPeer,
      peerCancelled,
    );
  }
@param {string} remoteNodeId
@param {(error: Error) => void} cancelPeer
@param {Promise<never>} peerCancelled