Merge pull request #3547 from lbryio/rocksdb-hub-lbcd-jeff-fixes

Small changes and fixes for hub refactor
This commit is contained in:
Jack Robison 2022-01-24 11:36:53 -05:00 committed by GitHub
commit 5a4e8210f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 17 deletions

View file

@ -15,18 +15,8 @@ RUN apt-get update && \
tar unzip \ tar unzip \
build-essential \ build-essential \
automake libtool \ automake libtool \
pkg-config \ 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/*
RUN pip install lbry-rocksdb
RUN pip install uvloop RUN pip install uvloop
RUN groupadd -g 999 $user && useradd -m -u 999 -g $user $user RUN groupadd -g 999 $user && useradd -m -u 999 -g $user $user
RUN mkdir -p $db_dir RUN mkdir -p $db_dir

View file

@ -20,6 +20,14 @@ if [[ -n "$SNAPSHOT_URL" ]] && [[ ! -f /database/lbry-leveldb ]]; then
rm "$filename" rm "$filename"
fi fi
/home/lbry/.local/bin/lbry-hub-elastic-sync if [ -z "$HUB_COMMAND" ]; then
echo 'starting server' echo "HUB_COMMAND env variable must be writer, reader, or es_sync"
/home/lbry/.local/bin/lbry-hub "$@" 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

View file

@ -1634,6 +1634,8 @@ class BlockProcessor:
could be lost. could be lost.
""" """
await self.open()
self._caught_up_event = caught_up_event self._caught_up_event = caught_up_event
try: try:
await asyncio.wait([ await asyncio.wait([

View file

@ -32,7 +32,7 @@ setup(
'lbrynet=lbry.extras.cli:main', 'lbrynet=lbry.extras.cli:main',
'lbry-hub-writer=lbry.wallet.server.cli:run_writer_forever', 'lbry-hub-writer=lbry.wallet.server.cli:run_writer_forever',
'lbry-hub-server=lbry.wallet.server.cli:run_server_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' 'orchstr8=lbry.wallet.orchstr8.cli:main'
], ],
}, },

View file

@ -260,8 +260,12 @@ class BasicTransactionTests(IntegrationTestCase):
async def broadcast(tx): async def broadcast(tx):
try: try:
return await real_broadcast(tx) return await real_broadcast(tx)
# except lbry.wallet.rpc.jsonrpc.RPCError: except lbry.wallet.rpc.jsonrpc.RPCError as err:
# pass # this is expected in tests where we try to double spend.
if 'the transaction was rejected by network rules.' in str(err):
pass
else:
raise err
finally: finally:
e.set() e.set()