catchup

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: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockAuthenticator

type BlockAuthenticator interface {
	Authenticate(*bookkeeping.Block, *agreement.Certificate) error
	Quit()
}

A BlockAuthenticator authenticates blocks given a certificate. 블록 인증자는 인증서에 지정된 블록을 인증합니다.

Note that Authenticate does not check if the block contents match their header as it only checks the block header. If the contents have not been checked yet, callers should also call block. ContentsMatchHeader and reject blocks that do not pass this check. Authenticate는 블록 헤더만 확인하므로 블록 내용이 헤더와 일치하는지 확인하지 않습니다. 내용이 아직 확인되지 않았다면 호출자도 블록을 호출해야 합니다. ContentsMatchHeader 및 이 검사를 통과하지 못한 블록을 거부합니다.

type CatchpointCatchupNodeServices

type CatchpointCatchupNodeServices interface {
	SetCatchpointCatchupMode(bool) (newContextCh <-chan context.Context)
}

CatchpointCatchupNodeServices defines the extenal node support needed for the catchpoint service to switch the node between "regular" operational mode and catchup mode. CatchpointCatchupNodeServices는 캐치포인트 서비스가 "일반" 작동 모드와 캐치업 모드 사이에서 노드를 전환하는 데 필요한 외부 노드 지원을 정의합니다.

type CatchpointCatchupService

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

CatchpointCatchupService represents the catchpoint catchup service. CatchpointCatchupService는 캐치포인트 캐치업 서비스를 나타냅니다.

func MakeNewCatchpointCatchupService

func MakeNewCatchpointCatchupService(catchpoint string, node CatchpointCatchupNodeServices, log logging.Logger, net network.GossipNode, l *ledger.Ledger, cfg config.Local) (service *CatchpointCatchupService, err error)

MakeNewCatchpointCatchupService creates a new catchpoint catchup service for a node that is not in catchpoint catchup mode MakeNewCatchpointCatchupService는 캐치포인트 캐치업 모드가 아닌 노드에 대해 새로운 캐치포인트 캐치업 서비스를 생성합니다.

func MakeResumedCatchpointCatchupService

func MakeResumedCatchpointCatchupService(ctx context.Context, node CatchpointCatchupNodeServices, log logging.Logger, net network.GossipNode, l *ledger.Ledger, cfg config.Local) (service *CatchpointCatchupService, err error)

MakeResumedCatchpointCatchupService creates a catchpoint catchup service for a node that is already in catchpoint catchup mode MakeResumedCatchpointCatchupService는 이미 캐치포인트 캐치업 모드에 있는 노드에 대한 캐치포인트 캐치업 서비스를 생성합니다.

func (*CatchpointCatchupService) Abort

func (cs *CatchpointCatchupService) Abort()

Abort aborts the catchpoint catchup process 중단은 캐치포인트 캐치업 프로세스를 중단합니다.

func (*CatchpointCatchupService) GetLatestBlockHeader

func (cs *CatchpointCatchupService) GetLatestBlockHeader() bookkeeping.BlockHeader

GetLatestBlockHeader returns the last block header that was available at the time the catchpoint catchup service started GetLatestBlockHeader는 catchpoint catchup 서비스가 시작될 때 사용 가능한 마지막 블록 헤더를 반환합니다.

func (*CatchpointCatchupService) GetStatistics

func (cs *CatchpointCatchupService) GetStatistics() (out CatchpointCatchupStats)

GetStatistics returns a copy of the current catchpoint catchup statistics GetStatistics는 현재 캐치포인트 캐치업 통계의 복사본을 반환합니다.

func (*CatchpointCatchupService) Start

func (cs *CatchpointCatchupService) Start(ctx context.Context)

Start starts the catchpoint catchup service ( continue in the process ) 시작은 캐치포인트 캐치업 서비스를 시작합니다(프로세스 계속).

func (*CatchpointCatchupService) Stop

func (cs *CatchpointCatchupService) Stop()

Stop stops the catchpoint catchup service - unlike Abort, this is not intended to abort the process but rather to allow cleanup of in-memory resources for the purpose of clean shutdown. Stop은 캐치포인트 캐치업 서비스를 중지합니다. - Abort와 달리 이는 프로세스를 중단하기 위한 것이 아니라 완전한 종료를 위해 메모리 내 리소스를 정리할 수 있도록 하기 위한 것입니다.

type CatchpointCatchupStats

