Skip to content

chore: Unbitrot tracker #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content-discovery/Cargo.toml
Original file line number Diff line number Diff line change
@@ -30,3 +30,5 @@ unused-async = "warn"
iroh = { version ="0.34", features = ["discovery-pkarr-dht"] }
iroh-base = "0.34"
iroh-blobs = { version = "0.34", features = ["rpc"] }
# explicitly specified until iroh minimal crates issues are solved, see https://github.com/n0-computer/iroh/pull/3255
tokio = { version = "1.44.1" }
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//! Command line arguments.
use clap::{Parser, Subcommand};
use iroh::NodeId;
use iroh_blobs::ticket::BlobTicket;
use iroh_blobs::{Hash, HashAndFormat};
use std::{
fmt::Display,
net::{SocketAddr, SocketAddrV4},
str::FromStr,
};

use clap::{Parser, Subcommand};
use iroh::NodeId;
use iroh_blobs::{ticket::BlobTicket, Hash, HashAndFormat};

#[derive(Parser, Debug)]
pub struct Args {
#[clap(subcommand)]
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ futures = { version = "0.3.25", optional = true }
rcgen = { version = "0.13.1", optional = true }
rustls = { version = "0.23", default-features = false, features = ["ring"], optional = true }
genawaiter = { version = "0.99.1", features = ["futures03"], optional = true }
tokio = { version = "1.36.0", optional = true }
tokio = { workspace = true, optional = true }
flume = "0.11.0"
tls = { path = "../tls", optional = true }

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use genawaiter::sync::Gen;
use std::{
collections::{BTreeMap, BTreeSet, HashSet},
net::{SocketAddr, SocketAddrV4, SocketAddrV6},
@@ -14,6 +13,7 @@ use futures::{
stream::FusedStream,
FutureExt, Stream, StreamExt,
};
use genawaiter::sync::Gen;
use iroh::{
discovery::{dns::DnsDiscovery, pkarr::PkarrPublisher, Discovery},
Endpoint, NodeId,
2 changes: 1 addition & 1 deletion content-discovery/iroh-mainline-tracker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ humantime = "2.1.0"
iroh = { workspace = true }
iroh-blobs = { workspace = true }
mainline = { version = "2.0.0", features = ["async"] }
pkarr = { version = "1.0.1", features = ["async"] }
pkarr = { version = "2.0.1", features = ["async"] }
postcard = { version = "1", default-features = false, features = ["alloc", "use-std"] }
iroh-quinn = "0.13"
rand = "0.8"
4 changes: 2 additions & 2 deletions content-discovery/iroh-mainline-tracker/src/options.rs
Original file line number Diff line number Diff line change
@@ -125,9 +125,9 @@ impl Options {
}
}
mod serde_duration {
use serde::{de::Deserializer, ser::Serializer};

use super::*;
use serde::de::Deserializer;
use serde::ser::Serializer;

pub fn serialize<S: Serializer>(duration: &Duration, serializer: S) -> Result<S::Ok, S::Error> {
if serializer.is_human_readable() {
9 changes: 4 additions & 5 deletions content-discovery/iroh-mainline-tracker/src/tracker.rs
Original file line number Diff line number Diff line change
@@ -29,6 +29,10 @@ use tokio::sync::oneshot;
mod tables;
mod util;

use self::{
tables::{ReadOnlyTables, ReadableTables, Tables},
util::PeekableFlumeReceiver,
};
use crate::{
io::{log_connection_attempt, log_probe_attempt},
iroh_blobs_util::{
@@ -38,11 +42,6 @@ use crate::{
task_map::TaskMap,
};

use self::{
tables::{ReadOnlyTables, ReadableTables, Tables},
util::PeekableFlumeReceiver,
};

/// The tracker server.
///
/// This is a cheaply cloneable handle to the state and the options.