Documentation ¶
Index ¶
- type AccountManager
- func (manager *AccountManager) AddParticipation(participation account.Participation) bool
- func (manager *AccountManager) DeleteOldKeys(current basics.Round, proto config.ConsensusParams)
- func (manager *AccountManager) HasLiveKeys(from, to basics.Round) bool
- func (manager *AccountManager) Keys() (out []account.Participation)
- type GenesisBalances
- type Ledger
- func (l *Ledger) AddressTxns(id basics.Address, r basics.Round) ([]transactions.SignedTxnWithAD, error)
- func (l *Ledger) AssemblePayset(pool *pools.TransactionPool, eval *ledger.BlockEvaluator, deadline time.Time) (stats telemetryspec.AssembleBlockStats)
- func (l *Ledger) BalanceRecord(r basics.Round, addr basics.Address) (basics.BalanceRecord, error)
- func (l *Ledger) Circulation(r basics.Round) (basics.MicroAlgos, error)
- func (l *Ledger) ConsensusParams(r basics.Round) (config.ConsensusParams, error)
- func (l *Ledger) ConsensusVersion(r basics.Round) (protocol.ConsensusVersion, error)
- func (l *Ledger) EnsureBlock(block *bookkeeping.Block, c agreement.Certificate)
- func (l *Ledger) EnsureValidatedBlock(vb *ledger.ValidatedBlock, c agreement.Certificate)
- func (l *Ledger) LastRound() basics.Round
- func (l *Ledger) LookupDigest(r basics.Round) (crypto.Digest, error)
- func (l *Ledger) LookupTxid(txid transactions.Txid, r basics.Round) (stxn transactions.SignedTxnWithAD, found bool, err error)
- func (l *Ledger) NextRound() basics.Round
- func (l *Ledger) Seed(r basics.Round) (committee.Seed, error)
- type SolicitedTxHandler
- type TxHandler
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 ¶
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 ¶
BalanceRecord implements Ledger.BalanceRecord. It applies pending rewards to returned amounts.
func (*Ledger) Circulation ¶
Circulation implements agreement.Ledger.Circulation.
func (*Ledger) ConsensusParams ¶
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 ¶
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 ¶
LastRound returns the local latest round of the network i.e. the *last* written block
func (*Ledger) LookupDigest ¶
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
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