mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Rename the coins folder to networks (#583)
* Rename the coins folder to networks Ethereum isn't a coin. It's a network. Resolves #357. * More renames of coins -> networks in orchestration * Correct paths in tests/ * cargo fmt
This commit is contained in:
55
orchestration/src/networks/bitcoin.rs
Normal file
55
orchestration/src/networks/bitcoin.rs
Normal file
@@ -0,0 +1,55 @@
|
||||
use std::path::Path;
|
||||
|
||||
use crate::{Network, Os, mimalloc, os, write_dockerfile};
|
||||
|
||||
pub fn bitcoin(orchestration_path: &Path, network: Network) {
|
||||
#[rustfmt::skip]
|
||||
const DOWNLOAD_BITCOIN: &str = r#"
|
||||
FROM alpine:latest as bitcoin
|
||||
|
||||
ENV BITCOIN_VERSION=27.1
|
||||
|
||||
RUN apk --no-cache add git gnupg
|
||||
|
||||
# Download Bitcoin
|
||||
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-$(uname -m)-linux-gnu.tar.gz \
|
||||
&& wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
|
||||
&& wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
|
||||
|
||||
# Verify all sigs and check for a valid signature from laanwj -- 71A3
|
||||
RUN git clone https://github.com/bitcoin-core/guix.sigs && \
|
||||
cd guix.sigs/builder-keys && \
|
||||
find . -iname '*.gpg' -exec gpg --import {} \; && \
|
||||
gpg --verify --status-fd 1 --verify ../../SHA256SUMS.asc ../../SHA256SUMS | grep "^\[GNUPG:\] VALIDSIG.*71A3B16735405025D447E8F274810B012346C9A6"
|
||||
|
||||
RUN grep bitcoin-${BITCOIN_VERSION}-$(uname -m)-linux-gnu.tar.gz SHA256SUMS | sha256sum -c
|
||||
|
||||
# Prepare Image
|
||||
RUN tar xzvf bitcoin-${BITCOIN_VERSION}-$(uname -m)-linux-gnu.tar.gz
|
||||
RUN mv bitcoin-${BITCOIN_VERSION}/bin/bitcoind .
|
||||
"#;
|
||||
|
||||
let setup = mimalloc(Os::Debian).to_string() + DOWNLOAD_BITCOIN;
|
||||
|
||||
let run_bitcoin = format!(
|
||||
r#"
|
||||
COPY --from=bitcoin --chown=bitcoin bitcoind /bin
|
||||
|
||||
EXPOSE 8332 8333
|
||||
|
||||
ADD /orchestration/{}/networks/bitcoin/run.sh /
|
||||
CMD ["/run.sh"]
|
||||
"#,
|
||||
network.label()
|
||||
);
|
||||
|
||||
let run = os(Os::Debian, "", "bitcoin") + &run_bitcoin;
|
||||
let res = setup + &run;
|
||||
|
||||
let mut bitcoin_path = orchestration_path.to_path_buf();
|
||||
bitcoin_path.push("networks");
|
||||
bitcoin_path.push("bitcoin");
|
||||
bitcoin_path.push("Dockerfile");
|
||||
|
||||
write_dockerfile(bitcoin_path, &res);
|
||||
}
|
||||
Reference in New Issue
Block a user