node

package
v0.0.0-...-15eb78e Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package node is the Algorand node itself, with functions exposed to the frontend

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgorandFullNode

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

AlgorandFullNode specifies and implements a full Algorand node. AlgorandFullNode는 전체 Algorand 노드를 지정하고 구현합니다.

func MakeFull

func MakeFull(log logging.Logger, rootDir string, cfg config.Local, phonebookAddresses []string, genesis bookkeeping.Genesis) (*AlgorandFullNode, error)

MakeFull sets up an Algorand full node MakeFull은 Algorand 전체 노드를 설정합니다. (i.e., it returns a node that participates in consensus)

func (*AlgorandFullNode) AbortCatchup

func (node *AlgorandFullNode) AbortCatchup(catchpoint string) error

AbortCatchup aborts the given catchpoint this function is intended to be called externally via the REST api interface. AbortCatchup은 주어진 캐치포인트를 중단합니다. 이 함수는 REST API 인터페이스를 통해 외부적으로 호출되도록 되어 있습니다.

func (*AlgorandFullNode) AppendParticipationKeys

func (node *AlgorandFullNode) AppendParticipationKeys(partKeyID account.ParticipationID, keys account.StateProofKeys) error

AppendParticipationKeys given a participation id, remove the records from the node AppendParticipationKeys에 참여 ID가 주어지면 노드에서 레코드를 제거합니다.

func (*AlgorandFullNode) AssembleBlock

func (node *AlgorandFullNode) AssembleBlock(round basics.Round) (agreement.ValidatedBlock, error)

AssembleBlock implements Ledger.AssembleBlock.

func (*AlgorandFullNode) BroadcastSignedTxGroup

func (node *AlgorandFullNode) BroadcastSignedTxGroup(txgroup []transactions.SignedTxn) (err error)

BroadcastSignedTxGroup broadcasts a transaction group that has already been signed. BroadcastSignedTxGroup은 이미 서명된 트랜잭션 그룹을 브로드캐스트합니다.

func (*AlgorandFullNode) Config

func (node *AlgorandFullNode) Config() config.Local

Config returns a copy of the node's Local configuration Config는 노드의 로컬 구성 사본을 반환합니다.

func (*AlgorandFullNode) GenesisHash

func (node *AlgorandFullNode) GenesisHash() crypto.Digest

GenesisHash returns the hash of the genesis configuration. GenesisHash는 Genesis 구성의 해시를 반환합니다.

func (*AlgorandFullNode) GenesisID

func (node *AlgorandFullNode) GenesisID() string

GenesisID returns the ID of the genesis node.

func (*AlgorandFullNode) GetParticipationKey

func (node *AlgorandFullNode) GetParticipationKey(partKeyID account.ParticipationID) (account.ParticipationRecord, error)

GetParticipationKey retries the information of a participation id from the node GetParticipationKey는 노드의 참여 ID 정보를 재시도합니다.

func (*AlgorandFullNode) GetPendingTransaction

func (node *AlgorandFullNode) GetPendingTransaction(txID transactions.Txid) (res TxnWithStatus, found bool)

GetPendingTransaction looks for the required txID in the recent ledger blocks, in the txpool, and in the txpool's status cache. It returns the SignedTxn (with status information), and a bool to indicate if the transaction was found. GetPendingTransaction은 최근 원장 블록, txpool 및 txpool의 상태 캐시에서 필요한 txID를 찾습니다. SignedTxn(상태 정보 포함)과 트랜잭션이 발견되었는지 나타내는 bool을 반환합니다.

func (*AlgorandFullNode) GetPendingTxnsFromPool

func (node *AlgorandFullNode) GetPendingTxnsFromPool() ([]transactions.SignedTxn, error)

GetPendingTxnsFromPool returns a snapshot of every pending transactions from the node's transaction pool in a slice. Transactions are sorted in decreasing order. If no transactions, returns an empty slice. GetPendingTxnsFromPool은 슬라이스의 노드 트랜잭션 풀에서 보류 중인 모든 트랜잭션의 스냅샷을 반환합니다. 트랜잭션은 내림차순으로 정렬됩니다. 트랜잭션이 없으면 빈 슬라이스를 반환합니다.

func (*AlgorandFullNode) GetPrioWeight

func (node *AlgorandFullNode) GetPrioWeight(addr basics.Address) uint64

GetPrioWeight implements the network.NetPrioScheme interface

