deso

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixUtxoOps = byte(0)

	// Public key balances
	PrefixBalanceSnapshots = byte(1)

	// Creator coins
	PrefixLockedBalanceSnapshots = byte(2)
)
View Source
const (
	InputOpType  = "INPUT"
	OutputOpType = "OUTPUT"

	Online  Mode = "ONLINE"
	Offline Mode = "OFFLINE"

	Mainnet Network = "MAINNET"
	Testnet Network = "TESTNET"

	// CreatorCoin is the SubAccount address for a public key's
	// total DESO locked in their creator coin.
	CreatorCoin = "CREATOR_COIN"
)

Variables

View Source
var (
	Currency = types.Currency{
		Symbol:   "DESO",
		Decimals: 9,
	}

	OperationTypes = []string{
		InputOpType,
		OutputOpType,
	}

	SuccessStatus  = "SUCCESS"
	RevertedStatus = "REVERTED"

	MinFeeRateNanosPerKB = uint64(1000)
)

Functions

func GetBalanceForPublicKeyAtBlockHeightWithTxn added in v1.2.6

func GetBalanceForPublicKeyAtBlockHeightWithTxn(
	txn *badger.Txn, isLockedBalance bool, publicKey *lib.PublicKey, blockHeight uint64) uint64

Types

type Config

type Config struct {
	Mode                   Mode
	Network                *types.NetworkIdentifier
	Params                 *lib.DeSoParams
	Currency               *types.Currency
	GenesisBlockIdentifier *types.BlockIdentifier
	Port                   int
	NodePort               int
	DataDirectory          string
	MinerPublicKeys        []string
	Regtest                bool
	ConnectIPs             []string
}

func LoadConfig

func LoadConfig() (*Config, error)

type Index added in v1.2.6

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

func NewIndex added in v1.2.6

func NewIndex(db *badger.DB) *Index

func (*Index) GetBalanceSnapshot added in v1.2.6

func (index *Index) GetBalanceSnapshot(isLockedBalance bool, publicKey *lib.PublicKey, blockHeight uint64) uint64

func (*Index) GetUtxoOps added in v1.2.6

func (index *Index) GetUtxoOps(block *lib.MsgDeSoBlock) ([][]*lib.UtxoOperation, error)

func (*Index) PutBalanceSnapshot added in v1.2.6

func (index *Index) PutBalanceSnapshot(
	block *lib.MsgDeSoBlock, isLockedBalance bool, balances map[lib.PublicKey]uint64) error

func (*Index) PutUtxoOps added in v1.2.6

func (index *Index) PutUtxoOps(block *lib.MsgDeSoBlock, utxoOps [][]*lib.UtxoOperation) error

type Mode

type Mode string

type Network

type Network string

type Node

type Node struct {
	*lib.Server
	Params       *lib.DeSoParams
	EventManager *lib.EventManager
	Index        *Index
	Online       bool
	Config       *Config
}

func NewNode

func NewNode(config *Config) *Node

func (*Node) CurrentBlock

func (node *Node) CurrentBlock() *types.Block

func (*Node) GetBlock

func (node *Node) GetBlock(hash string) *types.Block

func (*Node) GetBlockAtHeight

func (node *Node) GetBlockAtHeight(height int64) *types.Block

func (*Node) Start

func (node *Node) Start()

Jump to

Keyboard shortcuts

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