Skip to content

Commit

Permalink
Merge pull request #10 from mickvandijke/remove_feat_flags
Browse files Browse the repository at this point in the history
rebase
  • Loading branch information
grumbach authored Jan 10, 2025
2 parents dc7898e + d66ef0d commit e97def4
Show file tree
Hide file tree
Showing 47 changed files with 234 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
mkdir $ANT_DATA_PATH/client
ls -l $ANT_DATA_PATH
./target/release/ant --log-output-dest=data-dir file upload --public "./the-test-data.zip" > ./upload_output_second 2>&1
rg 'Total cost: 0 AttoTokens' ./upload_output_second -c --stats
rg 'All chunks already exist on the network.' ./upload_output_second -c --stats
env:
ANT_LOG: "all"
timeout-minutes: 25
Expand Down
40 changes: 20 additions & 20 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions ant-bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ license = "GPL-3.0"
name = "ant-bootstrap"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.2"
version = "0.1.3"

[features]
local = []

[dependencies]
ant-logging = { path = "../ant-logging", version = "0.2.43" }
ant-protocol = { path = "../ant-protocol", version = "0.3.2" }
ant-logging = { path = "../ant-logging", version = "0.2.44" }
ant-protocol = { path = "../ant-protocol", version = "0.3.3" }
atomic-write-file = "0.2.2"
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4.2.1", features = ["derive", "env"] }
Expand Down
2 changes: 1 addition & 1 deletion ant-build-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-build-info"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.22"
version = "0.1.23"
build = "build.rs"
include = ["Cargo.toml", "src/**/*", "build.rs"]

Expand Down
2 changes: 1 addition & 1 deletion ant-build-info/src/release_info.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const RELEASE_YEAR: &str = "2024";
pub const RELEASE_MONTH: &str = "12";
pub const RELEASE_CYCLE: &str = "1";
pub const RELEASE_CYCLE_COUNTER: &str = "7";
pub const RELEASE_CYCLE_COUNTER: &str = "8";
14 changes: 7 additions & 7 deletions ant-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["MaidSafe Developers <[email protected]>"]
name = "ant-cli"
description = "CLI client for the Autonomi network"
license = "GPL-3.0"
version = "0.3.2"
version = "0.3.3"
edition = "2021"
homepage = "https://maidsafe.net"
readme = "README.md"
Expand All @@ -24,11 +24,11 @@ name = "files"
harness = false

[dependencies]
ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" }
ant-build-info = { path = "../ant-build-info", version = "0.1.22" }
ant-logging = { path = "../ant-logging", version = "0.2.43" }
ant-protocol = { path = "../ant-protocol", version = "0.3.2" }
autonomi = { path = "../autonomi", version = "0.3.2", features = [
ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.3" }
ant-build-info = { path = "../ant-build-info", version = "0.1.23" }
ant-logging = { path = "../ant-logging", version = "0.2.44" }
ant-protocol = { path = "../ant-protocol", version = "0.3.3" }
autonomi = { path = "../autonomi", version = "0.3.3", features = [
"loud",
] }
clap = { version = "4.2.1", features = ["derive"] }
Expand Down Expand Up @@ -57,7 +57,7 @@ tracing = { version = "~0.1.26" }
walkdir = "2.5.0"

[dev-dependencies]
autonomi = { path = "../autonomi", version = "0.3.2" }
autonomi = { path = "../autonomi", version = "0.3.3" }
criterion = "0.5.1"
eyre = "0.6.8"
rand = { version = "~0.8.5", features = ["small_rng"] }
Expand Down
6 changes: 2 additions & 4 deletions ant-cli/src/actions/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

use autonomi::Client;
use autonomi::Multiaddr;
use autonomi::{get_evm_network_from_env, Client};
use color_eyre::eyre::bail;
use color_eyre::eyre::Result;
use indicatif::ProgressBar;
Expand All @@ -23,9 +23,7 @@ pub async fn connect_to_network(peers: Vec<Multiaddr>) -> Result<Client> {
progress_bar.set_message("Connecting to The Autonomi Network...");

match Client::init_with_peers(peers).await {
Ok(mut client) => {
let evm_network = get_evm_network_from_env()?;
client.set_evm_network(evm_network);
Ok(client) => {
info!("Connected to the Network");
progress_bar.finish_with_message("Connected to the Network");
Ok(client)
Expand Down
8 changes: 6 additions & 2 deletions ant-cli/src/commands/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ pub async fn upload(file: &str, public: bool, peers: Vec<Multiaddr>) -> Result<(

// get summary
let summary = upload_summary_thread.await?;
if summary.record_count == 0 {
if summary.records_paid == 0 {
println!("All chunks already exist on the network.");
} else {
println!("Successfully uploaded: {file}");
println!("At address: {local_addr}");
info!("Successfully uploaded: {file} at address: {local_addr}");
println!("Number of chunks uploaded: {}", summary.record_count);
println!("Number of chunks uploaded: {}", summary.records_paid);
println!(
"Number of chunks already paid/uploaded: {}",
summary.records_already_paid
);
println!("Total cost: {} AttoTokens", summary.tokens_spent);
}
info!("Summary for upload of file {file} at {local_addr:?}: {summary:?}");
Expand Down
2 changes: 1 addition & 1 deletion ant-cli/src/commands/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub async fn create(name: &str, value: &str, public: bool, peers: Vec<Multiaddr>
}

let summary = upload_summary_thread.await?;
if summary.record_count == 0 {
if summary.records_paid == 0 {
println!("✅ The register already exists on the network at address: {address}.");
println!("No tokens were spent.");
} else {
Expand Down
10 changes: 7 additions & 3 deletions ant-cli/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ pub fn collect_upload_summary(
let stats_thread = tokio::spawn(async move {
let mut tokens_spent: Amount = Amount::from(0);
let mut record_count = 0;
let mut records_already_paid = 0;

loop {
tokio::select! {
event = event_receiver.recv() => {
match event {
Some(ClientEvent::UploadComplete(upload_summary)) => {
tokens_spent += upload_summary.tokens_spent;
record_count += upload_summary.record_count;
record_count += upload_summary.records_paid;
records_already_paid += upload_summary.records_already_paid;
}
None => break,
}
Expand All @@ -41,14 +43,16 @@ pub fn collect_upload_summary(
match event {
ClientEvent::UploadComplete(upload_summary) => {
tokens_spent += upload_summary.tokens_spent;
record_count += upload_summary.record_count;
record_count += upload_summary.records_paid;
records_already_paid += upload_summary.records_already_paid;
}
}
}

UploadSummary {
tokens_spent,
record_count,
records_paid: record_count,
records_already_paid,
}
});

Expand Down
4 changes: 2 additions & 2 deletions ant-evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-evm"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.7"
version = "0.1.8"

[features]
local = ["evmlib/local"]
Expand All @@ -16,7 +16,7 @@ test-utils = []

[dependencies]
custom_debug = "~0.6.1"
evmlib = { path = "../evmlib", version = "0.1.7" }
evmlib = { path = "../evmlib", version = "0.1.8" }
hex = "~0.4.3"
lazy_static = "1.4.0"
libp2p = { version = "0.54.1", features = ["identify", "kad"] }
Expand Down
2 changes: 1 addition & 1 deletion ant-logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-logging"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.2.43"
version = "0.2.44"

[dependencies]
chrono = "~0.4.19"
Expand Down
2 changes: 1 addition & 1 deletion ant-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-metrics"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.1.23"
version = "0.1.24"

[[bin]]
path = "src/main.rs"
Expand Down
Loading

0 comments on commit e97def4

Please sign in to comment.