// join zerotier-one to the test network
join zerotier-one to the test network
join zerotier - one to the test network
pub async fn join(&self) -> Result<(), anyhow::Error> {
        let network = zerotier_one_api::types::Network {
            subtype_0: NetworkSubtype0 {
                allow_dns: Some(true),
                allow_global: Some(false),
                allow_default: Some(false),
                allow_managed: Some(true),
            },
            subtype_1: NetworkSubtype1 {
                status: None,
                type_: None,
                routes: Vec::new(),
                port_error: None,
                port_device_name: None,
                netconf_revision: None,
                name: None,
                multicast_subscriptions: Vec::new(),
                mtu: None,
                mac: None,
                id: None,
                dns: None,
                broadcast_enabled: None,
                bridge: None,
                assigned_addresses: Vec::new(),
                allow_dns: Some(true),
                allow_global: Some(false),
                allow_default: Some(false),
                allow_managed: Some(true),
            },
        };
        self.context
            .zerotier
            .update_network(&self.network.id.clone().unwrap(), &network)
            .await?;
        let id = self.network.id.clone().unwrap();
        let mut count = 0;
        while let Err(e) = get_listen_ips(&authtoken_path(None), &id).await {
            tokio::time::sleep(Duration::new(1, 0)).await;
            count += 1;
            if count >= 5 {
                warn!("5 attempts: While joining network: {:?}", e);
                count = 0;
            }
        }
        Ok(())
    }
pub async fn join ( & self ) -> Result < ( ) , anyhow :: Error > { let network = zerotier_one_api :: types :: Network { subtype_0 : NetworkSubtype0 { allow_dns : Some ( true ) , allow_global : Some ( false ) , allow_default : Some ( false ) , allow_managed : Some ( true ) , } , subtype_1 : NetworkSubtype1 { status : None , type_ : None , routes : Vec :: new ( ) , port_error : None , port_device_name : None , netconf_revision : None , name : None , multicast_subscriptions : Vec :: new ( ) , mtu : None , mac : None , id : None , dns : None , broadcast_enabled : None , bridge : None , assigned_addresses : Vec :: new ( ) , allow_dns : Some ( true ) , allow_global : Some ( false ) , allow_default : Some ( false ) , allow_managed : Some ( true ) , } , } ; self . context . zerotier . update_network ( & self . network . id . clone ( ) . unwrap ( ) , & network ) . await ? ; let id = self . network . id . clone ( ) . unwrap ( ) ; let mut count = 0 ; while let Err ( e ) = get_listen_ips ( & authtoken_path ( None ) , & id ) . await { tokio :: time :: sleep ( Duration :: new ( 1 , 0 ) ) . await ; count += 1 ; if count >= 5 { warn ! ( " " e ) ; count = 0 ; } } Ok ( ( ) ) }
join zerotier-one to the test network
join zerotier - one to the test network
&self