diff --git a/crate/src/lib.rs b/crate/src/lib.rs index 019c612..24c831e 100644 --- a/crate/src/lib.rs +++ b/crate/src/lib.rs @@ -10,15 +10,16 @@ pub mod sync; // The current version of the sandbox node we want to point to. // Should be updated to the latest release of nearcore. -// Currently pointing to nearcore@v1.40.0 released on June 17, 2024 -pub const DEFAULT_NEAR_SANDBOX_VERSION: &str = "1.40.0/7dd0b5993577f592be15eb102e5a3da37be66271"; +// Currently pointing to nearcore@v2.0.0 released on August 5, 2024 +pub const DEFAULT_NEAR_SANDBOX_VERSION: &str = "2.0.0"; const fn platform() -> Option<&'static str> { #[cfg(all(target_os = "linux", target_arch = "x86_64"))] return Some("Linux-x86_64"); + // Darwin-x86_64 is not supported for some time now. #[cfg(all(target_os = "macos", target_arch = "x86_64"))] - return Some("Darwin-x86_64"); + return None; #[cfg(all(target_os = "macos", target_arch = "aarch64"))] return Some("Darwin-arm64"); @@ -95,8 +96,9 @@ pub fn install_with_version(version: &str) -> anyhow::Result { // Download binary into temp dir let bin_name = format!("near-sandbox-{}", normalize_name(version)); let dl_cache = Cache::at(&download_path(version)); - let bin_path = bin_url(version) - .ok_or_else(|| anyhow!("Unsupported platform: only linux-x86 and macos are supported"))?; + let bin_path = bin_url(version).ok_or_else(|| { + anyhow!("Unsupported platform: only linux-x86 and darwin-arm are supported") + })?; let dl = dl_cache .download(true, &bin_name, &["near-sandbox"], &bin_path) .map_err(anyhow::Error::msg) diff --git a/npm/.changeset/slimy-tables-matter.md b/npm/.changeset/slimy-tables-matter.md new file mode 100644 index 0000000..babebe6 --- /dev/null +++ b/npm/.changeset/slimy-tables-matter.md @@ -0,0 +1,5 @@ +--- +"near-sandbox": patch +--- + +Updated sandbox to 2.0.0 release. Removed ability to fetch darwin-x86_64 as it is not working for quite some time" diff --git a/npm/src/getBinary.ts b/npm/src/getBinary.ts index ac41934..6899020 100644 --- a/npm/src/getBinary.ts +++ b/npm/src/getBinary.ts @@ -6,7 +6,8 @@ function getPlatform() { const type = os.type(); const arch = os.arch(); - if ((type === "Linux" || type === "Darwin") && arch === "x64") { + // Darwind x86_64 is not supported for quite some time :( + if (type === "Linux" && arch === "x64") { return [type, "x86_64"]; } else if (type === "Darwin" && arch === "arm64") { return [type, "arm64"]; @@ -17,7 +18,7 @@ function getPlatform() { export function AWSUrl(): string { const [platform, arch] = getPlatform(); - return `https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore/${platform}-${arch}/1.40.0/7dd0b5993577f592be15eb102e5a3da37be66271/near-sandbox.tar.gz`; + return `https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore/${platform}-${arch}/2.0.0/sandbox.tar.gz`; } export function getBinary(name: string = "near-sandbox"): Promise {