Skip to content

Commit

Permalink
the db exporter has a 1000 block gap, so export height should at leas…
Browse files Browse the repository at this point in the history
…t 1000 lower then latest height (#3558)
  • Loading branch information
yourmoonlight authored Jul 22, 2022
1 parent 7bbf1d4 commit c243e14
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit c243e14

Please sign in to comment.