Browse Source

Save checkpoints as individual .json files

p2p_privacy
fekt 10 months ago
parent
commit
e53220b5f1
  1. 12
      contrib/sda_checkpoints.pl

12
contrib/sda_checkpoints.pl

@ -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};
@ -41,8 +41,12 @@ while (1) {
chomp $merkle;
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};
$blocktime =~ s/^\s+|\s+$//g;
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;
}

Loading…
Cancel
Save