Changes to allow RUN_MODE=regtest to stuff/auto_advance.sh
This commit is contained in:
parent
f8ae8792e9
commit
5f402ebc7a
4 changed files with 22 additions and 11 deletions
|
@ -11,7 +11,7 @@ COPY ./stuff/start.sh start
|
||||||
COPY ./stuff/healthcheck.sh healthcheck
|
COPY ./stuff/healthcheck.sh healthcheck
|
||||||
COPY ./stuff/advance_blocks.sh advance
|
COPY ./stuff/advance_blocks.sh advance
|
||||||
COPY ./stuff/fix-permissions.c fix-permissions.c
|
COPY ./stuff/fix-permissions.c fix-permissions.c
|
||||||
RUN curl -L -o ./lbrycrd-linux.zip $(curl -s https://api.github.com/repos/lbryio/lbrycrd/releases | grep -F 'lbrycrd-linux.zip' | grep download | head -n 1 | cut -d'"' -f4) && \
|
RUN curl --progress-bar -L -o ./lbrycrd-linux.zip $(curl -s https://api.github.com/repos/lbryio/lbrycrd/releases | grep -F 'lbrycrd-linux.zip' | grep download | head -n 1 | cut -d'"' -f4) && \
|
||||||
unzip ./lbrycrd-linux.zip && \
|
unzip ./lbrycrd-linux.zip && \
|
||||||
gcc fix-permissions.c -o fix-permissions && \
|
gcc fix-permissions.c -o fix-permissions && \
|
||||||
chmod +x ./lbrycrdd ./lbrycrd-cli ./lbrycrd-tx ./start ./healthcheck ./fix-permissions ./advance
|
chmod +x ./lbrycrdd ./lbrycrd-cli ./lbrycrd-tx ./start ./healthcheck ./fix-permissions ./advance
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
lbry-network:
|
||||||
|
external: true
|
||||||
|
|
||||||
services:
|
services:
|
||||||
#############
|
#############
|
||||||
## Lbrycrd ##
|
## Lbrycrd ##
|
||||||
#############
|
#############
|
||||||
lbrycrd:
|
lbrycrd:
|
||||||
image: lbry/lbrycrd:linux-x86_64-production
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-linux-x86_64-production
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "11336:29246"
|
- "11336:29246"
|
||||||
|
@ -13,5 +19,10 @@ services:
|
||||||
## host volumes for persistent data such as wallet private keys.
|
## host volumes for persistent data such as wallet private keys.
|
||||||
volumes:
|
volumes:
|
||||||
- "../persist/data:/data"
|
- "../persist/data:/data"
|
||||||
|
networks:
|
||||||
|
lbry-network:
|
||||||
|
ipv4_address: 10.6.1.2
|
||||||
environment:
|
environment:
|
||||||
- RUN_MODE=regtest
|
- RUN_MODE=regtest
|
||||||
|
- PORT=29245
|
||||||
|
- AUTO_ADVANCE=1
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
while true; do
|
while sleep 2; do
|
||||||
lbrycrd-cli -conf=/data/.lbrycrd/lbrycrd.conf generate 1 >> /tmp/output.log
|
lbrycrd-cli -conf=/etc/lbry/lbrycrd.conf generate 1
|
||||||
sleep 2
|
|
||||||
done
|
done
|
||||||
|
|
|
@ -56,7 +56,7 @@ function set_config() {
|
||||||
case $RUN_MODE in
|
case $RUN_MODE in
|
||||||
default )
|
default )
|
||||||
set_config
|
set_config
|
||||||
lbrycrdd -server -conf=$CONFIG_PATH -printtoconsole
|
exec lbrycrdd -server -conf=$CONFIG_PATH -printtoconsole
|
||||||
;;
|
;;
|
||||||
## If it's a first run you need to do a full index including all transactions
|
## If it's a first run you need to do a full index including all transactions
|
||||||
## tx index creates an index of every single transaction in the block history if
|
## tx index creates an index of every single transaction in the block history if
|
||||||
|
@ -65,13 +65,13 @@ case $RUN_MODE in
|
||||||
reindex )
|
reindex )
|
||||||
## Apply this RUN_MODE in the case you need to update a dataset. NOTE: you do not need to use `RUN_MODE reindex` for more than one complete run.
|
## Apply this RUN_MODE in the case you need to update a dataset. NOTE: you do not need to use `RUN_MODE reindex` for more than one complete run.
|
||||||
set_config
|
set_config
|
||||||
lbrycrdd -server -txindex -reindex -conf=$CONFIG_PATH -printtoconsole
|
exec lbrycrdd -server -txindex -reindex -conf=$CONFIG_PATH -printtoconsole
|
||||||
;;
|
;;
|
||||||
chainquery )
|
chainquery )
|
||||||
## If your only goal is to run Chainquery against this instance of lbrycrd and you're starting a
|
## If your only goal is to run Chainquery against this instance of lbrycrd and you're starting a
|
||||||
## fresh local dataset use this run mode.
|
## fresh local dataset use this run mode.
|
||||||
set_config
|
set_config
|
||||||
lbrycrdd -server -txindex -conf=$CONFIG_PATH -printtoconsole
|
exec lbrycrdd -server -txindex -conf=$CONFIG_PATH -printtoconsole
|
||||||
;;
|
;;
|
||||||
regtest )
|
regtest )
|
||||||
## Set config params
|
## Set config params
|
||||||
|
@ -87,8 +87,9 @@ case $RUN_MODE in
|
||||||
echo "server=1" >> $CONFIG_PATH
|
echo "server=1" >> $CONFIG_PATH
|
||||||
echo "printtoconsole=1" >> $CONFIG_PATH
|
echo "printtoconsole=1" >> $CONFIG_PATH
|
||||||
|
|
||||||
#nohup advance &>/dev/null &
|
[ "${AUTO_ADVANCE:-0}" == "1" ] && nohup advance &>/dev/null &
|
||||||
lbrycrdd -conf=$CONFIG_PATH $1
|
|
||||||
|
exec lbrycrdd -conf=$CONFIG_PATH $1
|
||||||
;;
|
;;
|
||||||
testnet )
|
testnet )
|
||||||
## Set config params
|
## Set config params
|
||||||
|
@ -105,7 +106,7 @@ case $RUN_MODE in
|
||||||
echo "printtoconsole=1" >> $CONFIG_PATH
|
echo "printtoconsole=1" >> $CONFIG_PATH
|
||||||
|
|
||||||
#nohup advance &>/dev/null &
|
#nohup advance &>/dev/null &
|
||||||
lbrycrdd -conf=$CONFIG_PATH $1
|
exec lbrycrdd -conf=$CONFIG_PATH $1
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo "Error, you must define a RUN_MODE environment variable."
|
echo "Error, you must define a RUN_MODE environment variable."
|
||||||
|
|
Loading…
Reference in a new issue