mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Extend orchestration as actually needed for testnet
Contains various bug fixes.
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
use std::{path::Path};
|
||||
|
||||
use zeroize::Zeroizing;
|
||||
use ciphersuite::{group::ff::PrimeField, Ciphersuite, Ristretto};
|
||||
|
||||
use crate::{Network, Os, mimalloc, os, build_serai_service, write_dockerfile};
|
||||
|
||||
pub fn serai(orchestration_path: &Path, network: Network) {
|
||||
pub fn serai(
|
||||
orchestration_path: &Path,
|
||||
network: Network,
|
||||
serai_key: &Zeroizing<<Ristretto as Ciphersuite>::F>,
|
||||
) {
|
||||
// Always builds in release for performance reasons
|
||||
let setup = mimalloc(Os::Debian).to_string() + &build_serai_service(true, "", "serai-node");
|
||||
let setup_fast_epoch =
|
||||
mimalloc(Os::Debian).to_string() + &build_serai_service(true, "fast-epoch", "serai-node");
|
||||
|
||||
// TODO: Review the ports exposed here
|
||||
let env_vars = [("KEY", hex::encode(serai_key.to_repr()))];
|
||||
let mut env_vars_str = String::new();
|
||||
for (env_var, value) in env_vars {
|
||||
env_vars_str += &format!(r#"{env_var}=${{{env_var}}}:="{value}"}} "#);
|
||||
}
|
||||
|
||||
let run_serai = format!(
|
||||
r#"
|
||||
# Copy the Serai binary and relevant license
|
||||
@@ -16,10 +28,10 @@ COPY --from=builder --chown=serai /serai/bin/serai-node /bin/
|
||||
COPY --from=builder --chown=serai /serai/AGPL-3.0 .
|
||||
|
||||
# Run the Serai node
|
||||
EXPOSE 30333 9615 9933 9944
|
||||
EXPOSE 30333 9944
|
||||
|
||||
ADD /orchestration/{}/serai/run.sh /
|
||||
CMD ["/run.sh"]
|
||||
CMD {env_vars_str} "/run.sh"
|
||||
"#,
|
||||
network.label(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user