block

package
v0.0.0-...-9bf9bed Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateHash

func CalculateHash(block *Block) string

calculateHash calculates the hash of a block. Replace with a real hash function.

Types

type Block

type Block struct {
	Index        int
	PrevHash     string
	Hash         string
	TimeStamp    string
	Data         string
	Transactions []*Transaction
}

Add a Transactions field to your Block struct

func CreateGenesisBlock

func CreateGenesisBlock() *Block

type Transaction

type Transaction struct {
	From   *ecdsa.PublicKey
	To     *ecdsa.PublicKey
	Amount int
}

Jump to

Keyboard shortcuts

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