Skip to content

Commit

Permalink
Fixup monero-wallet-rpc awaiting wallet files
Browse files Browse the repository at this point in the history
  • Loading branch information
gStart9 committed Oct 10, 2024
1 parent 5100dc3 commit 7f0eedf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions utils/config/monero-wallet-rpc.btcpayserver.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ daemon-host=monerod.embassy
daemon-port=18089
disable-rpc-login=1

wallet-dir=MONERO_BTCPAY_WALLET_DIR
#wallet-file=MONERO_BTCPAY_WALLET_DIR/wallet
#password-file=MONERO_BTCPAY_WALLET_DIR/password
log-file=logs/monero-wallet-rpc.btcpayserver.log
#wallet-dir=MONERO_BTCPAY_WALLET_DIR
wallet-file=MONERO_BTCPAY_WALLET_DIR/wallet
password-file=MONERO_BTCPAY_WALLET_DIR/password
log-file=MONERO_DIR/logs/monero-wallet-rpc.btcpayserver.log
#log-level=2
max-log-file-size=10000000 #10MiB
max-log-files=2
Expand Down
8 changes: 7 additions & 1 deletion utils/s6-overlay/services/monero-wallet-rpc/run
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -ea

# check readiness of altcoin connections if configured to use
monero_status=$(yq e '.altcoins.monero.status' /datadir/start9/config.yaml)
if [[ $monero_status = "enabled" ]]
if [[ $monero_status = "enabled" ]]
then
MONERO_DIR=/datadir/btcpayserver/altcoins/monero
mkdir -p $MONERO_DIR
Expand Down Expand Up @@ -48,6 +48,12 @@ then
sed -i "s|MONERO_BTCPAY_WALLET_DIR|$MONERO_BTCPAY_WALLET_DIR|g" $MONERO_BTCPAY_WALLET_RPC_CONF && \
sed -i "s|MONERO_DAEMON_RPC_CREDENTIALS|$monero_daemon_rpc_credentials|g" $MONERO_BTCPAY_WALLET_RPC_CONF

#Delay and try again if the wallet file is not already in place...
while [[ ! -f "$MONERO_BTCPAY_WALLET_DIR/wallet" || ! -f "$MONERO_BTCPAY_WALLET_DIR/password" ]]
do
#Check again soon to see if the wallet file has been uploaded
sleep 3
done
# start monero-wallet-rpc, copying stderr onto stdout
exec s6-setuidgid $MONERO_UID:$MONERO_GID /usr/local/bin/monero-wallet-rpc --non-interactive --config-file $MONERO_BTCPAY_WALLET_RPC_CONF 2>&1

Expand Down

0 comments on commit 7f0eedf

Please sign in to comment.