assignment01bca

package module
v0.0.0-...-260d19c Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 4 Imported by: 0

README

assignment01bca

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Calculate_Hash

func Calculate_Hash(block *Block) string

func Change_Block

func Change_Block(block *Block)

func Change_Block_Menu

func Change_Block_Menu()

func DisplayMerkelTree

func DisplayMerkelTree(root *Node)

func Display_Blocks

func Display_Blocks(Last_block *Block)
func Menu()

func Mine_Block

func Mine_Block(new_block *Block) bool

func Verify_Chain

func Verify_Chain(Last_block *Block)

Types

type Block

type Block struct {
	// data                   string
	MerkleTree             *Node
	Nonce                  string
	Previous_block_address *Block
	Previous_Block_hash    string
	Block_number           int
	Block_hash             string
}

Block Chain

func Add_To_Blockchain

func Add_To_Blockchain(Previous_block_address *Block, new_block *Block) *Block

func New_Block

func New_Block(merkelTree *Node, Nonce string) *Block

type Blockchain

type Blockchain struct {
	Genesis_block *Block
	Last_block    *Block
}

func Create_Blockchain

func Create_Blockchain() *Blockchain

type Node

type Node struct {
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////// Merkel Tree

func Get_Random_Transactions

func Get_Random_Transactions() *Node

func Get_Transactions

func Get_Transactions() *Node

Jump to

Keyboard shortcuts

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