pub async fn setup_ingoing_peer<T: ExternalSharedState + Send + Sync + 'static>(
    port: u16,
    ext_shared_state: Arc<Mutex<T>>
) -> Result<Arc<Mutex<PeerSharedState>>, Box<dyn Error + Send + Sync>>