blockchain

package
v0.0.0-...-e39e4f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package blockchain holds the core blockchain logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockChain

type BlockChain struct {
	Count      uint
	First      string
	Head       string
	Collection string
}

BlockChain is the BlockChain.

It will hold the following fields:

Count      uint   //How many blocks are in the chain.
First      string //Hash of the first block on the chain. This will often be "Genesis" or "AccountGenesis"
Head       string //Hash of the current head of the chain. That is the most recent block.
Collection string //Which "collection" is this chain concerned with.  This is database stuff.

Collection, as stated above, will deal with which collection it is in in the database.
If we continue with mongodb, this will be the collection. If we move to BoltDB, this will be
the bucket that the data is in. In most cases, Collection will be "root" or "accounts" but may
be something else if a later application needs to use a different bucket.  For instance, the
chat chains that we eventually want to implement may create a new named collection chat_identifier
where identifier is whatever unique identifier the app decides to user.

type ChainManager

type ChainManager struct {
	BlockChains map[string]BlockChain
}

ChainManager will primarily be a list of BlockChains with functions attached to carry out various activities.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL