blockchain

package
v0.0.0-...-f015ca5 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Position  uint64
	Timestamp string
	Data      BlockData
	Hash      string
	PrevHash  string
}

func NewBlock

func NewBlock(data BlockData, prevBlock *Block) (*Block, error)

func (*Block) IsGenesis

func (b *Block) IsGenesis() bool

type BlockData

type BlockData interface {
	ToString() string
}

type Blockchain

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

func NewBlockchain

func NewBlockchain() *Blockchain

func (*Blockchain) AddBlock

func (bc *Blockchain) AddBlock(data BlockData) error

func (*Blockchain) GetWritiableBlocks

func (bc *Blockchain) GetWritiableBlocks() []*writableBlock

Jump to

Keyboard shortcuts

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