Skip to content

Commit

Permalink
Merge pull request #7102 from runbtc/update-seednode-files
Browse files Browse the repository at this point in the history
Update seednode files
  • Loading branch information
alejandrogarcia83 authored Jul 19, 2024
2 parents 039d778 + bcf5924 commit 34509c9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
8 changes: 5 additions & 3 deletions seednode/bisq.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

# java memory and remote management options
JAVA_OPTS="-Xms4096M -Xmx4096M -XX:+ExitOnOutOfMemoryError"
JAVA_OPTS="-Xms4096M -Xmx4096M -XX:+ExitOnOutOfMemoryError -Djava.net.preferIPv4Stack=true"

# use external tor (change to -1 for internal tor binary)
BISQ_EXTERNAL_TOR_PORT=9051
BISQ_EXTERNAL_TOR_CONTROL_USE_COOKIE=true
BISQ_EXTERNAL_TOR_CONTROL_COOKIE_FILE=/var/lib/tor/control_auth_cookie

# bitcoin rpc credentials
BITCOIN_RPC_USER=__BITCOIN_RPC_USER__
Expand All @@ -21,8 +23,8 @@ BITCOIN_P2P_PORT=__BITCOIN_P2P_PORT__
# bitcoind rpc ports
BITCOIN_RPC_HOST=__BITCOIN_RPC_HOST__
BITCOIN_RPC_PORT=__BITCOIN_RPC_PORT__
BITCOIN_RPC_BLOCKNOTIFY_HOST=127.0.0.1
BITCOIN_RPC_BLOCKNOTIFY_PORT=5120
BITCOIN_RPC_BLOCKNOTIFY_HOST=__BITCOIN_RPC_BLOCKNOTIFY_HOST__
BITCOIN_RPC_BLOCKNOTIFY_PORT=__BITCOIN_RPC_BLOCKNOTIFY_PORT__

# bisq pathnames
BISQ_HOME=__BISQ_HOME__
Expand Down
8 changes: 5 additions & 3 deletions seednode/bisq.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

[Unit]
Description=Bisq Node
After=bitcoin.service
After=network.target
#Requires=bitcoin.service
#BindsTo=bitcoin.service

[Service]
SyslogIdentifier=bisq
EnvironmentFile=/etc/default/bisq.env

ExecStart=__BISQ_HOME__/__BISQ_REPO_NAME__/${BISQ_ENTRYPOINT} \
ExecStart=/bin/bash __BISQ_HOME__/__BISQ_REPO_NAME__/${BISQ_ENTRYPOINT} \
--fullDaoNode=${BISQ_DAO_FULLNODE} \
--userDataDir=${BISQ_HOME} \
--appName=${BISQ_APP_NAME} \
Expand All @@ -28,11 +28,13 @@ ExecStart=__BISQ_HOME__/__BISQ_REPO_NAME__/${BISQ_ENTRYPOINT} \
--dumpBlockchainData=${BISQ_DUMP_BLOCKCHAIN} \
--dumpStatistics=${BISQ_DUMP_STATISTICS} \
--torControlPort=${BISQ_EXTERNAL_TOR_PORT} \
--torControlUseSafeCookieAuth=${BISQ_EXTERNAL_TOR_CONTROL_USE_COOKIE} \
--torControlCookieFile=${BISQ_EXTERNAL_TOR_CONTROL_COOKIE_FILE} \

ExecStop=/bin/kill ${MAINPID} ; sleep 5
Restart=on-failure

ExecStartPre=+/bin/bash -c "if [ $BISQ_DUMP_BLOCKCHAIN = true ];then mount -t tmpfs none -o size=2000M,uid=bisq,gid=bisq $BISQ_HOME/$BISQ_APP_NAME/$BISQ_BASE_CURRENCY/db/json;else true;fi"
ExecStartPre=+/bin/bash -c "if [ $BISQ_DUMP_BLOCKCHAIN = true ];then mkdir -p $BISQ_HOME/$BISQ_APP_NAME/$BISQ_BASE_CURRENCY/db/json && mount -t tmpfs none -o size=5000M,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
Expand Down
11 changes: 8 additions & 3 deletions seednode/install_seednode_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ BITCOIN_P2P_HOST=127.0.0.1
BITCOIN_P2P_PORT=8333
BITCOIN_RPC_HOST=127.0.0.1
BITCOIN_RPC_PORT=8332
BITCOIN_RPC_BLOCKNOTIFY_HOST=127.0.0.1
BITCOIN_RPC_BLOCKNOTIFY_PORT=5120

