node

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

README

Node package

This package is responsible for orchestrating the start of various components that make up the ten node.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteNetworkConfigToDisk

func WriteNetworkConfigToDisk(cfg *Config) error

Types

type Config

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

Config holds the properties that configure the package

func NewNodeConfig

func NewNodeConfig(opts ...Option) *Config

func (*Config) ToEnclaveConfig

func (c *Config) ToEnclaveConfig() *config.EnclaveConfig

func (*Config) ToHostConfig

func (c *Config) ToHostConfig() *config.HostInputConfig

func (*Config) UpdateNodeConfig

func (c *Config) UpdateNodeConfig(opts ...Option) *Config

type DockerNode

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

func NewDockerNode

func NewDockerNode(cfg *Config) *DockerNode

func (*DockerNode) Start

func (d *DockerNode) Start() error

func (*DockerNode) Stop

func (d *DockerNode) Stop() error

func (*DockerNode) Upgrade

func (d *DockerNode) Upgrade(networkCfg *NetworkConfig) error

type NetworkConfig

type NetworkConfig struct {
	ManagementContractAddress string
	MessageBusAddress         string
	L1StartHash               string // L1 block hash from which to process for L2 data (mgmt contract deploy block)
}

NetworkConfig is key network information required to start a node connecting to that network. We persist it as a json file on our testnet hosts so that they can read it off when restart/upgrading

func ReadNetworkConfigFromDisk

func ReadNetworkConfigFromDisk() (*NetworkConfig, error)

type Node

type Node interface {
	Start() error
	Stop() error
	Upgrade(networkCfg *NetworkConfig) error
}

type Option

type Option = func(c *Config)

Option is a function that applies configs to a Config Object

func WithBatchInterval

func WithBatchInterval(d string) Option

func WithCoinbase

func WithCoinbase(s string) Option

func WithDebugNamespaceEnabled

func WithDebugNamespaceEnabled(b bool) Option

func WithEdgelessDBImage

func WithEdgelessDBImage(s string) Option

func WithEnclaveDebug

func WithEnclaveDebug(b bool) Option

func WithEnclaveImage

func WithEnclaveImage(s string) Option

func WithEnclaveWSPort

func WithEnclaveWSPort(i int) Option

func WithGenesis

func WithGenesis(b bool) Option

func WithHostHTTPPort

func WithHostHTTPPort(i int) Option

func WithHostID

func WithHostID(s string) Option

func WithHostImage

func WithHostImage(s string) Option

func WithHostP2PHost

func WithHostP2PHost(s string) Option

func WithHostP2PPort

func WithHostP2PPort(i int) Option

func WithHostPublicP2PAddr

func WithHostPublicP2PAddr(s string) Option

func WithHostWSPort

func WithHostWSPort(i int) Option

func WithInMemoryHostDB

func WithInMemoryHostDB(b bool) Option

func WithInboundP2PDisabled

func WithInboundP2PDisabled(b bool) Option

func WithL1BlockTime

func WithL1BlockTime(d time.Duration) Option

func WithL1ChainID

func WithL1ChainID(i int) Option

func WithL1Start

func WithL1Start(blockHash string) Option

func WithL1WebsocketURL

func WithL1WebsocketURL(addr string) Option

func WithLogLevel

func WithLogLevel(i int) Option

func WithManagementContractAddress

func WithManagementContractAddress(s string) Option

func WithMaxBatchInterval

func WithMaxBatchInterval(d string) Option

func WithMessageBusContractAddress

func WithMessageBusContractAddress(s string) Option

func WithNodeName

func WithNodeName(s string) Option

func WithNodeType

func WithNodeType(nodeType string) Option

func WithObscuroGenesis

func WithObscuroGenesis(g string) Option

func WithPCCSAddr

func WithPCCSAddr(s string) Option

func WithPostgresDBHost added in v0.24.0

func WithPostgresDBHost(g string) Option

func WithPrivateKey

func WithPrivateKey(s string) Option

func WithProfiler

func WithProfiler(b bool) Option

func WithRollupInterval

func WithRollupInterval(d string) Option

func WithSGXEnabled

func WithSGXEnabled(b bool) Option

func WithSequencerP2PAddr added in v0.24.1

func WithSequencerP2PAddr(s string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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