diff --git a/block0.yml b/block0.yml deleted file mode 100644 index 7cdf6b0..0000000 --- a/block0.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- # block genesis -ver: 0x00 -seq: 0 # blocknumber (on 32bit max block-number : 4294967296) -# ipfs object new unixfs-dir -data: QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn -# echo -n '' | ipfs add -bkprev: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH diff --git a/genesis.yml b/genesis.yml new file mode 100644 index 0000000..24d41ca --- /dev/null +++ b/genesis.yml @@ -0,0 +1,15 @@ +--- # genesis block +ver: 0 +data: + seq: 0 + payload: QmWM48KvyK9YyPjJt69erxVPN3nbXVMgZWrncRJhAVkGAv + comment: "This is the genesis block" +meta: + seed: 0xb3560762 + salt: 442360558803467359 # used in address computation + txroot: ~ +audit: + peerid: QmcfHufAK9ErQ9ZKJF7YX68KntYYBJngkGDoVKcZEJyRve + tics: 1623830817245864895 + ip: 83.78.4.228 +prev: ZgjNT5GbSC81KmUPncwhzQAGV3GUeAXafmkMPBw2GMHWM diff --git a/lib b/lib index d0e0fdd..9d739e5 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit d0e0fdddfdffff4d23405b029266ab02498a009e +Subproject commit 9d739e5c4bb0b27babea7bdc441cfed6a85bb694 diff --git a/t/encode.t b/t/encode.t index 0c020fc..7b105c3 100644 --- a/t/encode.t +++ b/t/encode.t @@ -2,21 +2,21 @@ BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } } use encode qw(encode_basen decode_basen); -my $msg = 'no work yet !'; +my @msg = ( + 'no work yet !', + 'genesis nonce', + 'default nonce for block address', + 'initial nonce' +); +for my $msg (@msg) { +print "msg: $msg\n"; my $nonce = unpack 'Q',&decode_basen($msg,29); printf "nonce: %s\n",$nonce; printf "nonce16: %s\n",unpack'H*',pack('Q',$nonce); printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29); +print ".\n"; +} -my $nonce = unpack 'Q',&decode_basen('genesis nonce',29); -printf "nonce: %s\n",$nonce; -printf "nonce16: %s\n",unpack'H*',pack('Q',$nonce); -printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29); - -my $nonce = unpack 'Q',&decode_basen('initial nonce',29); -printf "nonce: %s\n",$nonce; -printf "nonce16: %s\n",unpack'H*',pack('Q',$nonce); -printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29); $msg = &encode_basen("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF",29); printf "msg: %s\n",$msg; diff --git a/testing.pl b/testing.pl index 59901a1..8ab351c 100644 --- a/testing.pl +++ b/testing.pl @@ -13,13 +13,12 @@ BEGIN { print "// ToyChain !\n"; } use lib 'lib'; use seed qw(rand64); -use misc qw(khash $null); +use misc qw(khash $ZNull); use toychain; use encode qw(mbase58); #printf "encode::EXPORT_OK: %s\n",join',',@encode::EXPORT_OK; -printf "ZNull: %s\n",&mbase58($null); use YAML::Syck qw(Dump); my $seed = &seed::setseed('Intentionally good!'); @@ -38,7 +37,7 @@ displayBlock($block); print "// testing insertBlock:\n"; my $chain = &insertBlock($toychain::HEADs[0],$block); -#displayChain($toychain::chain); +displayChain($toychain::chain);