fixed some issues

pull/634/head
Yhtyyar Sahatov 2022-06-22 15:34:02 +03:00
rodzic 4166d71d41
commit 2336dba7c9
3 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -179,7 +179,7 @@ def handle_historical_crawl(args: argparse.Namespace) -> None:
web3.middleware_onion.inject(geth_poa_middleware, layer=0) web3.middleware_onion.inject(geth_poa_middleware, layer=0)
last_labeled_block = get_first_labeled_block_number( last_labeled_block = get_first_labeled_block_number(
db_session, blockchain_type, args.address db_session, blockchain_type, args.address, only_events=args.only_events
) )
logger.info(f"Last labeled block: {last_labeled_block}") logger.info(f"Last labeled block: {last_labeled_block}")

Wyświetl plik

@ -38,6 +38,7 @@ def _get_block_timestamp_from_web3(
Gets the timestamp of a block from the blockchain. Gets the timestamp of a block from the blockchain.
will raise an exception if the block is not found. will raise an exception if the block is not found.
""" """
logger.info(f"Getting block timestamp from web3 for block {block_number}")
return web3.eth.getBlock(block_number).timestamp return web3.eth.getBlock(block_number).timestamp

Wyświetl plik

@ -79,7 +79,7 @@ def historical_crawler(
from_block=batch_end_block, from_block=batch_end_block,
to_block=start_block, to_block=start_block,
blocks_cache=blocks_cache, blocks_cache=blocks_cache,
db_block_query_batch=max_blocks_batch * 2, db_block_query_batch=max_blocks_batch,
) )
logger.info( logger.info(
f"Crawled {len(all_events)} events from {start_block} to {batch_end_block}." f"Crawled {len(all_events)} events from {start_block} to {batch_end_block}."