lbry-sdk/scripts/fast_sync.py

20 lines
502 B
Python
Raw Normal View History

2020-02-28 05:52:18 +01:00
import os.path
import asyncio
from lbry.blockchain import Lbrycrd
from lbry.blockchain.sync import BlockSync
async def main():
chain = Lbrycrd(os.path.expanduser('~/.lbrycrd'), False)
sync = BlockSync(chain, use_process_pool=True)
if os.path.exists(sync.db.sync_db.db_file_path):
os.remove(sync.db.sync_db.db_file_path)
await sync.db.open()
await sync.load_blocks()
#await chain.stop(False)
try:
asyncio.run(main())
except KeyboardInterrupt:
print('exiting')