/// this fn will be used in a dockerized context to write infos
/// like peer_id, multiaddress into a redis slot.
this fn will be used in a dockerized context to write infos
like peer_id, multiaddress into a redis slot.
this fn will be used in a dockerized context to write infos like peer_id multiaddress into a redis slot .
async fn write_infos(timeout: u64, peer_id: String, multiaddr: String) -> Result<(), Box<dyn Error>> {
    let client = Client::open(REDIS_INSTANCE_ADDR)?;
    let mut connection = client.get_connection_with_timeout(std::time::Duration::from_millis(timeout))?;
    connection.set::<String, String, ()>(REDIS_KEY_PEER_ID.to_string(), peer_id)?;
    connection.set::<String, String, ()>(REDIS_KEY_MULTI_ADDR.to_string(), multiaddr)?;
    Ok(())
}
async fn write_infos ( timeout : u64 , peer_id : String , multiaddr : String ) -> Result < ( ) , Box < dyn Error > > { let client = Client :: open ( REDIS_INSTANCE_ADDR ) ? ; let mut connection = client . get_connection_with_timeout ( std :: time :: Duration :: from_millis ( timeout ) ) ? ; connection . set :: < String , String , ( ) > ( REDIS_KEY_PEER_ID . to_string ( ) , peer_id ) ? ; connection . set :: < String , String , ( ) > ( REDIS_KEY_MULTI_ADDR . to_string ( ) , multiaddr ) ? ; Ok ( ( ) ) }
this fn will be used in a dockerized context to write infos
like peer_id, multiaddress into a redis slot.
this fn will be used in a dockerized context to write infos like peer_id multiaddress into a redis slot .
timeout
u64
peer_id
String
multiaddr
String