Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_sync_block with 1000 block gap #3558

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions scripts/sync_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import argparse



def get_height(method, url, post_data, headers):

parsed_url = urllib.parse.urlparse(url)
Expand Down Expand Up @@ -44,8 +43,9 @@ def check_or_do(network):
current_height = get_height(method, url, post_data, headers)
print("main current_height is %s, last_export_height is %s" %
(current_height, last_export_height))
export_height = int(current_height) - 1000

if int(current_height) - int(last_export_height) > 10000:
if export_height - int(last_export_height) > 10000:

# export block, kubectl exec
export_tmp = "kubectl exec -it -n starcoin-%s starcoin-1 -- /starcoin/starcoin_db_exporter export-block-range --db-path /sc-data/%s -s %s -e %s -n %s -o /sc-data/."
Expand All @@ -55,7 +55,6 @@ def check_or_do(network):
print(export_cmd)
os.system(export_cmd)


# tar block csv file
filename = "block_%s_%s.csv" % (start, end)
file_compress_name = "%s.tar.gz" % filename
Expand Down