func (*AlgorandFullNode) GetTransaction

func (node *AlgorandFullNode) GetTransaction(addr basics.Address, txID transactions.Txid, minRound basics.Round, maxRound basics.Round) (TxnWithStatus, bool)

GetTransaction looks for the required txID within with a specific account within a range of rounds (inclusive) and returns the SignedTxn and true iff it finds the transaction. GetTransaction은 라운드 범위(포함) 내에서 특정 계정으로 필요한 txID를 찾고 트랜잭션을 찾으면 SignedTxn 및 true를 반환합니다.

func (*AlgorandFullNode) GetTransactionByID

func (node *AlgorandFullNode) GetTransactionByID(txid transactions.Txid, rnd basics.Round) (TxnWithStatus, error)

GetTransactionByID gets transaction by ID this function is intended to be called externally via the REST api interface. GetTransactionByID는 ID별로 트랜잭션을 가져옵니다. 이 함수는 REST API 인터페이스를 통해 외부에서 호출하도록 되어 있습니다.

func (*AlgorandFullNode) Indexer

func (node *AlgorandFullNode) Indexer() (*indexer.Indexer, error)

Indexer returns a pointer to nodes indexer 인덱서는 노드 인덱서에 대한 포인터를 반환합니다.

func (*AlgorandFullNode) InstallParticipationKey

func (node *AlgorandFullNode) InstallParticipationKey(partKeyBinary []byte) (account.ParticipationID, error)

InstallParticipationKey Given a participation key binary stream install the participation key. InstallParticipationKey 참여 키 바이너리 스트림이 주어지면 참여 키를 설치합니다.

func (*AlgorandFullNode) IsArchival

func (node *AlgorandFullNode) IsArchival() bool

IsArchival returns true the node is an archival node, false otherwise IsArchival은 노드가 보관 노드인 경우 true를 반환하고 그렇지 않으면 false를 반환합니다.

func (*AlgorandFullNode) Ledger

func (node *AlgorandFullNode) Ledger() *data.Ledger

Ledger exposes the node's ledger handle to the algod API code Ledger는 노드의 원장 핸들을 algod API 코드에 노출시킵니다.

func (*AlgorandFullNode) ListParticipationKeys

func (node *AlgorandFullNode) ListParticipationKeys() (partKeys []account.ParticipationRecord, err error)

ListParticipationKeys returns all participation keys currently installed on the node ListParticipationKeys는 현재 노드에 설치된 모든 참여 키를 반환합니다.

func (*AlgorandFullNode) ListTxns

func (node *AlgorandFullNode) ListTxns(addr basics.Address, minRound basics.Round, maxRound basics.Round) ([]TxnWithStatus, error)

ListTxns returns SignedTxns associated with a specific account in a range of Rounds (inclusive). TxnWithStatus returns the round in which a particular transaction appeared, since that information is not part of the SignedTxn itself. ListTxns는 Rounds(포함) 범위의 특정 계정과 연결된 SignedTxns를 반환합니다. TxnWithStatus는 해당 정보가 SignedTxn 자체의 일부가 아니기 때문에 특정 트랜잭션이 나타난 라운드를 반환합니다.

func (*AlgorandFullNode) ListeningAddress

func (node *AlgorandFullNode) ListeningAddress() (string, bool)

ListeningAddress retrieves the node's current listening address, if any. Returns true if currently listening, false otherwise. ListeningAddress는 노드의 현재 수신 대기 주소를 검색합니다(있는 경우). 현재 수신 중인 경우 true를 반환하고, 그렇지 않으면 false를 반환합니다.

func (*AlgorandFullNode) MakePrioResponse

func (node *AlgorandFullNode) MakePrioResponse(challenge string) []byte

MakePrioResponse implements the network.NetPrioScheme interface

func (*AlgorandFullNode) NewPrioChallenge

func (node *AlgorandFullNode) NewPrioChallenge() string

NewPrioChallenge implements the network.NetPrioScheme interface

func (*AlgorandFullNode) OnNewBlock

func (node *AlgorandFullNode) OnNewBlock(block bookkeeping.Block, delta ledgercore.StateDelta)

OnNewBlock implements the BlockListener interface so we're notified after each block is written to the ledger OnNewBlock은 BlockListener 인터페이스를 구현하므로 각 블록이 원장에 기록된 후 알림을 받습니다.

func (*AlgorandFullNode) PoolStats

func (node *AlgorandFullNode) PoolStats() PoolStats