# set below settings to use existing bitcoin node
#BITCOIN_INSTALL=false
Expand All @@ -43,8 +45,10 @@ BITCOIN_RPC_PORT=8332
#BITCOIN_RPC_PORT=8332
#BITCOIN_RPC_USER=foo
#BITCOIN_RPC_PASS=bar
#BITCOIN_RPC_BLOCKNOTIFY_HOST=0.0.0.0
#BITCOIN_RPC_BLOCKNOTIFY_PORT=5120

TOR_PKG="tor deb.torproject.org-keyring"
TOR_PKG="tor"
TOR_USER=debian-tor
TOR_GROUP=debian-tor
TOR_HOME=/etc/tor
Expand All @@ -65,8 +69,6 @@ sudo -H -i -u "${ROOT_USER}" git config --global advice.detachedHead false
sudo -H -i -u "${ROOT_USER}" git clone --branch "${BISQ_REPO_TAG}" "${BISQ_REPO_URL}" "${ROOT_HOME}/${BISQ_REPO_NAME}"

echo "[*] Installing Tor"
sudo -H -i -u "${ROOT_USER}" wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org focal main" | sudo -H -i -u "${ROOT_USER}" tee /etc/apt/sources.list.d/tor.list
sudo -H -i -u "${ROOT_USER}" DEBIAN_FRONTEND=noninteractive apt-get update -q
sudo -H -i -u "${ROOT_USER}" DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ${TOR_PKG}

Expand Down Expand Up @@ -125,6 +127,7 @@ sudo -H -i -u "${ROOT_USER}" chown -R "${BISQ_USER}:${BISQ_GROUP}" "${BISQ_HOME}
echo "[*] Installing Bisq init script"
sudo -H -i -u "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${BISQ_HOME}/${BISQ_REPO_NAME}/seednode/bisq.service" "${SYSTEMD_SERVICE_HOME}/bisq.service"
if [ "${BITCOIN_INSTALL}" = true ];then
sudo sed -i -e "s/After=network.target/After=bitcoin.service/" "${SYSTEMD_SERVICE_HOME}/bisq.service"
sudo sed -i -e "s/#Requires=bitcoin.service/Requires=bitcoin.service/" "${SYSTEMD_SERVICE_HOME}/bisq.service"
sudo sed -i -e "s/#BindsTo=bitcoin.service/BindsTo=bitcoin.service/" "${SYSTEMD_SERVICE_HOME}/bisq.service"
fi
Expand All @@ -139,6 +142,8 @@ sudo sed -i -e "s/__BITCOIN_RPC_HOST__/${BITCOIN_RPC_HOST}/" "${SYSTEMD_ENV_HOME
sudo sed -i -e "s/__BITCOIN_RPC_PORT__/${BITCOIN_RPC_PORT}/" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s/__BITCOIN_RPC_USER__/${BITCOIN_RPC_USER}/" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s/__BITCOIN_RPC_PASS__/${BITCOIN_RPC_PASS}/" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s/__BITCOIN_RPC_BLOCKNOTIFY_HOST__/${BITCOIN_RPC_BLOCKNOTIFY_HOST}/" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s/__BITCOIN_RPC_BLOCKNOTIFY_PORT__/${BITCOIN_RPC_BLOCKNOTIFY_PORT}/" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s!__BISQ_APP_NAME__!${BISQ_APP_NAME}!" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s!__BISQ_HOME__!${BISQ_HOME}!" "${SYSTEMD_ENV_HOME}/bisq.env"

Expand Down
14 changes: 3 additions & 11 deletions seednode/torrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ SOCKSPort 9050
ControlPort 9051
Log notice syslog

CookieAuthentication 0
CookieAuthentication 1
CookieAuthFile /var/lib/tor/control_auth_cookie
CookieAuthFileGroupReadable 1
DataDirectoryGroupReadable 1

SafeSocks 0
HiddenServiceStatistics 0
AvoidDiskWrites 1

#MaxClientCircuitsPending 64
#KeepalivePeriod 2
#CircuitBuildTimeout 5
#NewCircuitPeriod 15
#NumEntryGuards 8
DataDirectoryGroupReadable 1

0 comments on commit 34509c9

Please sign in to comment.