node

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

README

Node package

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteNetworkConfigToDisk added in v0.11.0

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 added in v0.14.0

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

func (*Config) ToHostConfig added in v0.14.0

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

func (*Config) UpdateNodeConfig added in v0.14.0

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 added in v0.14.0

func (d *DockerNode) Stop() error

func (*DockerNode) Upgrade added in v0.11.0

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

type NetworkConfig added in v0.11.0

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 added in v0.11.0

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 added in v0.18.0

func WithBatchInterval(d string) Option

func WithCoinbase added in v0.18.0

func WithCoinbase(s string) Option

func WithDebugNamespaceEnabled added in v0.12.0

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 added in v0.15.0

func WithInMemoryHostDB(b bool) Option

func WithInboundP2PDisabled added in v0.17.0

func WithInboundP2PDisabled(b bool) Option

func WithL1BlockTime added in v0.18.0

func WithL1BlockTime(d time.Duration) Option

func WithL1ChainID added in v0.18.0

func WithL1ChainID(i int) Option

func WithL1Start added in v0.12.0

func WithL1Start(blockHash string) Option

func WithL1WebsocketURL added in v0.17.0

func WithL1WebsocketURL(addr string) Option

func WithLogLevel added in v0.17.0

func WithLogLevel(i int) Option

func WithManagementContractAddress

func WithManagementContractAddress(s string) Option

func WithMaxBatchInterval added in v0.18.0

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 added in v0.18.0

func WithObscuroGenesis(g string) Option

func WithPCCSAddr

func WithPCCSAddr(s string) Option

func WithPrivateKey

func WithPrivateKey(s string) Option

func WithProfiler added in v0.14.0

func WithProfiler(b bool) Option

func WithRollupInterval added in v0.18.0

func WithRollupInterval(d string) Option

func WithSGXEnabled

func WithSGXEnabled(b bool) Option

func WithSequencerID

func WithSequencerID(s string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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