Skip to content

Commit

Permalink
More pricenode monitoring related changes requested by @freimair
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz committed Feb 22, 2020
1 parent c23f032 commit 8816690
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
11 changes: 7 additions & 4 deletions monitor/install_collectd_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ sudo -H -i -u "${ROOT_USER}" DEBIAN_FRONTEND=noninteractive apt-get install -qq

echo "[*] Preparing Bisq init script for monitoring"
# remove stuff it it is there already
if [ -f "${SYSTEMD_ENV_HOME}/bisq.env" ];then
sudo -H -i -u "${ROOT_USER}" sed -i -e 's/-Dcom.sun.management.jmxremote //g' -e 's/-Dcom.sun.management.jmxremote.local.only=true//g' -e 's/ -Dcom.sun.management.jmxremote.host=127.0.0.1//g' -e 's/ -Dcom.sun.management.jmxremote.port=6969//g' -e 's/ -Dcom.sun.management.jmxremote.rmi.port=6969//g' -e 's/ -Dcom.sun.management.jmxremote.ssl=false//g' -e 's/ -Dcom.sun.management.jmxremote.authenticate=false//g' "${SYSTEMD_ENV_HOME}/bisq.env"
sudo -H -i -u "${ROOT_USER}" sed -i -e '/JAVA_OPTS/ s/"$/ -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.rmi.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"/' "${SYSTEMD_ENV_HOME}/bisq.env"
fi
for file in "${SYSTEMD_ENV_HOME}/bisq.env" "${SYSTEMD_ENV_HOME}/bisq-pricenode.env"
do
if [ -f "$file" ];then
sudo -H -i -u "${ROOT_USER}" sed -i -e 's/-Dcom.sun.management.jmxremote //g' -e 's/-Dcom.sun.management.jmxremote.local.only=true//g' -e 's/ -Dcom.sun.management.jmxremote.host=127.0.0.1//g' -e 's/ -Dcom.sun.management.jmxremote.port=6969//g' -e 's/ -Dcom.sun.management.jmxremote.rmi.port=6969//g' -e 's/ -Dcom.sun.management.jmxremote.ssl=false//g' -e 's/ -Dcom.sun.management.jmxremote.authenticate=false//g' "${file}"
sudo -H -i -u "${ROOT_USER}" sed -i -e '/JAVA_OPTS/ s/"$/ -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.rmi.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"/' "${file}"
fi
done

echo "[*] Seeding entropy from /dev/urandom"
sudo -H -i -u "${ROOT_USER}" /bin/sh -c "head -1500 /dev/urandom > ${ROOT_HOME}/.rnd"
Expand Down
6 changes: 3 additions & 3 deletions pricenode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ At the end of the installer script, it should print your Tor onion hostname.

### Setting your BitcoinAverage API keys

Open `/etc/systemd/system/bisq-pricenode.service` in a text editor and look for these lines:
Open `/etc/default/bisq-pricenode.env` in a text editor and look for these lines:
```bash
Environment="BITCOIN_AVG_PUBKEY=__BITCOIN_AVG_PUBKEY__"
Environment="BITCOIN_AVG_PRIVKEY=__BITCOIN_AVG_PRIVKEY__"
BITCOIN_AVG_PUBKEY=foo
BITCOIN_AVG_PRIVKEY=bar
```

Add your pubkey and privkey and then reload/restart bisq-pricenode service:
Expand Down
3 changes: 3 additions & 0 deletions pricenode/bisq-pricenode.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BITCOIN_AVG_PUBKEY=foo
BITCOIN_AVG_PRIVKEY=bar
JAVA_OPTS=""
3 changes: 1 addition & 2 deletions pricenode/bisq-pricenode.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ Description=Bisq Price Node
After=network.target

[Service]
Environment="BITCOIN_AVG_PUBKEY=__BITCOIN_AVG_PUBKEY__"
Environment="BITCOIN_AVG_PRIVKEY=__BITCOIN_AVG_PRIVKEY__"
EnvironmentFile=/etc/default/bisq-pricenode.env
ExecStart=/usr/bin/java -jar /bisq/bisq/lib/pricenode-0.7.2-SNAPSHOT.jar 2 2
ExecStop=/bin/kill -TERM ${MAINPID}
Restart=on-failure
Expand Down
3 changes: 2 additions & 1 deletion pricenode/install_pricenode_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "[*] Bisq bisq-pricenode installation script"
##### change as necessary for your system

SYSTEMD_SERVICE_HOME=/etc/systemd/system
#SYSTEMD_ENV_HOME=/etc/default
SYSTEMD_ENV_HOME=/etc/default

ROOT_USER=root
ROOT_GROUP=root
Expand Down Expand Up @@ -66,6 +66,7 @@ sudo -H -i -u "${BISQ_USER}" sh -c "cd ${BISQ_HOME}/${BISQ_REPO_NAME} && ./gradl

echo "[*] Installing bisq-pricenode systemd service"
sudo -H -i -u "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${BISQ_HOME}/${BISQ_REPO_NAME}/pricenode/bisq-pricenode.service" "${SYSTEMD_SERVICE_HOME}"
sudo -H -i -u "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${BISQ_HOME}/${BISQ_REPO_NAME}/pricenode/bisq-pricenode.env" "${SYSTEMD_ENV_HOME}"

echo "[*] Reloading systemd daemon configuration"
sudo -H -i -u "${ROOT_USER}" systemctl daemon-reload
Expand Down

0 comments on commit 8816690

Please sign in to comment.