mirror of
https://github.com/wownero/i2p-zero.git
synced 2026-10-17 15:21:40 +02:00
removed use of java records, since they're a preview feature and causing a clash with the packaging which won't allow preview features to be enabled
added pipefail to bash scripts to more thoroughly catch errors version bump to 1.19 readme now communicates that monerod comes preconfigured with I2P-accessible monerod peers
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
@@ -9,7 +11,7 @@ fi
|
||||
source "$basedir/bin/java-config.sh"
|
||||
|
||||
echo "*** Compiling CLI"
|
||||
"$JAVA_HOME"/bin/javac --enable-preview -source 14 --module-path "$basedir/target/modules/combined.jar" -d "$basedir/target/classes/org.getmonero.i2p.zero" $(find "$basedir/org.getmonero.i2p.zero/src" -name '*.java')
|
||||
"$JAVA_HOME"/bin/javac --module-path "$basedir/target/modules/combined.jar" -d "$basedir/target/classes/org.getmonero.i2p.zero" $(find "$basedir/org.getmonero.i2p.zero/src" -name '*.java')
|
||||
cp "$basedir/org.getmonero.i2p.zero/src/org/getmonero/i2p/zero/VERSION" "$basedir/target/classes/org.getmonero.i2p.zero/org/getmonero/i2p/zero/"
|
||||
|
||||
echo "*** Packaging CLI as a modular jar"
|
||||
@@ -17,7 +19,7 @@ echo "*** Packaging CLI as a modular jar"
|
||||
normalizeZip "$basedir/target/org.getmonero.i2p.zero.jar"
|
||||
|
||||
echo "*** Compiling GUI"
|
||||
"$JAVA_HOME"/bin/javac --enable-preview -source 14 --module-path "$basedir/target/org.getmonero.i2p.zero.jar:$basedir/target/modules/combined.jar:$basedir/import/javafx-sdks/linux/javafx-sdk-$JAVAFX_VERSION/lib" -d "$basedir/target/classes/org.getmonero.i2p.zero.gui" $(find "$basedir/org.getmonero.i2p.zero.gui/src" -name '*.java')
|
||||
"$JAVA_HOME"/bin/javac --module-path "$basedir/target/org.getmonero.i2p.zero.jar:$basedir/target/modules/combined.jar:$basedir/import/javafx-sdks/linux/javafx-sdk-$JAVAFX_VERSION/lib" -d "$basedir/target/classes/org.getmonero.i2p.zero.gui" $(find "$basedir/org.getmonero.i2p.zero.gui/src" -name '*.java')
|
||||
|
||||
cp -r "$basedir/org.getmonero.i2p.zero.gui/src/org/getmonero/i2p/zero/gui/"*.{css,png,fxml,ttf} "$basedir/target/classes/org.getmonero.i2p.zero.gui/org/getmonero/i2p/zero/gui/"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
@@ -46,7 +48,7 @@ echo 'uses org.eclipse.jetty.http.HttpFieldPreEncoder; }' >> "$basedir/target/mo
|
||||
|
||||
|
||||
echo "*** Creating new combined modular jar"
|
||||
"$JAVA_HOME"/bin/javac --enable-preview -source 14 --module-path "$combinedJarPath/combined" --patch-module combined="$combinedJarPath" "$basedir/target/module-info/combined/module-info.java"
|
||||
"$JAVA_HOME"/bin/javac --module-path "$combinedJarPath/combined" --patch-module combined="$combinedJarPath" "$basedir/target/module-info/combined/module-info.java"
|
||||
cp $combinedJarPath "$basedir/target/modules/"
|
||||
"$JAVA_HOME"/bin/jar uf "$basedir/target/modules/combined.jar" -C "$basedir/target/module-info/combined" module-info.class
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
@@ -79,14 +81,18 @@ if [ ! -d "$basedir/import/javafx-jmods" ]; then
|
||||
wget --directory-prefix=javafx-jmods/mac $JAVAFX_JMODS_DOWNLOAD_URL_MAC
|
||||
wget --directory-prefix=javafx-jmods/win $JAVAFX_JMODS_DOWNLOAD_URL_WIN
|
||||
|
||||
set +e
|
||||
unzip -q javafx-jmods/linux/$JAVAFX_JMODS_DOWNLOAD_FILENAME_LINUX -d javafx-jmods/linux/
|
||||
unzip -q javafx-jmods/mac/$JAVAFX_JMODS_DOWNLOAD_FILENAME_MAC -d javafx-jmods/mac/
|
||||
unzip -q javafx-jmods/win/$JAVAFX_JMODS_DOWNLOAD_FILENAME_WIN -d javafx-jmods/win/
|
||||
set -e
|
||||
fi
|
||||
|
||||
if [ ! -d "$basedir/import/jpackage" ]; then
|
||||
mkdir -p jpackage/linux jpackage/win
|
||||
set +e
|
||||
unzip -q $JAVA_HOME_LINUX/jmods/jdk.incubator.jpackage.jmod -d jpackage/linux/
|
||||
unzip -q $JAVA_HOME_WIN/jmods/jdk.incubator.jpackage.jmod -d jpackage/win/
|
||||
set -e
|
||||
fi
|
||||
|
||||
|
||||
+8
-4
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
@@ -8,13 +10,14 @@ fi
|
||||
|
||||
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
||||
|
||||
# Get latest JDK version from https://adoptopenjdk.net/releases.html?variant=openjdk15&jvmVariant=hotspot
|
||||
JDK_VERSION=14.0.1+7
|
||||
JDK_MAJOR_VERSION=`echo $JDK_VERSION | cut -f1 -d"."`
|
||||
JDK_MAJOR_VERSION=`echo $JDK_VERSION | cut -f1 -d"." | cut -f1 -d+`
|
||||
JDK_VERSION_URL_ENC=`echo "$JDK_VERSION" | sed 's/+/%2B/g'`
|
||||
JDK_VERSION_URL_ENC2=`echo "$JDK_VERSION" | sed 's/+/_/g'`
|
||||
JDK_DOWNLOAD_URL_LINUX=https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_linux_hotspot_${JDK_VERSION_URL_ENC2}.tar.gz
|
||||
JDK_DOWNLOAD_URL_MAC=https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_mac_hotspot_${JDK_VERSION_URL_ENC2}.tar.gz
|
||||
JDK_DOWNLOAD_URL_WIN=https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_windows_hotspot_${JDK_VERSION_URL_ENC2}.zip
|
||||
JDK_DOWNLOAD_URL_LINUX=https://github.com/AdoptOpenJDK/openjdk${JDK_MAJOR_VERSION}-binaries/releases/download/jdk-${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_linux_hotspot_${JDK_VERSION_URL_ENC2}.tar.gz
|
||||
JDK_DOWNLOAD_URL_MAC=https://github.com/AdoptOpenJDK/openjdk${JDK_MAJOR_VERSION}-binaries/releases/download/jdk-${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_mac_hotspot_${JDK_VERSION_URL_ENC2}.tar.gz
|
||||
JDK_DOWNLOAD_URL_WIN=https://github.com/AdoptOpenJDK/openjdk${JDK_MAJOR_VERSION}-binaries/releases/download/jdk-${JDK_VERSION_URL_ENC}/OpenJDK${JDK_MAJOR_VERSION}U-jdk_x64_windows_hotspot_${JDK_VERSION_URL_ENC2}.zip
|
||||
|
||||
JDK_DOWNLOAD_FILENAME_LINUX="${JDK_DOWNLOAD_URL_LINUX##*/}"
|
||||
JDK_DOWNLOAD_FILENAME_MAC="${JDK_DOWNLOAD_URL_MAC##*/}"
|
||||
@@ -24,6 +27,7 @@ JAVA_HOME_LINUX=$basedir/import/jdks/linux/jdk-$JDK_VERSION
|
||||
JAVA_HOME_MAC=$basedir/import/jdks/mac/jdk-$JDK_VERSION/Contents/Home
|
||||
JAVA_HOME_WIN=$basedir/import/jdks/win/jdk-$JDK_VERSION
|
||||
|
||||
# JavaFX from https://gluonhq.com/products/javafx/
|
||||
JAVAFX_VERSION=14
|
||||
JAVAFX_SDK_DOWNLOAD_URL_LINUX=https://download2.gluonhq.com/openjfx/$JAVAFX_VERSION/openjfx-${JAVAFX_VERSION}_linux-x64_bin-sdk.zip
|
||||
JAVAFX_SDK_DOWNLOAD_URL_MAC=https://download2.gluonhq.com/openjfx/$JAVAFX_VERSION/openjfx-${JAVAFX_VERSION}_osx-x64_bin-sdk.zip
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $(uname -s) = Darwin ]; then
|
||||
basedir=$(dirname $(cd "$(dirname "$0")"; pwd -P))
|
||||
|
||||
+3
-2
@@ -7,11 +7,12 @@
|
||||
6. Create a server tunnel for incoming I2P connections by typing: `router/bin/tunnel-control.sh server.create.vanity 127.0.0.1 8061 none xyz` replacing `xyz` with a 3 alphanumeric character vanity prefix for your public b32.i2p address. This command will take a few minutes to complete, depending on how fast your CPU is. If you do not want a vanity prefix, use the command: `router/bin/tunnel-control.sh server.create 127.0.0.1 8061`
|
||||
7. The command above will result in an I2P address being printed to the command line, which will end with `.b32.i2p`. This is your new I2P address.
|
||||
8. You now need to keep a backup of your private keys to your I2P address on another computer for safekeeping. Do this by taking a backup of the `~/.i2p-zero/config/tunnels.json` file
|
||||
9. Run monerod by typing the following, replacing `XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p` with your own I2P address that was printed from step 6: `monerod --tx-proxy i2p,127.0.0.1:8060 --add-peer core5hzivg4v5ttxbor4a3haja6dssksqsmiootlptnsrfsgwqqa.b32.i2p --add-peer spn4ef3gddveqxkco6fhh7epyxnvdmei4w6hioiiunfvvljxgcoa.b32.i2p --add-peer dsc7fyzzultm7y6pmx2avu6tze3usc7d27nkbzs5qwuujplxcmzq.b32.i2p --add-peer sel36x6fibfzujwvt4hf5gxolz6kd3jpvbjqg6o3ud2xtionyl2q.b32.i2p --add-peer yht4tm2slhyue42zy5p2dn3sft2ffjjrpuy7oc2lpbhifcidml4q.b32.i2p --anonymous-inbound XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p,127.0.0.1:8061 --prune-blockchain --detach`
|
||||
|
||||
9. Run monerod by typing the following, replacing `XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p` with your own I2P address that was printed from step 6: `monerod --tx-proxy i2p,127.0.0.1:8060 --anonymous-inbound XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p,127.0.0.1:8061 --prune-blockchain --detach`
|
||||
|
||||
That's it! You are now running a mipseed, which will itself be seeded by the manually added mipseeds specified with the --add-peer entries passed to monerod.
|
||||
|
||||
Note: monerod versions v0.17.1.3 onwards comes with a list of hardcoded monerod peers accessible via I2p which are used to then discover further I2P peers. You can manually add peers to the list by passing `--add-peer` flags to the `monerod` command above. E.g. `--add-peer core5hzivg4v5ttxbor4a3haja6dssksqsmiootlptnsrfsgwqqa.b32.i2p`
|
||||
|
||||
If you are running Linux, it would be useful to set this all up to run automatically if the machine is ever rebooted. You can do this by creating systemd service files, as documented [here](monerod-with-i2p-zero.md#setting-up-linux-services-so-that-monerod-and-i2p-zero-are-automatically-started).
|
||||
|
||||
## What this all about:
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
5. Create a socks tunnel for outgoing I2P connections by typing: `router/bin/tunnel-control.sh socks.create 8060`
|
||||
6. Create a server tunnel for incoming I2P connections by typing: `router/bin/tunnel-control.sh server.create 127.0.0.1 8061`.
|
||||
7. The command above will result in an I2P address being printed to the command line, which will end with `.b32.i2p`. This is your new I2P address.
|
||||
8. Run monerod by typing the following, replacing `XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p` with your own I2P address that was printed from step 6: `monerod --tx-proxy i2p,127.0.0.1:8060 --add-peer core5hzivg4v5ttxbor4a3haja6dssksqsmiootlptnsrfsgwqqa.b32.i2p --add-peer spn4ef3gddveqxkco6fhh7epyxnvdmei4w6hioiiunfvvljxgcoa.b32.i2p --add-peer dsc7fyzzultm7y6pmx2avu6tze3usc7d27nkbzs5qwuujplxcmzq.b32.i2p --add-peer sel36x6fibfzujwvt4hf5gxolz6kd3jpvbjqg6o3ud2xtionyl2q.b32.i2p --add-peer yht4tm2slhyue42zy5p2dn3sft2ffjjrpuy7oc2lpbhifcidml4q.b32.i2p --anonymous-inbound XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p,127.0.0.1:8061 --detach`
|
||||
8. Run monerod by typing the following, replacing `XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p` with your own I2P address that was printed from step 6: `monerod --tx-proxy i2p,127.0.0.1:8060 --anonymous-inbound XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.b32.i2p,127.0.0.1:8061 --prune-blockchain --detach`
|
||||
|
||||
That's it! Do not replace the dsc****.b32.i2p address with yours, only replace the XXXXXXX.b32.i2p one. The dsc****.b32.i2p is a seed node that will help you discover other I2P-accessible monero nodes.
|
||||
|
||||
Note: monerod versions v0.17.1.3 onwards comes with a list of hardcoded monerod peers accessible via I2p which are used to then discover further I2P peers. You can manually add peers to the list by passing `--add-peer` flags to the `monerod` command above. E.g. `--add-peer core5hzivg4v5ttxbor4a3haja6dssksqsmiootlptnsrfsgwqqa.b32.i2p`
|
||||
|
||||
## Setting up Linux services so that monerod and I2P-zero are automatically started
|
||||
|
||||
If you are running Linux, it would be useful to set this all up to run automatically if the machine is ever rebooted. You can do this by creating systemd service files:
|
||||
@@ -24,7 +26,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/<username>/i2p-zero-linux.v1.18/router/bin/i2p-zero
|
||||
ExecStart=/home/<username>/i2p-zero-linux.v1.19/router/bin/i2p-zero
|
||||
User=<username>
|
||||
Group=<usergroup>
|
||||
|
||||
|
||||
@@ -98,6 +98,17 @@ public class Controller {
|
||||
return (Stage) rootBorderPane.getScene().getWindow();
|
||||
}
|
||||
|
||||
public static class DialogRefs {
|
||||
public Scene scene;
|
||||
public Stage stage;
|
||||
public AddTunnelController controller;
|
||||
public DialogRefs(Scene scene, Stage stage, AddTunnelController controller) {
|
||||
this.scene = scene;
|
||||
this.stage = stage;
|
||||
this.controller = controller;
|
||||
}
|
||||
}
|
||||
|
||||
@FXML private void initialize() {
|
||||
|
||||
// set up copy-cell-to-clipboard functionality
|
||||
@@ -134,7 +145,6 @@ public class Controller {
|
||||
tunnelRemoveButton.setDisable(true);
|
||||
});
|
||||
|
||||
record DialogRefs(Scene scene, Stage stage, AddTunnelController controller){};
|
||||
Supplier<DialogRefs> showAddTunnelDialog = ()->{
|
||||
try {
|
||||
Stage dialogStage = new Stage();
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.18
|
||||
1.19
|
||||
@@ -9,6 +9,7 @@ app.mainmodule=org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.Gui
|
||||
|
||||
|
||||
[JVMOptions]
|
||||
--enable-preview
|
||||
|
||||
[JVMUserOptions]
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ app.mainmodule=org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.Gui
|
||||
|
||||
|
||||
[JVMOptions]
|
||||
--enable-preview
|
||||
|
||||
[JVMUserOptions]
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ app.mainmodule=org.getmonero.i2p.zero/org.getmonero.i2p.zero.Main
|
||||
|
||||
|
||||
[JVMOptions]
|
||||
--enable-preview
|
||||
|
||||
[JVMUserOptions]
|
||||
|
||||
|
||||
@@ -6,4 +6,4 @@ else
|
||||
basedir=$(dirname $(dirname $(readlink -fm $0)))
|
||||
fi
|
||||
|
||||
"$basedir"/bin/java -cp "$basedir/i2p.base/jbigi.jar" -m org.getmonero.i2p.zero.gui
|
||||
"$basedir"/bin/java --enable-preview -cp "$basedir/i2p.base/jbigi.jar" -m org.getmonero.i2p.zero.gui
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
set DIR=%~dp0
|
||||
"%DIR%\java" -cp %DIR%\..\i2p.base\jbigi.jar -m org.getmonero.i2p.zero %*
|
||||
"%DIR%\java" --enable-preview -cp %DIR%\..\i2p.base\jbigi.jar -m org.getmonero.i2p.zero %*
|
||||
+1
-1
@@ -6,4 +6,4 @@ else
|
||||
basedir=$(dirname $(dirname $(readlink -fm $0)))
|
||||
fi
|
||||
|
||||
"$basedir"/bin/java -cp "$basedir/i2p.base/jbigi.jar" -m org.getmonero.i2p.zero
|
||||
"$basedir"/bin/java --enable-preview -cp "$basedir/i2p.base/jbigi.jar" -m org.getmonero.i2p.zero
|
||||
|
||||
Reference in New Issue
Block a user