Skip to content

Commit

Permalink
Merge branch 'main' into sk_default_wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
ermineJose authored Dec 10, 2024
2 parents 408cea7 + 4bcb4d4 commit d5ca48a
Show file tree
Hide file tree
Showing 42 changed files with 3,338 additions and 1,162 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,3 @@ jobs:
# Allow clippy lints (these can be pedantic on WASM), but deny regular Rust warnings
run: cargo clippy --target=wasm32-unknown-unknown --package=autonomi --lib --tests -- --allow=clippy::all --deny=warnings
timeout-minutes: 30

websocket:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: Standard Websocket builds
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Build all for `websockets`
run: cargo build --features="websockets"
timeout-minutes: 30
162 changes: 0 additions & 162 deletions .github/workflows/merge_websocket.yml

This file was deleted.

2 changes: 2 additions & 0 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ build-release-artifacts arch nightly="false":
cargo binstall --no-confirm cross
cross build --release --target $arch --bin nat-detection $nightly_feature
cross build --release --target $arch --bin node-launchpad $nightly_feature
cross build --release --features websockets --target $arch --bin ant $nightly_feature
cross build --release --features websockets --target $arch --bin antnode $nightly_feature
cross build --release --target $arch --bin ant $nightly_feature
cross build --release --target $arch --bin antnode $nightly_feature
cross build --release --target $arch --bin antctl $nightly_feature
cross build --release --target $arch --bin antctld $nightly_feature
cross build --release --target $arch --bin antnode_rpc_client $nightly_feature
else
cargo build --release --target $arch --bin nat-detection $nightly_feature
cargo build --release --target $arch --bin node-launchpad $nightly_feature
cargo build --release --features websockets --target $arch --bin ant $nightly_feature
cargo build --release --features websockets --target $arch --bin antnode $nightly_feature
cargo build --release --target $arch --bin ant $nightly_feature
cargo build --release --target $arch --bin antnode $nightly_feature
cargo build --release --target $arch --bin antctl $nightly_feature
cargo build --release --target $arch --bin antctld $nightly_feature
cargo build --release --target $arch --bin antnode_rpc_client $nightly_feature
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ More options about EVM Network below.

The Autonomi network uses `quic` as the default transport protocol.

The `websockets` feature is available for the `ant-networking` crate, and above, and will allow for
tcp over websockets.

If building for `wasm32` then `websockets` are enabled by default as this is the only method
available to communicate with a network as things stand. (And that network must have `websockets`
enabled.)

#### Building for wasm32

WASM support for the autonomi API is currently under active development. More docs coming soon.
Expand Down
10 changes: 8 additions & 2 deletions ant-bootstrap/src/cache_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,21 @@ impl BootstrapCacheStore {
/// Create a empty CacheStore from the given peers argument.
/// This also modifies the cfg if provided based on the PeersArgs.
/// And also performs some actions based on the PeersArgs.
///
/// `PeersArgs::bootstrap_cache_dir` will take precedence over the path provided inside `config`.
pub fn new_from_peers_args(
peers_arg: &PeersArgs,
cfg: Option<BootstrapCacheConfig>,
config: Option<BootstrapCacheConfig>,
) -> Result<Self> {
let config = if let Some(cfg) = cfg {
let mut config = if let Some(cfg) = config {
cfg
} else {
BootstrapCacheConfig::default_config()?
};
if let Some(bootstrap_cache_path) = peers_arg.get_bootstrap_cache_path()? {
config.cache_file_path = bootstrap_cache_path;
}

let mut store = Self::new(config)?;

// If it is the first node, clear the cache.
Expand Down
11 changes: 8 additions & 3 deletions ant-bootstrap/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use crate::error::{Error, Result};
use ant_protocol::version::{get_key_version_str, get_truncate_version_str};
use ant_protocol::version::{get_network_id, get_truncate_version_str};
use std::{
path::{Path, PathBuf},
time::Duration,
Expand Down Expand Up @@ -118,8 +118,13 @@ fn default_cache_path() -> Result<PathBuf> {

std::fs::create_dir_all(&dir)?;

let network_id = format!("{}_{}", get_key_version_str(), get_truncate_version_str());
let path = dir.join(format!("bootstrap_cache_{}.json", network_id));
let path = dir.join(cache_file_name());

Ok(path)
}

/// Returns the name of the cache file
pub fn cache_file_name() -> String {
let network_id = format!("{}_{}", get_network_id(), get_truncate_version_str());
format!("bootstrap_cache_{network_id}.json")
}
Loading

0 comments on commit d5ca48a

Please sign in to comment.