Documentation ¶
Index ¶
- Variables
- type AccountManager
- func (manager *AccountManager) AddParticipation(participation account.PersistedParticipation, ephemeral bool) bool
- func (manager *AccountManager) DeleteOldKeys(latestHdr bookkeeping.BlockHeader, agreementProto config.ConsensusParams)
- func (manager *AccountManager) DeleteStateProofKey(id account.ParticipationID, round basics.Round) error
- func (manager *AccountManager) HasLiveKeys(from, to basics.Round) bool
- func (manager *AccountManager) Keys(rnd basics.Round) (out []account.ParticipationRecordForRound)
- func (manager *AccountManager) Record(account basics.Address, round basics.Round, ...)
- func (manager *AccountManager) Registry() account.ParticipationRegistry
- func (manager *AccountManager) StateProofKeys(rnd basics.Round) (out []account.StateProofSecretsForRound)
- type HybridRelayer
- type Ledger
- func (l *Ledger) AddressTxns(id basics.Address, r basics.Round) ([]transactions.SignedTxnWithAD, error)
- func (l *Ledger) Circulation(r basics.Round, voteRnd 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 *ledgercore.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
- type TxHandlerOpts
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidLedger = errors.New("MakeTxHandler: ledger is nil on initialization")
ErrInvalidLedger is reported when nil is passed for the ledger
var ErrInvalidTxPool = errors.New("MakeTxHandler: txPool is nil on initialization")
ErrInvalidTxPool is reported when nil is passed for the tx pool
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, registry account.ParticipationRegistry) *AccountManager
MakeAccountManager creates a new AccountManager with a custom logger
func (*AccountManager) AddParticipation ¶
func (manager *AccountManager) AddParticipation(participation account.PersistedParticipation, ephemeral bool) 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). if ephemeral is true then the key is not stored in the internal hashmap and will not be deleted by DeleteOldKeys()
func (*AccountManager) DeleteOldKeys ¶
func (manager *AccountManager) DeleteOldKeys(latestHdr bookkeeping.BlockHeader, agreementProto config.ConsensusParams)
DeleteOldKeys deletes all accounts' ephemeral keys strictly older than the next round needed for each account.
func (*AccountManager) DeleteStateProofKey ¶
func (manager *AccountManager) DeleteStateProofKey(id account.ParticipationID, round basics.Round) error
DeleteStateProofKey deletes keys related to a ParticipationID. The function removes all keys up to, and not including, the given 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(rnd basics.Round) (out []account.ParticipationRecordForRound)
Keys returns a list of Participation accounts, and their keys/secrets for requested round.
func (*AccountManager) Record ¶
func (manager *AccountManager) Record(account basics.Address, round basics.Round, participationType account.ParticipationAction)
Record asynchronously records a participation key usage event.
func (*AccountManager) Registry ¶
func (manager *AccountManager) Registry() account.ParticipationRegistry
Registry fetches the ParticipationRegistry.
func (*AccountManager) StateProofKeys ¶
func (manager *AccountManager) StateProofKeys(rnd basics.Round) (out []account.StateProofSecretsForRound)
StateProofKeys returns a list of Participation accounts, and their stateproof secrets
type HybridRelayer ¶
type HybridRelayer interface {
BridgeP2PToWS(ctx context.Context, tag protocol.Tag, data []byte, wait bool, except network.Peer) error
}
HybridRelayer is an interface for relaying p2p transactions to WS network
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[T string | ledger.DirsAndPrefix]( log logging.Logger, dir T, memory bool, genesisProto protocol.ConsensusVersion, genesisBal bookkeeping.GenesisBalances, genesisID string, genesisHash crypto.Digest, cfg config.Local, ) (*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) 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 the consensus version could not be figured using either the block header for the given round, or the latest block header. 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. This function can be called concurrently.
func (*Ledger) EnsureValidatedBlock ¶
func (l *Ledger) EnsureValidatedBlock(vb *ledgercore.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(opts TxHandlerOpts) (*TxHandler, error)
MakeTxHandler makes a new handler for transaction messages
func (*TxHandler) LocalTransaction ¶
func (handler *TxHandler) LocalTransaction(txgroup []transactions.SignedTxn) error
LocalTransaction is a special shortcut handler for local transactions and intended to be used for performance testing and debugging purposes only since it does not have congestion control and duplicates detection.
func (*TxHandler) SolicitedTxHandler ¶
func (handler *TxHandler) SolicitedTxHandler() SolicitedTxHandler
SolicitedTxHandler converts a transaction handler to a SolicitedTxHandler
type TxHandlerOpts ¶
type TxHandlerOpts struct { TxPool *pools.TransactionPool ExecutionPool execpool.BacklogPool Ledger *Ledger Net network.GossipNode GenesisID string GenesisHash crypto.Digest Config config.Local }
TxHandlerOpts is TxHandler configuration options