Skip to content

Commit

Permalink
Merge pull request #898 from freenet/186464459-testing-tool
Browse files Browse the repository at this point in the history
186464459 - Add a testing framework for running simulations
  • Loading branch information
iduartgomez authored Nov 21, 2023
2 parents 206ed21 + 4ba6954 commit cf8a433
Show file tree
Hide file tree
Showing 61 changed files with 3,656 additions and 2,195 deletions.
29 changes: 14 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "freenet"
version = "0.0.6"
version = "0.0.7"
edition = "2021"
rust-version = "1.71.1"
publish = true
Expand Down Expand Up @@ -35,7 +35,6 @@ delegate = "0.10"
directories = "5"
either = { features = ["serde"], workspace = true }
fastrand = { workspace = true }
fs4 = "0.7"
futures = "0.3.21"
itertools = "0.11"
libp2p = { default-features = false, features = ["autonat", "dns", "ed25519", "identify", "macros", "noise", "ping", "tcp", "tokio", "yamux"], version = "0.52.3" }
Expand All @@ -54,7 +53,7 @@ sqlx = { features = ["runtime-tokio-rustls", "sqlite"], optional = true, version
stretto = { features = ["async", "sync"], version = "0.8" }
tar = { version = "0.4.38" }
thiserror = "1"
tokio = { features = ["fs", "macros", "rt-multi-thread", "sync"], version = "1" }
tokio = { features = ["fs", "macros", "rt-multi-thread", "sync", "process"], version = "1" }
tower-http = { features = ["fs", "trace"], version = "0.4" }
ulid = { features = ["serde"], version = "0.4" }
unsigned-varint = "0.7"
Expand All @@ -75,7 +74,7 @@ freenet-stdlib = { features = ["net"], workspace = true }
arbitrary = { features = ["derive"], version = "1" }
chrono = { features = ["arbitrary"], workspace = true }
freenet-stdlib = { features = ["net", "testing"], workspace = true }
itertools = "0.11"
itertools = "0.12"
pav_regression = "0.4.0"
pico-args = "0.5"
statrs = "0.16.0"
Expand Down
2 changes: 0 additions & 2 deletions crates/core/examples/gw_key

This file was deleted.

198 changes: 0 additions & 198 deletions crates/core/examples/p2p_network.rs

This file was deleted.

8 changes: 4 additions & 4 deletions crates/core/src/bin/freenet.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use clap::Parser;
use freenet::local_node::{Executor, NodeConfig, OperationMode};
use freenet::local_node::{Executor, OperationMode, PeerCliConfig};
use std::net::SocketAddr;

type DynError = Box<dyn std::error::Error + Send + Sync + 'static>;

async fn run(config: NodeConfig) -> Result<(), DynError> {
async fn run(config: PeerCliConfig) -> Result<(), DynError> {
match config.mode {
OperationMode::Local => run_local(config).await,
OperationMode::Network => Err("network mode not yet enabled".into()),
}
}

async fn run_local(config: NodeConfig) -> Result<(), DynError> {
async fn run_local(config: PeerCliConfig) -> Result<(), DynError> {
let port = config.port;
let ip = config.address;
freenet::config::Config::set_op_mode(OperationMode::Local);
Expand All @@ -22,7 +22,7 @@ async fn run_local(config: NodeConfig) -> Result<(), DynError> {

fn main() -> Result<(), DynError> {
freenet::config::set_logger();
let config = NodeConfig::parse();
let config = PeerCliConfig::parse();
let rt = tokio::runtime::Builder::new_multi_thread()
.worker_threads(4)
.enable_all()
Expand Down
Loading

0 comments on commit cf8a433

Please sign in to comment.