Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ANode ¶
type ANode struct { Version types.VersionField // Version of this data structure TimeStamp types.TimeStamp // Timestamp of the construction of this entry ChainID types.Hash // The ChainID SubChainIDs []types.Hash // SubChainIDs required to build the ChainID ExtIDs []types.DataField // External ids used to create the chain id above ( see ExternalIDsToChainID() ) Content types.DataField // BytesSlice for holding generic data for this entry }
ANode Data is entered into system by the Accumulator as a series of entries organized by chainIDs Unlike Factom, we will attempt to create a chain if the ChainID provided is nil. We provide a function to compute the ChainID from the first entry in a chain, for use by applications. If a chain already exists, creating the chain will be ignored.
ANode
Version uint8 TimeStamp uint64 ChainID [32]byte len(SubChains) uint64 SubChains []SubChain Len(SubChain) uint16 SubChain[] []byte #ExtIDs uint16 ExtIDs []ExtID len(ExtID) uint16 ExtID []byte len(content) uint16 Content []byte
func (ANode) GetHash ¶
GetHash Returns the EntryHash for this entry. Note the ANode Hash does not include the SubChainIDs
type EntryHash ¶
type EntryHash struct { SubChains []types.Hash // SubChainIDs used to create the ChainID ChainID types.Hash // The ChainID EntryHash types.Hash // The EntryHash }
EntryHash The accumulator assumes the ANode has already been written to the (a) database. It is only dealing with EntryHashes
type NEList ¶
type NEList struct { ChainID types.Hash // ChainsInBlock or SubChain ID that leads to a node, or a ChainID that leads to an ANode MDRoot types.Hash // Merkle Dag of either sub nodes or entries }
NEList Node List (NEList) is a struct of a ChainID and a Node Hash
type Node ¶
type Node struct { Version types.VersionField // Version of this data structure BHeight types.BlockHeight // Block Height SequenceNum types.Sequence // Sequence Number for this chain of nodes TimeStamp types.TimeStamp // TimeStamp by Accumulator when the structure was built ChainID types.Hash // The ChainID (Directory Block - zeros, SubNodes - 1st ChainID, Entries - ChainID) SubChainIDs []types.Hash // SubChainIDs to build ChainID, Directory Block - zeros Previous types.Hash // Hash of previous Block Header IsNode bool // IsNode is true for a node, is false for an entry ListMDRoot types.Hash // Merkle DAG of the entries of the List (only the hashes) List []NEList // List of ChainIDs/MDRoots for Directory block or sub block nodes EntryList []types.Hash // List of Entry Hashes for an Entry node MarshalCache []byte // Cache of the marshaled form of the node. Do NOT marshal a node unless }
func (Node) GetMDRoot ¶
GetMDRoot The MDRoot is the combination of the header on the left, and the listMDRoot on the right. Returns a nil if the MDRoot doesn't exist do to missing data
func (Node) Marshal ¶
Marshal Convert the given entry into a byte slice. Add to that the SubChainIDs of the ChainID. Returns nil if anything goes wrong while marshaling
func (Node) Put ¶
Put Put this node into the database. There is a little special treatment for the Directory Blocks. In that case, the ChainID is the DID for the root Accumulator, and there are no SubChainIDs.