Trying out a homemade DAG - Why? (HON on a DAG) - Yes, it will be a tangle, we can use that name, right?!
A problem we had in our project was fees for transactions
They were not necessary, but we had to put it in to incentivize the validation of transactions. Now, theoretically, we don't. We'll use a DAG (at least we'll try) and the IOTA paradigm of "self-inclusion" of validations. We'll do a bit differently though. Instead of validating two previous transactions, we'll test always validating the whole Markov Blanket of a randomly chosen incoming transaction. We'll borrow the terminology used, i. e. a tip.
Here's the very start code we'll procure
#unit package EC::Network:auth<github:bioduds>;
unit module EC::DAG;
class Node {
has $.ID is required;
has $.timestamp is required;
has $.nonce is required;
has $.SEED is required;
}
role Blanket {
has Node $.parents;
has Node $.children;
has Node $.children-parents;
}
class Genesis is Node is Blanket {
has $.treasure = 85000000000000.000001;
method birth {
say "Setting up Treasure";
self!init-local;
}
method !init-local {
say "Init Local";
self!begin-genesis-ritual;
}
method !begin-genesis-ritual {
say "Beginning Genesis Ritual";
say "We need to: ";
say "1. Find all 7 Init Nodes";
my $seven-status = self!find-seven-nodes;
}
method !find-seven-nodes {
my @nodes;
@nodes[1] = prompt "Enter 1st Node: ";
@nodes[2] = prompt "Enter 2nd Node: ";
@nodes[3] = prompt "Enter 3rd Node: ";
@nodes[4] = prompt "Enter 4th Node: ";
@nodes[5] = prompt "Enter 5th Node: ";
@nodes[6] = prompt "Enter 6th Node: ";
@nodes[7] = prompt "Enter 7th Node: ";
@nodes[0] = $.nonce;
for @nodes -> $node {
print "Got: $node";
}
return True;
}
}
Cheers! Upvote to help! :)
EDUARDO CAPANEMA
@bitworkers