Documentation ¶
Index ¶
- type AccountManager
- func (manager *AccountManager) AddParticipation(participation account.PersistedParticipation) bool
- func (manager *AccountManager) DeleteOldKeys(latestHdr bookkeeping.BlockHeader, ccSigs map[basics.Address]basics.Round, ...)
- func (manager *AccountManager) FlushRegistry(timeout time.Duration)
- 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.StateProofRecordForRound)
- type Ledger
- func (l *Ledger) AddressTxns(id basics.Address, r basics.Round) ([]transactions.SignedTxnWithAD, error)
- func (l *Ledger) Circulation(r basics.Round) (basics.MicroNovas, 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)
- func (l *Ledger) SetDirInData(dir string)
- 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, registry account.ParticipationRegistry) *AccountManager
MakeAccountManager creates a new AccountManager with a custom logger 새로운 어카운트 매니져를 만든다.
func (*AccountManager) AddParticipation ¶
func (manager *AccountManager) AddParticipation(participation account.PersistedParticipation) 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(latestHdr bookkeeping.BlockHeader, ccSigs map[basics.Address]basics.Round, agreementProto config.ConsensusParams)
DeleteOldKeys deletes all accounts' ephemeral keys strictly older than the next round needed for each account.
func (*AccountManager) FlushRegistry ¶
func (manager *AccountManager) FlushRegistry(timeout time.Duration)
FlushRegistry tells the underlying participation registry to flush it's change cache to the DB.
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.StateProofRecordForRound)
StateProofKeys returns a list of Participation accounts, and their stateproof secrets
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).
이 패키지의 원장객체는 ledger패키지의 래퍼이다. 이 래퍼객체는 오리지널 원장 코드의 복잡도의 증가 없이 api를 제공하기 위해 존재한다. 원장 객체는 또한 원장이 가지고 있는 데이터의 하위집합을 리턴하는 다양한 래퍼객체를 구현한다.
func LoadLedger ¶
func LoadLedger( log logging.Logger, dbFilenamePrefix string, memory bool, genesisProto protocol.ConsensusVersion, genesisBal bookkeeping.GenesisBalances, genesisID string, genesisHash crypto.Digest, blockListeners []ledger.BlockListener, listener ledger.ValidateBlockListener, cfg config.Local, ) (*Ledger, error)
LoadLedger creates a Ledger object to represent the ledger with the specified database file prefix, initializing it if necessary. LoadLedger는 지정된 데이터베이스 파일 접두사로 원장을 나타내는 Ledger 객체를 생성하고 필요한 경우 초기화합니다.
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
func (*Ledger) NextRound ¶
NextRound returns the *next* block to write i.e. latest() + 1 Implements agreement.Ledger.NextRound
func (*Ledger) Seed ¶
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
func (*Ledger) SetDirInData ¶
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
SolicitedTxHandler는 가십 네트워크 이외의 채널을 통해 수신된 메시지를 처리합니다. 따라서 수신/발신 메시지의 개념을 우회합니다.
type TxHandler ¶
type TxHandler struct {
// contains filtered or unexported fields
}
TxHandler handles transaction messages TxHandler는 트랜잭션 메시지를 처리하는 구조체이다.
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 MakeTxHandler는 트랜잭션 메시지에 대한 새로운 핸들러를 만듭니다.
func (*TxHandler) SolicitedTxHandler ¶
func (handler *TxHandler) SolicitedTxHandler() SolicitedTxHandler
SolicitedTxHandler converts a transaction handler to a SolicitedTxHandler