本文整理汇总了Python中Crawler.Crawler.highestBlockMongo方法的典型用法代码示例。如果您正苦于以下问题:Python Crawler.highestBlockMongo方法的具体用法?Python Crawler.highestBlockMongo怎么用?Python Crawler.highestBlockMongo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crawler.Crawler
的用法示例。
在下文中一共展示了Crawler.highestBlockMongo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: syncMongo
# 需要导入模块: from Crawler import Crawler [as 别名]
# 或者: from Crawler.Crawler import highestBlockMongo [as 别名]
syncMongo(c)
# Initialize a TxnGraph and save it every N blocks
N = 1000
t = None
# Global vars
CSVFILE = "Scripts/blockchain.csv"
STEP = 1000
# Sync with the CSV file
if os.path.exists(CSVFILE):
prev_max_block = syncCSV(CSVFILE)
# Catch the CSV data up
_highestBlockMongo = c.highestBlockMongo()
if prev_max_block + STEP <= _highestBlockMongo:
t = TxnGraph(1, prev_max_block+STEP)
for i in tqdm.tqdm(range(_highestBlockMongo//STEP)):
if t.end_block > prev_max_block:
blocks = ParsedBlocks(t)
t.extend(STEP)
else:
t.end_block += STEP
while True:
# Sync
syncMongo(c)
# Initialize TxnGraph if it doesn't exist yet