data

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountManager

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

AccountManager loads and manages accounts for the node

func MakeAccountManager

func MakeAccountManager(log logging.Logger) *AccountManager

MakeAccountManager creates a new AccountManager with a custom logger

func (*AccountManager) AddParticipation

func (manager *AccountManager) AddParticipation(participation account.Participation) bool

AddParticipation adds a new account.Participation to be managed. The return value indicates if the key has been added (true) or if this is a duplicate key (false).

func (*AccountManager) DeleteOldKeys

func (manager *AccountManager) DeleteOldKeys(current basics.Round, proto config.ConsensusParams)

DeleteOldKeys deletes all accounts' ephemeral keys strictly older than the current round.

func (*AccountManager) HasLiveKeys

func (manager *AccountManager) HasLiveKeys(from, to basics.Round) bool

HasLiveKeys returns true if we have any Participation keys valid for the specified round range (inclusive)

func (*AccountManager) Keys

func (manager *AccountManager) Keys() (out []account.Participation)

Keys returns a list of Participation accounts.

type GenesisBalances

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

GenesisBalances contains the information needed to generate a new ledger

func MakeGenesisBalances

func MakeGenesisBalances(balances map[basics.Address]basics.AccountData, feeSink, rewardsPool basics.Address) GenesisBalances

MakeGenesisBalances returns the information needed to bootstrap the ledger based on the current time

func MakeTimestampedGenesisBalances

func MakeTimestampedGenesisBalances(balances map[basics.Address]basics.AccountData, feeSink, rewardsPool basics.Address, timestamp int64) GenesisBalances

MakeTimestampedGenesisBalances returns the information needed to bootstrap the ledger based on a given time

type Ledger

type Ledger struct {
	*ledger.Ledger
	// contains filtered or unexported fields
}

The Ledger object in this (data) package provides a wrapper around the Ledger from the ledger package. The reason for this is compatibility with the existing callers of the previous ledger API, without increasing the complexity of the ledger.Ledger code. This Ledger object also implements various wrappers that return subsets of data exposed by ledger.Ledger, or return it in different forms, or return it for the latest round (as opposed to arbitrary rounds).

func LoadLedger

func LoadLedger(
	log logging.Logger, dbFilenamePrefix string, memory bool,
	genesisProto protocol.ConsensusVersion, genesisBal GenesisBalances, genesisID string, genesisHash crypto.Digest,
	blockListeners []ledger.BlockListener, isArchival bool,
) (*Ledger, error)

LoadLedger creates a Ledger object to represent the ledger with the specified database file prefix, initializing it if necessary.

func (*Ledger) AddressTxns

func (l *Ledger) AddressTxns(id basics.Address, r basics.Round) ([]transactions.SignedTxnWithAD, error)

AddressTxns returns the list of transactions to/from a given address in specific round

func (*Ledger) AssemblePayset

func (l *Ledger) AssemblePayset(pool *pools.TransactionPool, eval *ledger.BlockEvaluator, deadline time.Time) (stats telemetryspec.AssembleBlockStats)

AssemblePayset adds transactions to a BlockEvaluator.

func (*Ledger) BalanceRecord

func (l *Ledger) BalanceRecord(r basics.Round, addr basics.Address) (basics.BalanceRecord, error)

BalanceRecord implements Ledger.BalanceRecord. It applies pending rewards to returned amounts.

func (*Ledger) Circulation

func (l *Ledger) Circulation(r basics.Round) (basics.MicroAlgos, error)

Circulation implements agreement.Ledger.Circulation.

func (*Ledger) ConsensusParams

func (l *Ledger) ConsensusParams(r basics.Round) (config.ConsensusParams, error)

ConsensusParams gives the consensus parameters agreed on in a given round, returning an error if we don't have that round or we have an I/O error. Implements agreement.Ledger.ConsensusParams

func (*Ledger) ConsensusVersion

func (l *Ledger) ConsensusVersion(r basics.Round) (protocol.ConsensusVersion, error)

ConsensusVersion gives the consensus version agreed on in a given round, returning an error if we don't have that round or we have an I/O error. Implements agreement.Ledger.ConsensusVersion

func (*Ledger) EnsureBlock

func (l *Ledger) EnsureBlock(block *bookkeeping.Block, c agreement.Certificate)

EnsureBlock ensures that the block, and associated certificate c, are written to the ledger, or that some other block for the same round is written to the ledger.

func (*Ledger) EnsureValidatedBlock

func (l *Ledger) EnsureValidatedBlock(vb *ledger.ValidatedBlock, c agreement.Certificate)

EnsureValidatedBlock ensures that the block, and associated certificate c, are written to the ledger, or that some other block for the same round is written to the ledger.

func (*Ledger) LastRound

func (l *Ledger) LastRound() basics.Round

LastRound returns the local latest round of the network i.e. the *last* written block

func (*Ledger) LookupDigest

func (l *Ledger) LookupDigest(r basics.Round) (crypto.Digest, error)

LookupDigest gives the block hash that was agreed on in a given round, returning an error if we don't have that round or we have an I/O error. Implements agreement.Ledger.LookupDigest

func (*Ledger) LookupTxid

func (l *Ledger) LookupTxid(txid transactions.Txid, r basics.Round) (stxn transactions.SignedTxnWithAD, found bool, err error)

LookupTxid returns the transaction with a given ID in a specific round

func (*Ledger) NextRound

func (l *Ledger) NextRound() basics.Round

NextRound returns the *next* block to write i.e. latest() + 1 Implements agreement.Ledger.NextRound

func (*Ledger) Seed

func (l *Ledger) Seed(r basics.Round) (committee.Seed, error)

Seed gives the VRF seed that was agreed on in a given round, returning an error if we don't have that round or we have an I/O error. Implements agreement.Ledger.Seed

type SolicitedTxHandler

type SolicitedTxHandler interface {
	Handle(txgroup []transactions.SignedTxn) error
}

SolicitedTxHandler handles messages received through channels other than the gossip network. It therefore circumvents the notion of incoming/outgoing messages

type TxHandler

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

TxHandler handles transaction messages

func MakeTxHandler

func MakeTxHandler(txPool *pools.TransactionPool, ledger *Ledger, net network.GossipNode, genesisID string, genesisHash crypto.Digest, executionPool execpool.BacklogPool) *TxHandler

MakeTxHandler makes a new handler for transaction messages

func (*TxHandler) SolicitedTxHandler

func (handler *TxHandler) SolicitedTxHandler() SolicitedTxHandler

SolicitedTxHandler converts a transaction handler to a SolicitedTxHandler

func (*TxHandler) Start

func (handler *TxHandler) Start()

Start enables the processing of incoming messages at the transaction handler

func (*TxHandler) Stop

func (handler *TxHandler) Stop()

Stop suspends the processing of incoming messages at the transaction handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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