From 5ddec3e4f2f56271e7d57afa82d740dcde3b7881 Mon Sep 17 00:00:00 2001 From: Mike Rosseel Date: Thu, 19 Oct 2017 14:33:43 +0200 Subject: [PATCH] Dockerfile for a hidden service seednode Adds Dockerfile and docker-compose.yml files to easily build a new seednode from the latest master branch. The Dockerfile assumes you have a hostname and private_keys. Also small fixes to SeedNode/SeedNodeMain. Signed-off-by: Mike Rosseel --- seednode/Dockerfile | 26 +++++++++++++++++++ seednode/docker-compose.yml | 15 +++++++++++ .../main/java/io/bisq/seednode/SeedNode.java | 2 +- .../java/io/bisq/seednode/SeedNodeMain.java | 2 ++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 seednode/Dockerfile create mode 100644 seednode/docker-compose.yml diff --git a/seednode/Dockerfile b/seednode/Dockerfile new file mode 100644 index 0000000000..5bc9c718b0 --- /dev/null +++ b/seednode/Dockerfile @@ -0,0 +1,26 @@ +### +# The directory of the Dockerfile should contain your 'hostname' and 'private_key' files. +# In the docker-compose.yml file you can pass the ONION_ADDRESS referenced below. +### + +# pull base image +FROM openjdk:8-jdk + +ARG ONION_ADDRESS + +RUN apt-get update && apt-get install -y --no-install-recommends \ + maven \ + vim \ + fakeroot \ + openjfx && rm -rf /var/lib/apt/lists/* + +RUN git clone https://github.com/bisq-network/exchange.git +WORKDIR /exchange/ +RUN mvn clean install +RUN mkdir -p /root/.local/share/seed_BTC_MAINNET_${ONION_ADDRESS}/btc_mainnet/tor/hiddenservice + +COPY hostname private_key /root/.local/share/seed_BTC_MAINNET_${ONION_ADDRESS}/btc_mainnet/tor/hiddenservice/ + +CMD java -Xms1800m -Xmx1800m -jar ./seednode/target/SeedNode.jar --maxConnections=30 --baseCurrencyNetwork=BTC_MAINNET --nodePort=8000 \ + --myAddress=${ONION_ADDRESS}.onion:8000 --appName=seed_BTC_MAINNET_${ONION_ADDRESS} \ + 2>error_seed_BTC_MAINNET_${ONION_ADDRESS}.log diff --git a/seednode/docker-compose.yml b/seednode/docker-compose.yml new file mode 100644 index 0000000000..0e40e74295 --- /dev/null +++ b/seednode/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +# Fill in your own ONION addres, without the .onion suffix + +services: + seednode: + build: + context: . + args: + - ONION_ADDRESS=123xxxxxxxxxx + image: bisq:seednode + ports: + - 8000:8000 + environment: + - ONION_ADDRESS=123xxxxxxxxxx diff --git a/seednode/src/main/java/io/bisq/seednode/SeedNode.java b/seednode/src/main/java/io/bisq/seednode/SeedNode.java index 9e699de30c..f23dc85001 100644 --- a/seednode/src/main/java/io/bisq/seednode/SeedNode.java +++ b/seednode/src/main/java/io/bisq/seednode/SeedNode.java @@ -46,7 +46,7 @@ public class SeedNode { public SeedNode() { String logPath = Paths.get(bisqEnvironment.getProperty(AppOptionKeys.APP_DATA_DIR_KEY), "bisq").toString(); Log.setup(logPath); - log.info("Log files under: " + logPath); + log.info("Log files under: {}.log", logPath); Utilities.printSysInfo(); Log.setLevel(Level.toLevel(bisqEnvironment.getRequiredProperty(CommonOptionKeys.LOG_LEVEL_KEY))); diff --git a/seednode/src/main/java/io/bisq/seednode/SeedNodeMain.java b/seednode/src/main/java/io/bisq/seednode/SeedNodeMain.java index 389f22c0b9..e59fa1e50e 100644 --- a/seednode/src/main/java/io/bisq/seednode/SeedNodeMain.java +++ b/seednode/src/main/java/io/bisq/seednode/SeedNodeMain.java @@ -28,6 +28,7 @@ import io.bisq.core.app.BisqExecutable; import joptsimple.OptionException; import joptsimple.OptionParser; import joptsimple.OptionSet; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.exception.ExceptionUtils; import org.bitcoinj.store.BlockStoreException; import org.slf4j.Logger; @@ -41,6 +42,7 @@ import java.util.concurrent.ThreadFactory; import static io.bisq.core.app.BisqEnvironment.DEFAULT_APP_NAME; import static io.bisq.core.app.BisqEnvironment.DEFAULT_USER_DATA_DIR; +@Slf4j public class SeedNodeMain extends BisqExecutable { private static final Logger log = LoggerFactory.getLogger(SeedNodeMain.class); private static final long MAX_MEMORY_MB_DEFAULT = 500;