pos

package
v0.0.0-...-2eef10d Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

README

Node need todo

  • Allow it to enter a token balance
  • Receive a broadcast of the latest blockchain
  • Receive a broadcast of which validator in the network won the latest block
  • Add itself to the overall list of validators
  • Enter block data BPM --remember, this is each validator's pulse rate
  • Propose a new block

Test

  • Use Linux nc command nc localhost 9090

  • Enter Balance you want to set.

  • BPM use to generate a new block

Reference

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Blockchain []Block

Blockchain is a series of validated Blocks

Functions

func PickWinner

func PickWinner()

pickWinner creates a lottery pool of validators and chooses the validator who gets to forge a block to the blockchain by random selecting from the pool, weighted by amount of tokens staked

func Run

func Run()

Types

type Block

type Block struct {
	Index     int
	Timestamp string
	BPM       int
	Hash      string
	PrevHash  string
	Validator string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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