Documentation
¶
Index ¶
- Constants
- func CreateComposeFile(nodeName string, config NetworkConfig, extraServiceNames []string, ...) (string, error)
- func RemoveInitContainersAndVolumes() error
- func ResolveCheckpointSyncURL(consensusClient string) (string, error)
- func SelectedConsensusClient() (string, error)
- func SelectedExecutionClient() (string, error)
- func WithCheckpointSync(consensusClient, checkpointURL, command string) (string, error)
- type ComposeFile
- type Deploy
- type Healthcheck
- type NetworkConfig
- func GetBitcoinNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetDogecoinNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetEthereumClassicNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetEthereumNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetIpfsClusterNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetKuboNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetLighthouseNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetLitecoinNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetLodestarNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetNimbusNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetOrdLitecoinNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetOrdNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetPrysmNetworkComposeConfig(network string) (NetworkConfig, error)
- func GetTekuNetworkComposeConfig(network string) (NetworkConfig, error)
- type NetworkDetails
- type ResourceDetails
- type Resources
- type Service
- type ServiceDependsOnCondition
- type VolumeDetails
Constants ¶
const GB = 1 << 30 // 1 GB in bytes
Variables ¶
This section is empty.
Functions ¶
func CreateComposeFile ¶
func CreateComposeFile(nodeName string, config NetworkConfig, extraServiceNames []string, extraServiceConfigs []NetworkConfig, cwd string) (string, error)
func RemoveInitContainersAndVolumes ¶
func RemoveInitContainersAndVolumes() error
RemoveInitContainersAndVolumes removes all containers that match "init-config-*" and their associated volumes, deletes volumes with the label "nodevin.init.volume", and anonymous volumes created within the last minute.
func ResolveCheckpointSyncURL ¶ added in v0.3.0
ResolveCheckpointSyncURL returns the validated --checkpoint-sync-url for a consensus client. It is required for every consensus client: Lighthouse and Teku refuse to sync from genesis at all, and genesis sync is impractically slow and unsafe on mainnet for the rest. nodevin deliberately has no default endpoint - which third party to trust for checkpoint data is the user's call. Returns "" for consensusClient "none".
func SelectedConsensusClient ¶ added in v0.3.0
SelectedConsensusClient resolves --consensus-client, defaulting to lighthouse (currently the largest share of Ethereum mainnet consensus traffic). Unlike --ord/--ipfs-cluster, this is deliberately on by default: an execution client cannot sync at all post-Merge without a paired consensus client driving it over the Engine API, so leaving this off by default would produce a node that looks like it started but never does anything. Pass --consensus-client=none to run execution-only.
Exported since pkg/nodes/ethereum needs it too, to decide whether to wire up the extra consensus-client service and which of the five builder functions below to call.
func SelectedExecutionClient ¶ added in v0.3.0
SelectedExecutionClient resolves --execution-client, defaulting to reth (the broadest-compatibility pick per the pairing doc: no glibc issues, GPG-verified release, and the client Base's own image is built on).
func WithCheckpointSync ¶ added in v0.3.0
WithCheckpointSync returns command (a consensus client's base command) set up to start from the checkpoint provider at checkpointURL.
Every client but Nimbus just takes a flag. Nimbus's own checkpoint flags (--external-beacon-api-url with --trusted-block-root) rely on the provider serving light-client data, which public providers often don't - Nimbus then silently falls back to syncing from genesis. Its supported route is the separate `trustedNodeSync` subcommand, run once against an empty database, so for Nimbus the command becomes a small wrapper that runs it first. It never deletes anything that was there before: it only runs when there is no database yet, and only cleans up the partial one its own failed run created.
Types ¶
type ComposeFile ¶
type ComposeFile struct {
//Version string `yaml:"version"`
Services map[string]Service `yaml:"services"`
Networks map[string]NetworkDetails `yaml:"networks"`
Volumes map[string]VolumeDetails `yaml:"volumes"`
}
ComposeFile defines the top-level structure of the Docker Compose file.
type Deploy ¶
type Deploy struct {
Resources Resources `yaml:"resources,omitempty"`
}
Deploy holds the resource deployment configuration for a service.
type Healthcheck ¶
type Healthcheck struct {
Test []string `yaml:"test"`
Interval string `yaml:"interval"`
Timeout string `yaml:"timeout"`
Retries int `yaml:"retries"`
StartPeriod string `yaml:"start_period,omitempty"`
}
Healthcheck defines the parameters for a health check.
type NetworkConfig ¶
type NetworkConfig struct {
Image string
Version string
ContainerName string
Command string
// CommandIsIntentionallyEmpty marks that this network's Command is meant
// to be empty (e.g. ipfs/ipfs-cluster rely on the image's own baked-in
// entrypoint), so a generic "Command must be non-empty" check doesn't
// need a hardcoded per-network allowlist to know that's expected.
CommandIsIntentionallyEmpty bool
Restart string
Ports []string
Volumes []string
Networks []string
Deploy Deploy
Environment map[string]string
NetworkDefs map[string]NetworkDetails
VolumeDefs map[string]VolumeDetails
LocalPath string
SnapshotSyncCID string
LocalChainDataPath string
SnapshotDataFilename string
SnapshotSyncCommand string
}
NetworkConfig holds the configuration used to override or define services.
func GetBitcoinNetworkComposeConfig ¶
func GetBitcoinNetworkComposeConfig(network string) (NetworkConfig, error)
func GetDogecoinNetworkComposeConfig ¶ added in v0.1.1
func GetDogecoinNetworkComposeConfig(network string) (NetworkConfig, error)
func GetEthereumClassicNetworkComposeConfig ¶ added in v0.2.0
func GetEthereumClassicNetworkComposeConfig(network string) (NetworkConfig, error)
func GetEthereumNetworkComposeConfig ¶ added in v0.3.0
func GetEthereumNetworkComposeConfig(network string) (NetworkConfig, error)
func GetIpfsClusterNetworkComposeConfig ¶ added in v0.0.8
func GetIpfsClusterNetworkComposeConfig(network string) (NetworkConfig, error)
func GetKuboNetworkComposeConfig ¶ added in v0.0.7
func GetKuboNetworkComposeConfig(network string) (NetworkConfig, error)
func GetLighthouseNetworkComposeConfig ¶ added in v0.3.0
func GetLighthouseNetworkComposeConfig(network string) (NetworkConfig, error)
GetLighthouseNetworkComposeConfig builds the compose config for Lighthouse paired with whichever execution client --execution-client selects (reth by default). Lighthouse's own entrypoint has_flag-defaults everything else (network, ports) - the only things it cannot default correctly are the paired execution client's Engine API endpoint and shared JWT secret, since those depend entirely on which execution client this node is paired with. See node-images' docs/ethereum-execution-consensus-pairing.md.
func GetLitecoinNetworkComposeConfig ¶
func GetLitecoinNetworkComposeConfig(network string) (NetworkConfig, error)
func GetLodestarNetworkComposeConfig ¶ added in v0.3.0
func GetLodestarNetworkComposeConfig(network string) (NetworkConfig, error)
GetLodestarNetworkComposeConfig builds the compose config for Lodestar paired with whichever execution client --execution-client selects. See GetLighthouseNetworkComposeConfig and node-images' docs/ethereum-execution-consensus-pairing.md for the shared reasoning.
func GetNimbusNetworkComposeConfig ¶ added in v0.3.0
func GetNimbusNetworkComposeConfig(network string) (NetworkConfig, error)
GetNimbusNetworkComposeConfig builds the compose config for Nimbus paired with whichever execution client --execution-client selects. See GetLighthouseNetworkComposeConfig and node-images' docs/ethereum-execution-consensus-pairing.md for the shared reasoning.
Nimbus's (Nim/confutils) CLI only accepts --flag=value - a space-separated "--flag value" is silently misparsed as two separate tokens. The "=" below is required, not stylistic.
func GetOrdLitecoinNetworkComposeConfig ¶
func GetOrdLitecoinNetworkComposeConfig(network string) (NetworkConfig, error)
func GetOrdNetworkComposeConfig ¶
func GetOrdNetworkComposeConfig(network string) (NetworkConfig, error)
func GetPrysmNetworkComposeConfig ¶ added in v0.3.0
func GetPrysmNetworkComposeConfig(network string) (NetworkConfig, error)
GetPrysmNetworkComposeConfig builds the compose config for Prysm paired with whichever execution client --execution-client selects. See GetLighthouseNetworkComposeConfig and node-images' docs/ethereum-execution-consensus-pairing.md for the shared reasoning.
func GetTekuNetworkComposeConfig ¶ added in v0.3.0
func GetTekuNetworkComposeConfig(network string) (NetworkConfig, error)
GetTekuNetworkComposeConfig builds the compose config for Teku paired with whichever execution client --execution-client selects. See GetLighthouseNetworkComposeConfig and node-images' docs/ethereum-execution-consensus-pairing.md for the shared reasoning.
Teku's own CLI has no subcommand (unlike lighthouse's "bn" or prysm's "beacon-chain") - the client name alone is the beacon node command.
type NetworkDetails ¶
type NetworkDetails struct {
Driver string `yaml:"driver"`
}
NetworkDetails defines the network configuration for a service.
type ResourceDetails ¶
type ResourceDetails struct {
CPUs string `yaml:"cpus,omitempty"`
Memory string `yaml:"memory,omitempty"`
}
ResourceDetails defines CPU and memory limits and reservations.
type Resources ¶
type Resources struct {
Limits ResourceDetails `yaml:"limits,omitempty"`
Reservations ResourceDetails `yaml:"reservations,omitempty"`
}
Resources defines resource limits and reservations for a service.
type Service ¶
type Service struct {
Image string `yaml:"image"`
ContainerName string `yaml:"container_name"`
User string `yaml:"user,omitempty"`
Restart string `yaml:"restart"`
Command string `yaml:"command"`
Entrypoint string `yaml:"entrypoint,omitempty"`
Ports []string `yaml:"ports"`
Volumes []string `yaml:"volumes"`
Networks []string `yaml:"networks"`
Healthcheck *Healthcheck `yaml:"healthcheck,omitempty"`
Environment map[string]string `yaml:"environment,omitempty"`
DependsOn map[string]ServiceDependsOnCondition `yaml:"depends_on,omitempty"`
Deploy *Deploy `yaml:"deploy,omitempty"`
}
Service defines the configuration of a service in the Docker Compose file.
type ServiceDependsOnCondition ¶
type ServiceDependsOnCondition struct {
Condition string `yaml:"condition"`
}
ServiceDependsOnCondition defines the health condition for depends_on.
type VolumeDetails ¶
VolumeDetails defines the volume configuration for a service.