From 9f6762297fc2da194fa9136bb5272b357a706acf Mon Sep 17 00:00:00 2001 From: wiz Date: Sat, 4 Jan 2020 19:39:56 +0900 Subject: [PATCH 1/2] Tweak seednode environment variables for BSQ explorer usage --- seednode/bisq-seednode.env | 8 +++++--- seednode/bisq-seednode.service | 9 ++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/seednode/bisq-seednode.env b/seednode/bisq-seednode.env index 5a8ca791013..61eece67cc9 100644 --- a/seednode/bisq-seednode.env +++ b/seednode/bisq-seednode.env @@ -15,13 +15,15 @@ BITCOIN_RPC_PASSWORD=__BITCOIN_RPC_USER__ BITCOIN_RPC_PORT=8332 BITCOIN_RPC_BLOCKNOTIFY_PORT=5120 -# bisq seednode settings +# bisq seednode pathnames +BISQ_HOME=__BISQ_HOME__ BISQ_APP_NAME=bisq-seednode -BISQ_DATA_DIR=__BISQ_HOME__ +BISQ_BASE_CURRENCY=btc_mainnet + +# bisq seednode settings BISQ_NODE_PORT=8000 BISQ_MAX_CONNECTIONS=50 BISQ_MAX_MEMORY=8000 -BISQ_BASE_CURRENCY=BTC_MAINNET # set to true for BSQ explorer BISQ_DUMP_BLOCKCHAIN=false diff --git a/seednode/bisq-seednode.service b/seednode/bisq-seednode.service index 713e9bf43af..835349264ee 100644 --- a/seednode/bisq-seednode.service +++ b/seednode/bisq-seednode.service @@ -2,21 +2,16 @@ [Unit] Description=Bisq Seed Node -After=network.target +After=bitcoin.service [Service] EnvironmentFile=/etc/default/bisq-seednode.env -ExecStart=__BISQ_HOME__/__BISQ_REPO_NAME__/bisq-seednode --appName=${BISQ_APP_NAME} --nodePort=${BISQ_NODE_PORT} --userDataDir=${BISQ_DATA_DIR} --maxConnections=${BISQ_MAX_CONNECTIONS} --maxMemory=${BISQ_MAX_MEMORY} --fullDaoNode=true --rpcUser=${BITCOIN_RPC_USERNAME} --rpcPassword=${BITCOIN_RPC_PASSWORD} --rpcPort=${BITCOIN_RPC_PORT} --rpcBlockNotificationPort=${BITCOIN_RPC_BLOCKNOTIFY_PORT} --baseCurrencyNetwork=${BISQ_BASE_CURRENCY} --dumpBlockchainData=${BISQ_DUMP_BLOCKCHAIN} +ExecStart=__BISQ_HOME__/__BISQ_REPO_NAME__/bisq-seednode --appName=${BISQ_APP_NAME} --nodePort=${BISQ_NODE_PORT} --userDataDir=${BISQ_HOME} --maxConnections=${BISQ_MAX_CONNECTIONS} --maxMemory=${BISQ_MAX_MEMORY} --fullDaoNode=true --rpcUser=${BITCOIN_RPC_USERNAME} --rpcPassword=${BITCOIN_RPC_PASSWORD} --rpcPort=${BITCOIN_RPC_PORT} --rpcBlockNotificationPort=${BITCOIN_RPC_BLOCKNOTIFY_PORT} --baseCurrencyNetwork=${BISQ_BASE_CURRENCY} --dumpBlockchainData=${BISQ_DUMP_BLOCKCHAIN} ExecStop=/bin/kill -TERM ${MAINPID} Restart=on-failure User=bisq Group=bisq -PrivateTmp=true -ProtectSystem=full -NoNewPrivileges=true -PrivateDevices=true - [Install] WantedBy=multi-user.target From 2d11a9e0f7df0f0c486859c74594d34a7424574a Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 5 Jan 2020 04:00:57 +0900 Subject: [PATCH 2/2] Modify seednode service script to mount tmpfs for BSQ data JSON files --- seednode/bisq-seednode.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seednode/bisq-seednode.service b/seednode/bisq-seednode.service index 835349264ee..c328f27d3b6 100644 --- a/seednode/bisq-seednode.service +++ b/seednode/bisq-seednode.service @@ -10,6 +10,9 @@ ExecStart=__BISQ_HOME__/__BISQ_REPO_NAME__/bisq-seednode --appName=${BISQ_APP_NA ExecStop=/bin/kill -TERM ${MAINPID} Restart=on-failure +ExecStartPre=+/bin/bash -c "if [ $BISQ_DUMP_BLOCKCHAIN = true ];then mount -t tmpfs none -o size=812M,uid=bisq,gid=bisq $BISQ_HOME/$BISQ_APP_NAME/$BISQ_BASE_CURRENCY/db/json;else true;fi" +ExecStopPost=+/bin/bash -c "if [ $BISQ_DUMP_BLOCKCHAIN = true ];then umount $BISQ_HOME/$BISQ_APP_NAME/$BISQ_BASE_CURRENCY/db/json;else true;fi" + User=bisq Group=bisq