From c959f54c48f1b29d3d6392c8cc2fe6178592c5e7 Mon Sep 17 00:00:00 2001 From: neodiX Date: Fri, 14 Jun 2024 12:17:21 +0200 Subject: [PATCH] update zero state with the latest config version; adjust FIFTPATH according to the new rules for windows --- .../org/ton/executors/createstate/CreateStateExecutor.java | 7 ++++++- .../resources/org/ton/binaries/patches/gen-zerostate.fif | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/ton/executors/createstate/CreateStateExecutor.java b/src/main/java/org/ton/executors/createstate/CreateStateExecutor.java index 1e6000a..2ed4497 100644 --- a/src/main/java/org/ton/executors/createstate/CreateStateExecutor.java +++ b/src/main/java/org/ton/executors/createstate/CreateStateExecutor.java @@ -4,6 +4,7 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.SystemUtils; +import org.ton.java.utils.Utils; import org.ton.settings.Node; import java.io.File; @@ -28,7 +29,11 @@ public String execute(Node node, String... command) { ProcessBuilder pb = new ProcessBuilder(withBinaryCommand).redirectErrorStream(true); Map env = pb.environment(); - env.put("FIFTPATH", node.getTonBinDir() + "lib" + ":" + node.getTonBinDir() + "smartcont"); + if ((Utils.getOS() == Utils.OS.WINDOWS) || (Utils.getOS() == Utils.OS.WINDOWS_ARM)) { + env.put("FIFTPATH", node.getTonBinDir() + "lib" + "@" + node.getTonBinDir() + "smartcont"); + } else { + env.put("FIFTPATH", node.getTonBinDir() + "lib" + ":" + node.getTonBinDir() + "smartcont"); + } pb.directory(new File(node.getTonBinDir() + "zerostate" + File.separator)); Process p = pb.start(); diff --git a/src/main/resources/org/ton/binaries/patches/gen-zerostate.fif b/src/main/resources/org/ton/binaries/patches/gen-zerostate.fif index fcdebaf..e033344 100644 --- a/src/main/resources/org/ton/binaries/patches/gen-zerostate.fif +++ b/src/main/resources/org/ton/binaries/patches/gen-zerostate.fif @@ -132,7 +132,7 @@ Masterchain swap * */ // version capabilities -1 capCreateStats capBounceMsgBody or capReportVersion or capShortDequeue or config.version! +8 capCreateStats capBounceMsgBody or capReportVersion or capShortDequeue or config.version! // max-validators max-main-validators min-validators MAX_VALIDATORS MAX_MAIN_VALIDATORS MIN_VALIDATORS config.validator_num! // min-stake max-stake min-total-stake max-factor