block

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockOptions

type BlockOptions = common.BlockOptions

BlockOptions defines the options for creating block components

func DefaultBlockOptions

func DefaultBlockOptions() BlockOptions

DefaultBlockOptions returns the default block options

type Components

type Components struct {
	Executor  *executing.Executor
	Reaper    *reaping.Reaper
	Syncer    *syncing.Syncer
	Submitter *submitting.Submitter
	Cache     cache.Manager
	// contains filtered or unexported fields
}

Components represents the block-related components

func NewAggregatorComponents

func NewAggregatorComponents(
	config config.Config,
	genesis genesis.Genesis,
	store store.Store,
	exec coreexecutor.Executor,
	sequencer coresequencer.Sequencer,
	da coreda.DA,
	signer signer.Signer,
	headerBroadcaster broadcaster[*types.SignedHeader],
	dataBroadcaster broadcaster[*types.Data],
	logger zerolog.Logger,
	metrics *Metrics,
	blockOpts BlockOptions,
) (*Components, error)

NewAggregatorComponents creates components for an aggregator full node that can produce and sync blocks. Aggregator nodes have full capabilities - they can produce blocks, sync from P2P and DA, and submit headers/data to DA. Requires a signer for block production and DA submission.

func NewSyncComponents

func NewSyncComponents(
	config config.Config,
	genesis genesis.Genesis,
	store store.Store,
	exec coreexecutor.Executor,
	da coreda.DA,
	headerStore goheader.Store[*types.SignedHeader],
	dataStore goheader.Store[*types.Data],
	logger zerolog.Logger,
	metrics *Metrics,
	blockOpts BlockOptions,
) (*Components, error)

NewSyncComponents creates components for a non-aggregator full node that can only sync blocks. Non-aggregator full nodes can sync from P2P and DA but cannot produce blocks or submit to DA. They have more sync capabilities than light nodes but no block production. No signer required.

func (*Components) GetLastState

func (bc *Components) GetLastState() types.State

GetLastState returns the current blockchain state

func (*Components) Start

func (bc *Components) Start(ctx context.Context) error

Start starts all components and monitors for critical errors

func (*Components) Stop

func (bc *Components) Stop() error

Stop stops all components

type Metrics

type Metrics = common.Metrics

Expose Metrics for constructor

func NopMetrics

func NopMetrics() *Metrics

NopMetrics creates a new NopMetrics instance.

func PrometheusMetrics

func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics

PrometheusMetrics creates a new PrometheusMetrics instance with the given namespace and labelsAndValues.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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