Add examples

This commit is contained in:
Igor Katson 2023-11-19 22:48:19 +00:00
parent adb98a2d89
commit 2ebbc0a828
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
9 changed files with 541 additions and 30 deletions

View file

@ -35,3 +35,4 @@ clone_to_owned = {path="../clone_to_owned", package="librqbit-clone-to-owned", v
librqbit-core = {path="../librqbit_core", version = "2.2.1"}
[dev-dependencies]
tracing-subscriber = "0.3"

View file

@ -8,6 +8,8 @@ use tracing::info;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let info_hash = Id20::from_str("64a980abe6e448226bb930ba061592e44c3781a1").unwrap();
tracing_subscriber::fmt::init();
let dht = Dht::new().await.context("error initializing DHT")?;
let mut stream = dht.get_peers(info_hash).await?;