type CatchpointCatchupStats struct {
	CatchpointLabel   string
	TotalAccounts     uint64
	ProcessedAccounts uint64
	VerifiedAccounts  uint64
	TotalBlocks       uint64
	AcquiredBlocks    uint64
	VerifiedBlocks    uint64
	ProcessedBytes    uint64
	StartTime         time.Time
}

CatchpointCatchupStats is used for querying and reporting the current state of the catchpoint catchup process CatchpointCatchupStats는 catchpoint catchup 프로세스의 현재 상태를 쿼리하고 보고하는 데 사용됩니다.

type HTTPFetcher

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

HTTPFetcher implements FetcherClient doing an HTTP GET of the block HTTPFetcher는 블록의 HTTP GET을 수행하는 FetcherClient를 구현합니다.

type Ledger

type Ledger interface {
	agreement.LedgerReader
	AddBlock(bookkeeping.Block, agreement.Certificate) error
	EnsureBlock(block *bookkeeping.Block, c agreement.Certificate)
	LastRound() basics.Round
	Block(basics.Round) (bookkeeping.Block, error)
	IsWritingCatchpointFile() bool
	Validate(ctx context.Context, blk bookkeeping.Block, executionPool execpool.BacklogPool) (*ledgercore.ValidatedBlock, error)
	AddValidatedBlock(vb ledgercore.ValidatedBlock, cert agreement.Certificate) error
}

Ledger represents the interface of a block database which the catchup server should interact with. Ledger는 캐치업 서버가 상호 작용해야 하는 블록 데이터베이스의 인터페이스를 나타냅니다.

type PendingUnmatchedCertificate

type PendingUnmatchedCertificate struct {
	Cert         agreement.Certificate
	VoteVerifier *agreement.AsyncVoteVerifier
}

PendingUnmatchedCertificate is a single certificate that is being waited upon to have its corresponding block fetched. PendingUnmatchedCertificate는 해당 블록을 가져오기 위해 대기 중인 단일 인증서입니다.

type Service

type Service struct {

	// The channel gets closed when the initial sync is complete.
	// This allows for other services to avoid the overhead of starting prematurely
	// (before this node is caught-up and can validate messages for example).
	// 초기 동기화가 완료되면 채널이 닫힙니다.
	// 이렇게 하면 다른 서비스가 조기에 시작하는 오버헤드를 피할 수 있습니다.
	// (예를 들어 이 노드가 따라잡혀 메시지를 확인할 수 있기 전에).
	InitialSyncDone chan struct{}
	// contains filtered or unexported fields
}

Service represents the catchup service. Once started and until it is stopped, it ensures that the ledger is up to date with network. 서비스는 캐치업 서비스를 나타냅니다. 일단 시작되고 중지될 때까지 원장이 네트워크에서 최신 상태인지 확인합니다.

func MakeService

func MakeService(log logging.Logger, config config.Local, net network.GossipNode, ledger Ledger, auth BlockAuthenticator, unmatchedPendingCertificates <-chan PendingUnmatchedCertificate, blockValidationPool execpool.BacklogPool) (s *Service)

MakeService creates a catchup service instance from its constituent components MakeService는 구성 요소에서 캐치업 서비스 인스턴스를 생성합니다.

func (*Service) IsSynchronizing

func (s *Service) IsSynchronizing() (synchronizing bool, initialSync bool)

IsSynchronizing returns true if we're currently executing a sync() call - either initial catchup or attempting to catchup after too-long waiting for next block. Also returns a 2nd bool indicating if this is our initial sync 현재 sync() 호출을 실행 중인 경우 IsSynchronizing이 true를 반환합니다. - 초기 캐치업 또는 다음 블록을 너무 오래 기다린 후 캐치업을 시도합니다. 이것이 초기 동기화인지 여부를 나타내는 두 번째 bool도 반환합니다.

func (*Service) Start

func (s *Service) Start()

Start the catchup service

func (*Service) Stop

func (s *Service) Stop()

Stop informs the catchup service that it should stop, and waits for it to stop (when periodicSync() exits) Stop은 캐치업 서비스에 중지해야 함을 알리고 중지될 때까지 기다립니다(주기적인 Sync()가 종료될 때).

func (*Service) SynchronizingTime

func (s *Service) SynchronizingTime() time.Duration

SynchronizingTime returns the time we've been performing a catchup operation (0 if not currently catching up) 동기화 시간은 따라잡기 작업을 수행한 시간을 반환합니다(현재 따라잡지 않은 경우 0).

Jump to

Keyboard shortcuts

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