PoolStats returns a PoolStatus structure reporting stats about the transaction pool PoolStats는 트랜잭션 풀에 대한 통계를 보고하는 PoolStatus 구조를 반환합니다.

func (*AlgorandFullNode) Record

func (node *AlgorandFullNode) Record(account basics.Address, round basics.Round, participationType account.ParticipationAction)

Record forwards participation record calls to the participation registry. Record는 참여 기록 호출을 참여 레지스트리로 전달합니다.

func (*AlgorandFullNode) RemoveParticipationKey

func (node *AlgorandFullNode) RemoveParticipationKey(partKeyID account.ParticipationID) error

RemoveParticipationKey given a participation id, remove the records from the node RemoveParticipationKey에 참여 ID가 주어지면 노드에서 레코드를 제거합니다.

func (*AlgorandFullNode) SetCatchpointCatchupMode

func (node *AlgorandFullNode) SetCatchpointCatchupMode(catchpointCatchupMode bool) (outCtxCh <-chan context.Context)

SetCatchpointCatchupMode change the node's operational mode from catchpoint catchup mode and back, it returns a channel which contains the updated node context. This function need to work asyncronisly so that the caller could detect and handle the usecase where the node is being shut down while we're switching to/from catchup mode without deadlocking on the shared node mutex. SetCatchpointCatchupMode는 캐치포인트 캐치업 모드에서 노드의 작동 모드를 변경하고 다시 업데이트된 노드 컨텍스트를 포함하는 채널을 반환합니다. 이 함수는 공유 노드 뮤텍스에서 교착 상태 없이 캐치업 모드로/그로부터 전환하는 동안 호출자가 노드가 종료되는 사용 사례를 감지하고 처리할 수 있도록 비동기식으로 작동해야 합니다.

func (*AlgorandFullNode) Start

func (node *AlgorandFullNode) Start()

Start the node: connect to peers and run the agreement service while obtaining a lock. Doesn't wait for initial sync. 노드 시작: 피어에 연결하고 잠금을 얻으면서 계약 서비스를 실행합니다. 초기 동기화를 기다리지 않습니다.

func (*AlgorandFullNode) StartCatchup

func (node *AlgorandFullNode) StartCatchup(catchpoint string) error

StartCatchup starts the catchpoint mode and attempt to get to the provided catchpoint this function is intended to be called externally via the REST api interface. StartCatchup은 캐치포인트 모드를 시작하고 제공된 캐치포인트에 도달하려고 시도합니다. 이 함수는 REST API 인터페이스를 통해 외부적으로 호출되도록 되어 있습니다.

func (*AlgorandFullNode) Status

func (node *AlgorandFullNode) Status() (s StatusReport, err error)

Status returns a StatusReport structure reporting our status as Active and with our ledger's LastRound Status는 상태를 활성으로 보고하고 원장의 LastRound와 함께 StatusReport 구조를 반환합니다.

func (*AlgorandFullNode) Stop

func (node *AlgorandFullNode) Stop()

Stop stops running the node. Once a node is closed, it can never start again. Stop, 노드를 한번 닫으면 다신 시작할 수 없다.

func (*AlgorandFullNode) SuggestedFee

func (node *AlgorandFullNode) SuggestedFee() basics.MicroNovas

SuggestedFee returns the suggested fee per byte recommended to ensure a new transaction is processed in a timely fashion. Caller should set fee to max(MinTxnFee, SuggestedFee() * len(encoded SignedTxn)) SuggestedFee는 새 트랜잭션이 적시에 처리되도록 권장되는 바이트당 제안된 요금을 반환합니다. 호출자는 수수료를 max(MinTxnFee, SuggestedFee() * len(encoded SignedTxn))로 설정해야 합니다.

func (*AlgorandFullNode) Uint64

func (node *AlgorandFullNode) Uint64() uint64

Uint64 implements the randomness by calling the crypto library. Uint64는 암호화 라이브러리를 호출하여 임의성을 구현합니다.

func (*AlgorandFullNode) VerifyPrioResponse

func (node *AlgorandFullNode) VerifyPrioResponse(challenge string, response []byte) (addr basics.Address, err error)

VerifyPrioResponse implements the network.NetPrioScheme interface

func (*AlgorandFullNode) VotingKeys

func (node *AlgorandFullNode) VotingKeys(votingRound, keysRound basics.Round) []account.ParticipationRecordForRound

