app_with_config_file/
app_with_config_file.rs

1use std::path::PathBuf;
2use tdn::prelude::*;
3
4#[tokio::main]
5async fn main() {
6    // use crate root directory's config.toml
7    let dir_path = PathBuf::from(".");
8    let config = Config::load(dir_path).await;
9
10    let (peer_addr, _send, mut out_recv) = start_with_config(config).await.unwrap();
11    println!("Example: peer id: {}", peer_addr.short_show());
12
13    while let Some(message) = out_recv.recv().await {
14        match message {
15            _ => {}
16        }
17    }
18}