gd

package
v0.0.0-...-d1f6b9b Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: LGPL-2.1 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecalculateHash

func RecalculateHash(block Block) string

Types

type Block

type Block struct {
	Hash              string
	Height            int64
	Payload           Payload
	Time              int64
	PreviousBlockHash string
}

func (*Block) Validate

func (block *Block) Validate() bool

type BlockChain

type BlockChain struct {
	Chain  []Block
	Height int64
}

func (*BlockChain) AddBlock

func (bc *BlockChain) AddBlock(bl Block) Block

func (*BlockChain) GetBlockByHash

func (bc *BlockChain) GetBlockByHash(hash string) (Block, error)

func (*BlockChain) GetBlockByHeight

func (bc *BlockChain) GetBlockByHeight(height int64) (*Block, error)

func (*BlockChain) GetStarByWalletAddress

func (bc *BlockChain) GetStarByWalletAddress(address string) []string

func (*BlockChain) InitializeChain

func (bc *BlockChain) InitializeChain()

func (*BlockChain) RequestMessageOwnershipVerification

func (bc *BlockChain) RequestMessageOwnershipVerification(address string) string

func (*BlockChain) SubmitStar

func (bc *BlockChain) SubmitStar(address string, message string, signature string, star string) (*Block, error)

type Payload

type Payload struct {
	Owner string
	Star  string
}

Jump to

Keyboard shortcuts

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