store

package
v0.0.0-...-a72a3d3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaOpen byte = iota
	MetaReceive
	MetaSend
	MetaChange
)

Variables

View Source
var LiveConfig = Config{
	"DATA",
	blocks.LiveGenesisBlock,
}
View Source
var TestConfig = Config{
	"TESTDATA",
	blocks.TestGenesisBlock,
}
View Source
var TestConfigLive = Config{
	"TESTDATA",
	blocks.LiveGenesisBlock,
}

Functions

func FetchBlock

func FetchBlock(hash types.BlockHash) (b blocks.Block)

func FetchOpen

func FetchOpen(account types.Account) (b *blocks.OpenBlock)

func GetBalance

func GetBalance(block blocks.Block) uint128.Uint128

func Init

func Init(config Config)

func StoreBlock

func StoreBlock(block blocks.Block) error

Validate and store a block TODO: Validate signature and balance

Types

type BlockItem

type BlockItem struct {
	badger.Item
}

func (*BlockItem) ToBlock

func (i *BlockItem) ToBlock() blocks.Block

type Config

type Config struct {
	Path         string
	GenesisBlock *blocks.OpenBlock
}
var Conf *Config

Jump to

Keyboard shortcuts

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