Updated to holepush drives dat tool

This commit is contained in:
Willem Cazander 2023-07-19 13:31:26 +02:00
parent b647c2520b
commit 47776f430b
3 changed files with 18 additions and 22 deletions

View file

@ -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.

View file

@ -94,7 +94,6 @@ public class GDXAppTos4Activator implements BundleActivator {
private GDXAppTos4BootListener bootScreen;
private List<SystemGdxBootReadyListener> 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);
}