Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accumulator ¶
type Accumulator struct { DB *database.DB // Database to hold and index the data collected by the Accumulator EntryCnt atomic.AtomicInt64 // Count of entries written ChainsInBlock atomic.AtomicInt64 // Count of chains written to ChainCnt atomic.AtomicInt64 // Count of all chains // contains filtered or unexported fields }
Accumulator The accumulator takes a feed of EntryHash objects to construct the cryptographic structure proving the order and content of the entries submitted to the Validators. Validators validate the data, and store the data into key/value stores, and send streams of hashes to the Accumulators. Validators are assumed to be knowledgeable of the actual use case of the system, and able to validate the data prior to submission to the accumulator. Of course, the Accumulator does secure and order the data, so it is reasonable that a validator may optimistically record entries that might be invalidated by applications after recording.
func (*Accumulator) GetEntryFeed ¶
func (a *Accumulator) GetEntryFeed() chan node.EntryHash
func (*Accumulator) Init ¶
func (a *Accumulator) Init(db *database.DB, chainID *types.Hash) ( EntryFeed chan node.EntryHash, control chan bool, mdFeed chan *types.Hash)
Allocate the HashMap and Channels for this accumulator The ChainID is the Digital Identity of the Accumulator. We will want to integrate useful digital IDs into the accumulator structure to ensure the integrity of the data collected.
func (*Accumulator) Run ¶
func (a *Accumulator) Run()
type ChainAcc ¶
type ChainAcc struct { Node node.Node // The node we are building MD *merkleDag.MD // The class for creating the MD and MD Roots // contains filtered or unexported fields }
ChainAcc Tracks the construction of the Merkle DAG and collects the Hash sequence to build the MD
func NewChainAcc ¶
type NodeBlock ¶
type NodeBlock struct { ChainID *types.Hash SequenceNumber int32 Height uint32 Timestamp uint64 MD types.Hash Previous types.Hash }
NodeBlock A Node Block collects a set of Merkle DAGs and creates a MD from that. At the root, the NodeBlock is called the Directory Block in Factom. But as this is a much higher volume architecture, we don't limit ourselves to Directory Blocks and Entry Blocks, but use a more general structure of nodes. At the leaf level, a node is pretty much an entry block, and the previous Hash links back to the previous entry block for a chain. Sequence numbers count from 1 (the first entry block in a chain) and up.
If the SequenceNumber is zero and the Previous Hash is nil, this is an intermediate node, and all chains are equal to the given ChainID, and less than the next NodeBlock's ChainID. covering particular ranges of chains