Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update seednode install script to generate ECDSA key for BM oracle node #7325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions seednode/bisq.env
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ BISQ_DUMP_BLOCKCHAIN=false

# set to true for BSQ markets
BISQ_DUMP_STATISTICS=false

# burning man
BISQ_BM_FULLNODE=true
BISQ_BM_ORACLE_NODE_PUBKEY=__BISQ_BM_ORACLE_NODE_PUBKEY__
BISQ_BM_ORACLE_NODE_PRIVKEY=__BISQ_BM_ORACLE_NODE_PRIVKEY__
4 changes: 3 additions & 1 deletion seednode/bisq.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ EnvironmentFile=/etc/default/bisq.env

ExecStart=/bin/bash __BISQ_HOME__/__BISQ_REPO_NAME__/${BISQ_ENTRYPOINT} \
--fullDaoNode=${BISQ_DAO_FULLNODE} \
--isBmFullNode=${BISQ_DAO_FULLNODE} \
--userDataDir=${BISQ_HOME} \
--appName=${BISQ_APP_NAME} \
--baseCurrencyNetwork=${BISQ_BASE_CURRENCY} \
Expand All @@ -31,6 +30,9 @@ ExecStart=/bin/bash __BISQ_HOME__/__BISQ_REPO_NAME__/${BISQ_ENTRYPOINT} \
--torControlPort=${BISQ_EXTERNAL_TOR_PORT} \
--torControlUseSafeCookieAuth=${BISQ_EXTERNAL_TOR_CONTROL_USE_COOKIE} \
--torControlCookieFile=${BISQ_EXTERNAL_TOR_CONTROL_COOKIE_FILE} \
--isBmFullNode=${BISQ_BM_FULLNODE} \
--bmOracleNodePubKey=${BISQ_BM_ORACLE_NODE_PUBKEY} \
--bmOracleNodePrivKey=${BISQ_BM_ORACLE_NODE_PRIVKEY} \

ExecStop=/bin/kill ${MAINPID} ; sleep 5
Restart=on-failure
Expand Down
11 changes: 10 additions & 1 deletion seednode/install_seednode_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,14 @@ fi
sudo sed -i -e "s/__BISQ_REPO_NAME__/${BISQ_REPO_NAME}/" "${SYSTEMD_SERVICE_HOME}/bisq.service"
sudo sed -i -e "s!__BISQ_HOME__!${BISQ_HOME}!" "${SYSTEMD_SERVICE_HOME}/bisq.service"

echo "[*] Installing Bisq environment file with Bitcoin RPC credentials"
echo "[*] Generating ECDSA key for BM oracle node"
key=$(openssl ecparam -name secp256k1 -genkey)
# Extract the private key in hex format
BISQ_BM_ORACLE_NODE_PRIVKEY=$(echo "$key" | openssl ec -text -noout 2>/dev/null | awk '/priv:/{flag=1;next}/pub:/{flag=0}flag' | tr -d ' \n:')
# Extract the compressed public key in hex format
BISQ_BM_ORACLE_NODE_PUBKEY=$(echo "$key" | openssl ec -pubout -conv_form compressed -outform DER 2>/dev/null | tail -c 33 | xxd -p | tr -d '\n')

echo "[*] Installing Bisq environment file"
sudo -H -i -u "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${BISQ_HOME}/${BISQ_REPO_NAME}/seednode/bisq.env" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s/__BITCOIN_P2P_HOST__/${BITCOIN_P2P_HOST}/" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s/__BITCOIN_P2P_PORT__/${BITCOIN_P2P_PORT}/" "${SYSTEMD_ENV_HOME}/bisq.env"
Expand All @@ -146,6 +153,8 @@ sudo sed -i -e "s/__BITCOIN_RPC_BLOCKNOTIFY_HOST__/${BITCOIN_RPC_BLOCKNOTIFY_HOS
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"
sudo sed -i -e "s!__BISQ_BM_ORACLE_NODE_PUBKEY__!${BISQ_BM_ORACLE_NODE_PUBKEY}!" "${SYSTEMD_ENV_HOME}/bisq.env"
sudo sed -i -e "s!__BISQ_BM_ORACLE_NODE_PRIVKEY__!${BISQ_BM_ORACLE_NODE_PRIVKEY}!" "${SYSTEMD_ENV_HOME}/bisq.env"

echo "[*] Checking out Bisq ${BISQ_LATEST_RELEASE}"
sudo -H -i -u "${BISQ_USER}" sh -c "cd ${BISQ_HOME}/${BISQ_REPO_NAME} && git checkout ${BISQ_LATEST_RELEASE}"
Expand Down
Loading