diff --git a/docker/Dockerfile.wallet_server_deploy b/docker/Dockerfile.wallet_server_deploy index e3fdda27b..2c4dd60bb 100644 --- a/docker/Dockerfile.wallet_server_deploy +++ b/docker/Dockerfile.wallet_server_deploy @@ -15,18 +15,8 @@ RUN apt-get update && \ tar unzip \ build-essential \ automake libtool \ - pkg-config \ - librocksdb-dev -# python3.7 \ -# python3-dev \ -# python3-pip \ -# python3-wheel \ -# python3-cffi \ -# python3-setuptools && \ -# update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ -# rm -rf /var/lib/apt/lists/* + pkg-config -RUN pip install lbry-rocksdb RUN pip install uvloop RUN groupadd -g 999 $user && useradd -m -u 999 -g $user $user RUN mkdir -p $db_dir diff --git a/docker/wallet_server_entrypoint.sh b/docker/wallet_server_entrypoint.sh index 86cd60dd1..c260e42a8 100755 --- a/docker/wallet_server_entrypoint.sh +++ b/docker/wallet_server_entrypoint.sh @@ -20,6 +20,14 @@ if [[ -n "$SNAPSHOT_URL" ]] && [[ ! -f /database/lbry-leveldb ]]; then rm "$filename" fi -/home/lbry/.local/bin/lbry-hub-elastic-sync -echo 'starting server' -/home/lbry/.local/bin/lbry-hub "$@" +if [ -z "$HUB_COMMAND" ]; then + echo "HUB_COMMAND env variable must be writer, reader, or es_sync" + exit 1 +fi + +case "$HUB_COMMAND" in + writer ) /home/lbry/.local/bin/lbry-hub-writer "$@" ;; + reader ) /home/lbry/.local/bin/lbry-hub-server "$@" ;; + es_sync ) /home/lbry/.local/bin/lbry-hub-elastic-sync ;; + * ) "HUB_COMMAND env variable must be writer, reader, or es_sync" && exit 1 ;; +esac diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index 27379be86..071549ffb 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -1634,6 +1634,8 @@ class BlockProcessor: could be lost. """ + await self.open() + self._caught_up_event = caught_up_event try: await asyncio.wait([ diff --git a/setup.py b/setup.py index f6a86919b..ecb6937d5 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ setup( 'lbrynet=lbry.extras.cli:main', 'lbry-hub-writer=lbry.wallet.server.cli:run_writer_forever', 'lbry-hub-server=lbry.wallet.server.cli:run_server_forever', - 'lbry-hub-elastic-sync=lbry.wallet.server.db.elasticsearch.sync:run_elastic_sync', + 'lbry-hub-elastic-sync=lbry.wallet.server.cli:run_es_sync_forever', 'orchstr8=lbry.wallet.orchstr8.cli:main' ], },