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.
 
 
 
 
 
 

53 lines
1.1 KiB

#!/usr/bin/perl -w
#
# Intent:
# testing it !
#
# Note:
# This work has been done during my time at Doctor I·T
#
# -- Copyright drit, 2021 --
#
BEGIN { print "// ToyChain !\n"; }
use lib 'lib';
use seed qw(rand64);
use misc qw(khash $Zempty);
use toychain;
use encode qw(mbase58);
#printf "encode::EXPORT_OK: %s\n",join',',@encode::EXPORT_OK;
use YAML::Syck qw(Dump);
my $seed = &seed::setseed('Intentionally good!');
my $salt = rand64();
printf "salt: %s\n",$salt;
my $headhash = $toychain::HEADs[0]->{bkaddr};
printf "genesis: %s\n",$headhash;
print "// testing getTxMeta\n";
my $txblock = getTxMeta();
print "// testing blockCreation\n";
# createBlock(seed,payload,txblock,comment)
my $block = &createBlock($seed,"This is the 2nd block payload",$txblock,'1st comment for new block');
displayBlock($block);
print "// testing insertBlock:\n";
my $chain = &insertBlock($toychain::HEADs[0],$block);
createDot($toychain::chain);
displayChain($toychain::chain);
saveChain($toychain::chain);
#$head = newBlock(1,'this is a playload',$Zempty,$head,$salt);
#printf "head: %s\n",mbase58($head);
exit $?;
1;