Save checkpoints as individual .json files
This commit is contained in:
10
contrib/sda_checkpoints.pl
Normal file → Executable file
10
contrib/sda_checkpoints.pl
Normal file → Executable file
@@ -12,8 +12,8 @@ my $hush = "./src/hush-cli";
|
||||
my $getblock= "$hush getblock";
|
||||
my $gethash = "$hush getblockhash";
|
||||
my $gettree = "$hush getblockmerkletree";
|
||||
my $start = shift || 1190000;
|
||||
my $end = shift || 1260000;
|
||||
my $start = shift || 1390000;
|
||||
my $end = shift || 1422000;
|
||||
my $stride = shift || 10000;
|
||||
|
||||
my $blocks = qx{$hush getblockcount};
|
||||
@@ -42,7 +42,11 @@ while (1) {
|
||||
chomp $blockhash;
|
||||
chomp $blocktime;
|
||||
$blocktime =~ s/^\s+|\s+$//g;
|
||||
print qq{{\n\t"network": "main",\n\t"height": "$block",\n\t"hash": "$blockhash",\n\t$blocktime\n\t"saplingTree": "$merkle"\n},\n};
|
||||
my $checkpoint = qq{{\n\t"network": "main",\n\t"height": "$block",\n\t"hash": "$blockhash",\n\t$blocktime\n\t"saplingTree": "$merkle"\n}\n};
|
||||
my $filename = "$block.json";
|
||||
open(FH, '>', $filename) or die $!;
|
||||
print FH $checkpoint;
|
||||
close(FH);
|
||||
|
||||
$block += $stride;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user