You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
948 B
37 lines
948 B
#
|
|
|
|
BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
|
|
|
|
use config qw($config);
|
|
use ECKeys qw($keys $registration);
|
|
use TXPOOL qw(signTx isTxValid);
|
|
use misc qw(kwdigest);
|
|
use botname qw(botname);
|
|
use YAML::Syck qw(LoadFile Dump);
|
|
|
|
printf "--- registration %s...\n",Dump($registration);
|
|
|
|
printf "registration.coinbase.public: %s (%s)\n",
|
|
$registration->{'coinbase'}{public},
|
|
&botname($registration->{'coinbase'}{public});
|
|
printf "keys.verification.public: %s (%s)\n",
|
|
$keys->{'verification'}{public},
|
|
&botname($keys->{'verification'}{public});
|
|
|
|
$UTXO->{$ECKeys::keys->{verification}{public}} = $config->{coinbase}{reward};
|
|
printf "--- UTXO %s...\n",Dump($UTXO);
|
|
|
|
my $tx = LoadFile($ENV{SITE}.'/templ/txcb01.yml');
|
|
my $txkw = &kwdigest($tx);
|
|
printf "txkw: %s\n",$txkw;
|
|
|
|
my $tx = &signTx($tx);
|
|
#printf "--- tx (%s) %s...\n",$txkw,Dump($tx);
|
|
|
|
my $txok = &isTxValid($tx);
|
|
printf "is %s valid: ? %s\n",$txkw,$txok;
|
|
|
|
exit $?;
|
|
|
|
1;
|
|
|