VotingKeys implements the key manager's VotingKeys method, and provides additional validation with the ledger. that allows us to load multiple overlapping keys for the same account, and filter these per-round basis. VotingKeys는 키 관리자의 VotingKeys 메서드를 구현하고 원장과 함께 추가 유효성 검사를 제공합니다. 동일한 계정에 대해 중복되는 여러 키를 로드하고 라운드별로 필터링할 수 있습니다.

type CatchpointAlreadyInProgressError

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

CatchpointAlreadyInProgressError indicates that the requested catchpoint is already running

func MakeCatchpointAlreadyInProgressError

func MakeCatchpointAlreadyInProgressError(catchpoint string) *CatchpointAlreadyInProgressError

MakeCatchpointAlreadyInProgressError creates the error

func (*CatchpointAlreadyInProgressError) Error

Error satisfies builtin interface `error`

type CatchpointUnableToStartError

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

CatchpointUnableToStartError indicates that the requested catchpoint cannot be started

func MakeCatchpointUnableToStartError

func MakeCatchpointUnableToStartError(catchpointRunning, catchpointRequested string) *CatchpointUnableToStartError

MakeCatchpointUnableToStartError creates the error

func (*CatchpointUnableToStartError) Error

Error satisfies builtin interface `error`

type PoolStats

type PoolStats struct {
	NumConfirmed   uint64
	NumOutstanding uint64
	NumExpired     uint64
}

PoolStats represents some statistics about the transaction pool

type StatusReport

type StatusReport struct {
	LastRound                 basics.Round
	LastVersion               protocol.ConsensusVersion
	NextVersion               protocol.ConsensusVersion
	NextVersionRound          basics.Round
	NextVersionSupported      bool
	LastRoundTimestamp        time.Time
	SynchronizingTime         time.Duration
	CatchupTime               time.Duration
	HasSyncedSinceStartup     bool
	StoppedAtUnsupportedRound bool
	LastCatchpoint            string // the last catchpoint hit by the node. This would get updated regardless of whether the node is catching up using catchpoints or not.
	Catchpoint                string // the catchpoint where we're currently catching up to. If the node isn't in fast catchup mode, it will be empty.\
	// 우리가 현재 따라잡고 있는 목표 지점입니다. 노드가 빠른 따라잡기 모드에 있지 않으면 비어 있습니다.
	CatchpointCatchupTotalAccounts     uint64
	CatchpointCatchupProcessedAccounts uint64
	CatchpointCatchupVerifiedAccounts  uint64
	CatchpointCatchupTotalBlocks       uint64
	CatchpointCatchupAcquiredBlocks    uint64
}

StatusReport represents the current basic status of the node StatusReport는 노드의 현재 기본 상태를 나타냅니다.

func (StatusReport) TimeSinceLastRound

func (status StatusReport) TimeSinceLastRound() time.Duration

TimeSinceLastRound returns the time since the last block was approved (locally), or 0 if no blocks seen TimeSinceLastRound는 마지막 블록이 (로컬로) 승인된 이후의 시간을 반환하거나 블록이 보이지 않으면 0을 반환합니다.

type TxnWithStatus

type TxnWithStatus struct {
	Txn transactions.SignedTxn

	// Zero indicates no confirmation
	// 0은 확인이 없음을 나타냅니다.
	ConfirmedRound basics.Round

	// PoolError indicates that the transaction was kicked out of this node's transaction pool (and specifies why that happened).
	// An empty string indicates the transaction wasn't kicked out of this node's txpool due to an error.
	// PoolError는 트랜잭션이 이 노드의 트랜잭션 풀에서 쫓겨났음을 나타냅니다(그리고 왜 그런 일이 발생했는지 지정).
	// 빈 문자열은 트랜잭션이 오류로 인해 이 노드의 txpool에서 추방되지 않았음을 나타냅니다.
	PoolError string

	// ApplyData is the transaction.ApplyData, if committed.
	// ApplyData는 커밋된 경우 transaction.ApplyData입니다.
	ApplyData transactions.ApplyData
}

TxnWithStatus represents information about a single transaction, in particular, whether it has appeared in some block yet or not, and whether it was kicked out of the txpool due to some error. TxnWithStatus는 단일 트랜잭션에 대한 정보, 특히 아직 특정 블록에 나타나지 않았는지, 어떤 오류로 인해 txpool에서 쫓겨났는지 여부를 나타냅니다.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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