From 47776f430bad40352a6167a036bc0430c6f49b74 Mon Sep 17 00:00:00 2001 From: Willem Date: Wed, 19 Jul 2023 13:31:26 +0200 Subject: [PATCH] Updated to holepush drives dat tool --- README.md | 2 +- .../warp-ship.xml} | 0 .../gdxapp4d/tos4/GDXAppTos4Activator.java | 38 +++++++++---------- 3 files changed, 18 insertions(+), 22 deletions(-) rename gdxapp4d-boot-desktop/{local-ship.xml => Warpship/warp-ship.xml} (100%) diff --git a/README.md b/README.md index b241ae95..2984b575 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Now we can delete all data from the blockchain. Requirements; * 8GB of free memory -* Setup [Hyperdrive](https://github.com/hyperspace-org/hyperdrive-service) +* Setup a DAT Hyperdrive tool [drives](https://github.com/holepunchto/drives) * Use an AdoptOpenJDK(11++) to run the demo * TODO: install local copy of bassboon-jppre * Run "mvn -P lib-install initialize" once to copy local lib to local m2 repro. diff --git a/gdxapp4d-boot-desktop/local-ship.xml b/gdxapp4d-boot-desktop/Warpship/warp-ship.xml similarity index 100% rename from gdxapp4d-boot-desktop/local-ship.xml rename to gdxapp4d-boot-desktop/Warpship/warp-ship.xml diff --git a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java index 22397cc1..dd64021c 100644 --- a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java +++ b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java @@ -94,7 +94,6 @@ public class GDXAppTos4Activator implements BundleActivator { private GDXAppTos4BootListener bootScreen; private List bootReadyListeners = new ArrayList<>(); - private static final String SYSTEM_USER_HOME = "user.home"; private static final String HYPERDRIVE_HOME = "Hyperdrive"; private static final String WARPSHIP_HOME = "Warpship"; @@ -138,26 +137,21 @@ public class GDXAppTos4Activator implements BundleActivator { boolean useLocal = args.contains("use-local"); - File userHome = new File(System.getProperty(SYSTEM_USER_HOME)); - hyperdriveHome = new File(userHome, HYPERDRIVE_HOME); - if (!hyperdriveHome.exists()) { - bootScreen.bootLineError("ERROR: No Hyperdrive home."); - startError = true; - return; - } - warpshipHome = new File(hyperdriveHome, WARPSHIP_HOME); - if (useLocal) { - warpshipHome = new File("."); - } + warpshipHome = new File(".", WARPSHIP_HOME); if (!warpshipHome.exists()) { bootScreen.bootLineError("ERROR: No Warpship home."); startError = true; return; } - File warpShip = new File(warpshipHome, Warpᵐᵉ.WARP_SHIP); - if (useLocal) { - warpShip = new File(warpshipHome, "local-ship.xml"); + + hyperdriveHome = new File(warpshipHome, HYPERDRIVE_HOME); + if (!hyperdriveHome.exists()) { + bootScreen.bootLineError("ERROR: No Hyperdrive home."); + startError = true; + return; } + + File warpShip = new File(warpshipHome, Warpᵐᵉ.WARP_SHIP); bootScreen.bootLine("warp-ship: "+warpShip); if (!warpShip.exists()) { bootScreen.bootLineError("ERROR: No warp-ship.xml found."); @@ -355,13 +349,15 @@ public class GDXAppTos4Activator implements BundleActivator { if (override == null) { waterHome = new File(hyperdriveHome, key); if (!waterHome.exists()) { - executeHyperdrive("hyperdrive", "mount", waterHome.getAbsolutePath(), key); - } - String infoResult = executeHyperdrive("hyperdrive", "info", waterHome.getAbsolutePath()); - if (!infoResult.startsWith("Drive Info")) { - logger.accept("ERROR: Couldn't get info on: "+waterHome); - return 1; + waterHome.mkdir(); + executeHyperdrive("drives", "download", key); } + String infoResult = executeHyperdrive("drives", "mirror", key, waterHome.getAbsolutePath()); + logger.accept(infoResult); +// if (!infoResult.startsWith("Drive Info")) { +// logger.accept("ERROR: Couldn't get info on: "+waterHome); +// return 1; +// } } else { waterHome = new File(override); }