diff --git a/README.md b/README.md index d54f1e5c7..bcf2523da 100644 --- a/README.md +++ b/README.md @@ -449,7 +449,7 @@ Below can be found some of the projects that are currently using Zombienet as in - [Composable](https://github.com/ComposableFi/composable) via `nix run "composable#devnet-picasso"` - [Gossamer](https://github.com/ChainSafe/gossamer/issues/2843) - [Oak/Turing/Neumann](https://github.com/OAK-Foundation/OAK-blockchain/tree/master/zombienets) -- [Hydradx](https://github.com/galacticcouncil/HydraDX-node/tree/master/rococo-local) +- [Hydradx](https://github.com/galacticcouncil/HydraDX-node/tree/master/launch-configs/zombienet) - [InvArch](https://github.com/InvArch/InvArch-Node/blob/34a6e2216bc79c9bcee2f2f4c0cd8243fe4dfc93/zombienet/rococo-and-tinkernet+basilisk.toml) - [Mangata](https://github.com/mangata-finance/mangata-node/tree/develop/devops/zombienet) - [Manta/Phala](https://github.com/Manta-Network/manta-indexer/pull/30) diff --git a/docs/src/projects.md b/docs/src/projects.md index e9a01f354..1e1a1c7c8 100644 --- a/docs/src/projects.md +++ b/docs/src/projects.md @@ -14,7 +14,7 @@ Below can be found some of the projects that are currently using Zombienet as in - [Acurast](https://github.com/Acurast/acurast-substrate/blob/10c3160a297ae6c3092ee692e6d3b632896fca65/Makefile) - [Gossamer](https://github.com/ChainSafe/gossamer/issues/2843) - [Oak/Turing/Neumann](https://github.com/OAK-Foundation/OAK-blockchain/tree/master/zombienets) -- [Hydradx](https://github.com/galacticcouncil/HydraDX-node/tree/master/rococo-local) +- [Hydradx](https://github.com/galacticcouncil/HydraDX-node/tree/master/launch-configs/zombienet) - [InvArch](https://github.com/InvArch/InvArch-Node/blob/34a6e2216bc79c9bcee2f2f4c0cd8243fe4dfc93/zombienet/rococo-and-tinkernet+basilisk.toml) - [Mangata](https://github.com/mangata-finance/mangata-node/tree/develop/devops/zombienet) - [Manta/Phala](https://github.com/Manta-Network/manta-indexer/pull/30) diff --git a/javascript/packages/cli/src/actions/setup.ts b/javascript/packages/cli/src/actions/setup.ts index 3e4c442c1..8079f9bd9 100644 --- a/javascript/packages/cli/src/actions/setup.ts +++ b/javascript/packages/cli/src/actions/setup.ts @@ -25,13 +25,13 @@ const options: OptIf = {}; * @returns */ export async function setup(params: any, opts?: any) { - // If the platform is MacOS then the repos needs to be cloned and run locally by the user + // If the platform is MacOS (intel) then the repos needs to be cloned and run locally by the user // as polkadot and/or polkadot-parachain do not release a valid binaries for MacOS - if (process.platform === "darwin") { + if (process.platform === "darwin" && process.arch !== "arm64") { console.log( `${decorators.red( "\n\n------------------------------------------------------------------------\n\nNote: ", - )} You are using MacOS. Please, clone Polkadot SDK from ` + + )} You are using MacOS (intel). Please, clone Polkadot SDK from ` + decorators.cyan("https://github.com/paritytech/polkadot-sdk") + ` \n in order to build the polkadot and/or polkadot-parachain locally.\n At the moment there is no binaries for MacOs as releases.` + decorators.red( @@ -42,16 +42,18 @@ export async function setup(params: any, opts?: any) { } console.log(decorators.green("\n\nšŸ§ŸšŸ§ŸšŸ§Ÿ ZombieNet Setup šŸ§ŸšŸ§ŸšŸ§Ÿ\n\n")); - if (!["linux"].includes(process.platform)) { + if (!isValidHost()) { console.log( - "Zombienet setup currently supports only linux. \n Alternative, you can use k8s or podman. For more read here: https://github.com/paritytech/zombienet#requirements-by-provider", + "Zombienet setup currently supports only linux(x64) and MacOS (arm64). \n Alternative, you can use k8s or podman. For more read here: https://github.com/paritytech/zombienet#requirements-by-provider", ); return; } console.log(decorators.green("Gathering latest releases' versions...\n")); + const arch_sufix = process.arch === "arm64" ? "aarch64-apple-darwin" : ""; + await new Promise((resolve) => { - latestPolkadotReleaseURL(POLKADOT_SDK, POLKADOT).then( + latestPolkadotReleaseURL(POLKADOT_SDK, `${POLKADOT}-${arch_sufix}`).then( (res: [string, string]) => { options[POLKADOT] = { name: POLKADOT, @@ -64,46 +66,47 @@ export async function setup(params: any, opts?: any) { }); await new Promise((resolve) => { - latestPolkadotReleaseURL(POLKADOT_SDK, POLKADOT_PREPARE_WORKER).then( - (res: [string, string]) => { - options[POLKADOT_PREPARE_WORKER] = { - name: POLKADOT_PREPARE_WORKER, - url: res[0], - size: res[1], - }; - resolve(); - }, - ); + latestPolkadotReleaseURL( + POLKADOT_SDK, + `${POLKADOT_PREPARE_WORKER}-${arch_sufix}`, + ).then((res: [string, string]) => { + options[POLKADOT_PREPARE_WORKER] = { + name: POLKADOT_PREPARE_WORKER, + url: res[0], + size: res[1], + }; + resolve(); + }); }); await new Promise((resolve) => { - latestPolkadotReleaseURL(POLKADOT_SDK, POLKADOT_EXECUTE_WORKER).then( - (res: [string, string]) => { - options[POLKADOT_EXECUTE_WORKER] = { - name: POLKADOT_EXECUTE_WORKER, - url: res[0], - size: res[1], - }; - resolve(); - }, - ); + latestPolkadotReleaseURL( + POLKADOT_SDK, + `${POLKADOT_EXECUTE_WORKER}-${arch_sufix}`, + ).then((res: [string, string]) => { + options[POLKADOT_EXECUTE_WORKER] = { + name: POLKADOT_EXECUTE_WORKER, + url: res[0], + size: res[1], + }; + resolve(); + }); }); await new Promise((resolve) => { - latestPolkadotReleaseURL(POLKADOT_SDK, POLKADOT_PARACHAIN).then( - (res: [string, string]) => { - options[POLKADOT_PARACHAIN] = { - name: POLKADOT_PARACHAIN, - url: res[0], - size: res[1], - }; - resolve(); - }, - ); + latestPolkadotReleaseURL( + POLKADOT_SDK, + `${POLKADOT_PARACHAIN}-${arch_sufix}`, + ).then((res: [string, string]) => { + options[POLKADOT_PARACHAIN] = { + name: POLKADOT_PARACHAIN, + url: res[0], + size: res[1], + }; + resolve(); + }); }); - // If the platform is MacOS then the polkadot repo needs to be cloned and run locally by the user - // as polkadot do not release a binary for MacOS if (params[0] === "all") { params = [POLKADOT, POLKADOT_PARACHAIN]; } @@ -165,6 +168,18 @@ export async function setup(params: any, opts?: any) { } // helper fns + +// Check if the host is a valid platform/arch +const isValidHost = (): boolean => { + const isValid = + process.platform === "linux" && process.arch === "x64" + ? true + : process.platform === "darwin" && process.arch === "arm64" + ? true + : false; + + return isValid; +}; // Download the binaries const downloadBinaries = async (binaries: string[]): Promise => { try { diff --git a/scripts/ci/docker/zombienet_injected.Dockerfile b/scripts/ci/docker/zombienet_injected.Dockerfile index f60647ea7..2dc7c3ad1 100644 --- a/scripts/ci/docker/zombienet_injected.Dockerfile +++ b/scripts/ci/docker/zombienet_injected.Dockerfile @@ -63,7 +63,7 @@ RUN mkdir -p /etc/zombie-net # USER nonroot # install rust -ENV RUST_VERSION=1.80.0 +ENV RUST_VERSION=1.81.0 RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION -y ENV PATH $PATH:/home/nonroot/.cargo/bin # install nextest diff --git a/tests/scale-net/0001-scale-net.toml b/tests/scale-net/0001-scale-net.toml index 55506695c..e6325a78e 100644 --- a/tests/scale-net/0001-scale-net.toml +++ b/tests/scale-net/0001-scale-net.toml @@ -9,12 +9,12 @@ chain = "rococo-local" [[relaychain.node_groups]] name = "a" - count = 1 + count = 2 {% include("./a-group.toml")%} [[relaychain.node_groups]] name = "b" - count = 1 + count = 2 {% include("./b-group.toml")%} {% for id in [100,200] %}