From a4aa7b028609c728cb9180f037a9beb45fd4204c Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 5 Feb 2024 03:36:49 -0500 Subject: [PATCH] Download arm64 Monero on arm64 --- orchestration/src/coins/monero.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/orchestration/src/coins/monero.rs b/orchestration/src/coins/monero.rs index 8f6828e74..d6129306d 100644 --- a/orchestration/src/coins/monero.rs +++ b/orchestration/src/coins/monero.rs @@ -12,6 +12,14 @@ fn monero_internal( ) { const MONERO_VERSION: &str = "0.18.3.1"; + let arch = match std::env::consts::ARCH { + // We probably would run this without issues yet it's not worth needing to provide support for + "x86" | "arm" => panic!("unsupported architecture, please download a 64-bit OS"), + "x86_64" => "x64", + "aarch64" => "armv8", + _ => panic!("unsupported architecture"), + }; + #[rustfmt::skip] let download_monero = format!(r#" FROM alpine:latest as monero @@ -19,16 +27,16 @@ FROM alpine:latest as monero RUN apk --no-cache add gnupg # Download Monero -RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v{MONERO_VERSION}.tar.bz2 +RUN wget https://downloads.getmonero.org/cli/monero-linux-{arch}-v{MONERO_VERSION}.tar.bz2 # Verify Binary -- fingerprint from https://github.com/monero-project/monero-site/issues/1949 ADD orchestration/{}/coins/monero/hashes-v{MONERO_VERSION}.txt . RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-options no-self-sigs-only --receive-keys 81AC591FE9C4B65C5806AFC3F0AF4D462A0BDF92 && \ gpg --verify hashes-v{MONERO_VERSION}.txt && \ - grep "$(sha256sum monero-linux-x64-v{MONERO_VERSION}.tar.bz2 | cut -c 1-64)" hashes-v{MONERO_VERSION}.txt + grep "$(sha256sum monero-linux-{arch}-v{MONERO_VERSION}.tar.bz2 | cut -c 1-64)" hashes-v{MONERO_VERSION}.txt # Extract it -RUN tar -xvjf monero-linux-x64-v{MONERO_VERSION}.tar.bz2 --strip-components=1 +RUN tar -xvjf monero-linux-{arch}-v{MONERO_VERSION}.tar.bz2 --strip-components=1 "#, network.folder(), );