Compare commits
19 Commits
master
...
joinmarket
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae039af062 | ||
|
|
70df9863db | ||
|
|
73fb019d8a | ||
|
|
79da64788b | ||
|
|
5c0aff8ddd | ||
|
|
5909e260df | ||
|
|
2105370d3f | ||
|
|
0cf4191fd9 | ||
|
|
5239b79cad | ||
|
|
b6db64afdf | ||
|
|
8be6c53b76 | ||
|
|
741b2b8b54 | ||
|
|
5f308df53e | ||
|
|
d4fc1305e6 | ||
|
|
b68f61adc3 | ||
|
|
e0d58a45b4 | ||
|
|
a47e8a6d73 | ||
|
|
af03ef9a8b | ||
|
|
c4f5c56487 |
@ -6,7 +6,10 @@ cd ..
|
||||
cd scripts
|
||||
|
||||
# First we restore the default cfg as created by wallet-tool.py generate
|
||||
cp "$DEFAULT_CONFIG" "$CONFIG"
|
||||
if ! [ -f "$CONFIG" ]; then
|
||||
cp "$DEFAULT_CONFIG" "$CONFIG"
|
||||
fi
|
||||
|
||||
# For every env variable JM_FOO=BAR, replace the default configuration value of 'foo' by 'bar'
|
||||
while IFS='=' read -r -d '' n v; do
|
||||
n="${n,,}" # lowercase
|
||||
@ -23,30 +26,4 @@ if [[ "${READY_FILE}" ]]; then
|
||||
echo "The chain is fully synched"
|
||||
fi
|
||||
|
||||
if ! [ -f "${ENV_FILE}" ]; then
|
||||
echo "You need to initialize the wallet.
|
||||
jm.sh wallet-tool-generate
|
||||
jm.sh set-wallet <wallet_name> <Password>"
|
||||
exec sleep infinity
|
||||
fi
|
||||
export $(cat "$ENV_FILE" | xargs)
|
||||
|
||||
: "${JM_YIELD_GENERATOR:=yield-generator-basic.py}"
|
||||
|
||||
echo "Using wallet ${WALLET_NAME} with $JM_YIELD_GENERATOR"
|
||||
LOCKFILE="/root/.joinmarket/wallets/.${WALLET_NAME}.lock"
|
||||
rm -f /root/.joinmarket/wallets/.${WALLET_NAME}.lock
|
||||
while true; do
|
||||
if [ -f "/tmp/stop" ]; then
|
||||
echo "/tmp/stop is present, waiting it to get removed to start again..."
|
||||
touch /tmp/stopped
|
||||
elif [ -f "$LOCKFILE" ]; then
|
||||
echo "$LOCKFILE is present, waiting it to get removed to start again..."
|
||||
touch /tmp/stopped
|
||||
else
|
||||
rm -f /tmp/stopped
|
||||
echo -n "${WALLET_PASS}" | python "${JM_YIELD_GENERATOR}" --wallet-password-stdin "${WALLET_NAME}" || true
|
||||
touch /tmp/stopped
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
exec supervisord
|
||||
@ -1,8 +1,33 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd ..
|
||||
pushd . > /dev/null
|
||||
cd /src
|
||||
. jmvenv/bin/activate
|
||||
cd scripts
|
||||
popd > /dev/null
|
||||
|
||||
if [[ "$1" == "unlockwallet" ]]; then
|
||||
shift 1
|
||||
if ! [ -f "${ENV_FILE}" ]; then
|
||||
echo "You need to initialize the wallet.
|
||||
jm.sh wallet-tool-generate
|
||||
jm.sh set-wallet <wallet_name> <Password>"
|
||||
exit 1
|
||||
fi
|
||||
export $(cat "$ENV_FILE" | xargs)
|
||||
if [[ "$1" == "nopass" ]]; then
|
||||
shift 1
|
||||
COMMAND="$1"
|
||||
shift 1
|
||||
$COMMAND "${WALLET_NAME}" "$@"
|
||||
else
|
||||
COMMAND="$1"
|
||||
shift 1
|
||||
echo -n "${WALLET_PASS}" | $COMMAND --wallet-password-stdin "${WALLET_NAME}" "$@"
|
||||
fi
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
exec "$@"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
FROM python:3.9.7-slim-bullseye
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends curl tini sudo procps \
|
||||
build-essential automake pkg-config libtool libgmp-dev libltdl-dev python3-dev virtualenv python3-pip && \
|
||||
apt-get install -qq --no-install-recommends curl tini sudo procps vim supervisor \
|
||||
build-essential automake pkg-config libtool libgmp-dev libltdl-dev python3-dev virtualenv python3-pip supervisor && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV JM_VERSION 0.9.1
|
||||
@ -18,10 +18,13 @@ ENV CONFIG ${DATADIR}/joinmarket.cfg
|
||||
ENV DEFAULT_CONFIG /root/default.cfg
|
||||
ENV ENV_FILE "${DATADIR}/.env"
|
||||
RUN . jmvenv/bin/activate && cd /src/scripts && \
|
||||
pip install matplotlib && \
|
||||
(python wallet-tool.py generate || true) \
|
||||
&& cp "${CONFIG}" "${DEFAULT_CONFIG}"
|
||||
WORKDIR /src/scripts
|
||||
COPY docker-entrypoint.sh .
|
||||
COPY *.sh ./
|
||||
COPY supervisor-conf/*.conf /etc/supervisor/conf.d/
|
||||
ENV PATH /src/scripts:$PATH
|
||||
EXPOSE 62601
|
||||
ENTRYPOINT [ "tini", "-g", "--", "./docker-entrypoint.sh" ]
|
||||
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -f "${ENV_FILE}" ]; then
|
||||
echo "You need to initialize the wallet.
|
||||
jm.sh wallet-tool generate
|
||||
jm.sh set-wallet <wallet_name> <Password>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
stop.sh
|
||||
export $(cat "$ENV_FILE" | xargs)
|
||||
echo -n "${WALLET_PASS}" | python receive-payjoin.py --wallet-password-stdin "${WALLET_NAME}" "$@"
|
||||
start.sh
|
||||
@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -f "${ENV_FILE}" ]; then
|
||||
echo "You need to initialize the wallet.
|
||||
jm.sh wallet-tool generate
|
||||
jm.sh set-wallet <wallet_name> <Password>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export $(cat "$ENV_FILE" | xargs)
|
||||
|
||||
stop.sh
|
||||
sendpayment.py "${WALLET_NAME}" "$@"
|
||||
start.sh
|
||||
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -f /tmp/stop
|
||||
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
touch /tmp/stop
|
||||
pkill python
|
||||
while ! [ -f "/tmp/stopped" ]; do
|
||||
sleep 1
|
||||
done
|
||||
10
JoinMarket/0.9.1/supervisor-conf/ob-watcher.conf
Normal file
10
JoinMarket/0.9.1/supervisor-conf/ob-watcher.conf
Normal file
@ -0,0 +1,10 @@
|
||||
[program:ob-watcher]
|
||||
directory=/src/scripts/obwatch
|
||||
command=exec-wrapper.sh python ob-watcher.py --host 0.0.0.0
|
||||
autostart=false
|
||||
stdout_logfile=/root/.joinmarket/logs/obwatch_stdout.log
|
||||
stdout_logfile_maxbytes=5MB
|
||||
stdout_logfile_backups=0
|
||||
stderr_logfile=/root/.joinmarket/logs/obwatch_stderr.log
|
||||
stderr_logfile_maxbytes=5MB
|
||||
stderr_logfile_backups=0
|
||||
2
JoinMarket/0.9.1/supervisor-conf/supervisord.conf
Normal file
2
JoinMarket/0.9.1/supervisor-conf/supervisord.conf
Normal file
@ -0,0 +1,2 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
10
JoinMarket/0.9.1/supervisor-conf/yg-privacyenhanced.conf
Normal file
10
JoinMarket/0.9.1/supervisor-conf/yg-privacyenhanced.conf
Normal file
@ -0,0 +1,10 @@
|
||||
[program:yg-privacyenhanced]
|
||||
directory=/src/scripts
|
||||
command=exec-wrapper.sh unlockwallet yg-privacyenhanced.py
|
||||
autostart=false
|
||||
stdout_logfile=/root/.joinmarket/logs/yg-privacyenhanced_stdout.log
|
||||
stdout_logfile_maxbytes=5MB
|
||||
stdout_logfile_backups=0
|
||||
stderr_logfile=/root/.joinmarket/logs/yg-privacyenhanced_stderr.log
|
||||
stderr_logfile_maxbytes=5MB
|
||||
stderr_logfile_backups=0
|
||||
10
JoinMarket/0.9.1/supervisor-conf/yield-generator-basic.conf
Normal file
10
JoinMarket/0.9.1/supervisor-conf/yield-generator-basic.conf
Normal file
@ -0,0 +1,10 @@
|
||||
[program:yield-generator-basic]
|
||||
directory=/src/scripts
|
||||
command=exec-wrapper.sh unlockwallet yield-generator-basic.py
|
||||
autostart=false
|
||||
stdout_logfile=/root/.joinmarket/logs/yield-generator-basic_stdout.log
|
||||
stdout_logfile_maxbytes=5MB
|
||||
stdout_logfile_backups=0
|
||||
stderr_logfile=/root/.joinmarket/logs/yield-generator-basic_stderr.log
|
||||
stderr_logfile_maxbytes=5MB
|
||||
stderr_logfile_backups=0
|
||||
@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd ..
|
||||
. jmvenv/bin/activate
|
||||
cd scripts
|
||||
|
||||
if ! [ -f "${ENV_FILE}" ]; then
|
||||
echo "You need to initialize the wallet.
|
||||
jm.sh wallet-tool generate
|
||||
jm.sh set-wallet <wallet_name> <Password>"
|
||||
exit 1
|
||||
fi
|
||||
export $(cat "$ENV_FILE" | xargs)
|
||||
echo -n "${WALLET_PASS}" | python wallet-tool.py --wallet-password-stdin "${WALLET_NAME}" "$@"
|
||||
Loading…
Reference in New Issue
Block a user