Jonathan "Duke" Leto
6 years ago
2 changed files with 40 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use warnings; |
|||
use POSIX qw(strftime); |
|||
use JSON; |
|||
|
|||
my $rescan = shift || "true"; |
|||
my $num_blocks = int( shift || 1000 ); |
|||
my $output = qx{./fiat/verus listtransactions "" $num_blocks}; |
|||
my $blocks = decode_json($output); |
|||
for my $block (@$blocks) { |
|||
next unless $block->{category} eq 'immature'; |
|||
my $address = $block->{address}; |
|||
chomp(my $privkey = qx{./fiat/verus dumpprivkey $address}); |
|||
# print the commands to import these keys into another node |
|||
print qq{./fiat/verus importprivkey $privkey "" $rescan # $address \n}; |
|||
} |
|||
|
@ -0,0 +1,21 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use warnings; |
|||
use POSIX qw(strftime); |
|||
use JSON; |
|||
|
|||
my $cli = shift || "komodo-cli"; |
|||
my $rescan = shift || "true"; |
|||
my $output = qx{$cli getaddressesbyaccount ""}; |
|||
my $addrs = decode_json($output); |
|||
|
|||
# Print a bash script that you can use to import privkeys on another node |
|||
# DO NOT LEAVE THIS LYING AROUND WHERE OTHER CAN FIND IT |
|||
print "#!/bin/bash\n"; |
|||
for my $address (@$addrs) { |
|||
chomp(my $privkey = qx{./fiat/verus dumpprivkey $address}); |
|||
# print the commands to import these keys into another node |
|||
print qq{./fiat/verus importprivkey $privkey "" $rescan # $address \n}; |
|||
} |
|||
|
Loading…
Reference in new issue