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.

40 lines
761 B

  1. #!/usr/bin/perl
  2. #
  3. # Intent:
  4. # testing it !
  5. #
  6. # Note:
  7. # This work has been done during my time at Doctor I·T
  8. #
  9. # -- Copyright drit, 2021 --
  10. #
  11. BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
  12. #use if -e $LIB, $LIB.'/seed';
  13. use seed qw(rand64);
  14. use toychain qw(blockHash displayBlock);
  15. use YAML::Syck qw(Dump);
  16. print "// testing blockaddr\n";
  17. printf "chain.hash %s\n",$toychain::chain->[-1];
  18. printf "head.addr %s\n",$toychain::HEADs[0]->{bkaddr};
  19. # f96885aa : 21.4min
  20. # 044ce1de : 20.5min
  21. if (0) {
  22. &seed::setseed(0x21683774);
  23. my $n0 = rand64(); # n < 18446744073709551616
  24. printf "n0:%s\n",$n0;
  25. }
  26. displayBlock($toychain::genesis);
  27. my $hash = &blockHash($toychain::genesis);
  28. printf "genesis.hash %s\n",$hash;
  29. print ".\n";
  30. exit $?;
  31. 1;