Documentation
¶
Index ¶
- func AllContainerNames() []string
- func CandidateContainerNames(network string) []string
- func CheckIfTestnetOrTestnetNetworkFlag() bool
- func ComponentNetworks(network string) []string
- func ExpandHomeDir(path string) (string, error)
- func ExplicitContainerName(network string) (string, error)
- func FindComposeFile(containerName string) (string, error)
- func FindComposeFileForContainer(container string) (string, error)
- func GetAllSupportedNetworks() string
- func GetCommandSupportedNetworks() string
- func GetDefaultLocalMappedContainerName(network string) (string, bool)
- func GetFiftysixDockerhubContainerName(network string) (string, bool)
- func GetNetworkRequiredDataSize(network string) (int, bool)
- func GetNetworkRequiredSnapshotSize(network string) (int, bool)
- func GetNodevinDataDir() (string, error)
- func GetNodevinExecutable() string
- func GetSizeDescription(size int64) string
- func GetSnapshotCIDByNetwork(network string) (string, bool)
- func GetStartMessage(network string) (string, bool)
- func IsEthereumExecutionClient(name string) bool
- func IsSupportedExtendedInfoSoftware(software string) bool
- func NetworkContainerMap() map[string]string
- func NetworkDefaultRPCPorts() map[string]int
- func ResolveContainerName(network string) (string, error)
- func RunningContainerNames() ([]string, error)
- func StackOwner(network string) (string, bool)
- type AmbiguousClientError
- type NetworkInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllContainerNames ¶ added in v0.3.0
func AllContainerNames() []string
AllContainerNames returns every container name any registered network can run as, including alternates. Use it (not NetworkContainerMap) wherever the question is "is any nodevin node running or storing data?".
func CandidateContainerNames ¶ added in v0.3.0
CandidateContainerNames returns every container name network's primary service may run as, default first. It is nil for an unknown network.
func CheckIfTestnetOrTestnetNetworkFlag ¶
func CheckIfTestnetOrTestnetNetworkFlag() bool
func ComponentNetworks ¶ added in v0.3.0
ComponentNetworks returns the networks that run inside network's stack.
func ExpandHomeDir ¶ added in v0.2.0
Expands a leading "~" or "~/" in path to the current user's home directory. filepath.Join and os.MkdirAll treat "~" as a literal directory name, not a shell shortcut, so a value like "~/Desktop" must be expanded manually before use or it silently creates a "~" directory relative to the current working directory instead of resolving to the user's home.
func ExplicitContainerName ¶ added in v0.3.0
ExplicitContainerName is ResolveContainerName for destructive commands: for a network with selectable clients it requires the client to be named with its flag, and never infers it. Other networks resolve as usual.
func FindComposeFile ¶ added in v0.3.0
FindComposeFile locates the docker-compose file nodevin generated for a container ("docker-compose_<container>.yml"). It looks in the nodevin data directory first, which honors --data-dir, then in the directory of the nodevin executable and the current directory, where older versions wrote them.
func FindComposeFileForContainer ¶ added in v0.3.0
FindComposeFileForContainer locates the compose file that manages container. A container that runs inside another network's stack (a consensus client) is managed by that stack's compose file.
func GetAllSupportedNetworks ¶
func GetAllSupportedNetworks() string
func GetCommandSupportedNetworks ¶ added in v0.0.5
func GetCommandSupportedNetworks() string
func GetNodevinDataDir ¶
Returns path to the user's nodevin data directory (~/.nodevin/data)
func GetNodevinExecutable ¶ added in v0.0.5
func GetNodevinExecutable() string
func GetSizeDescription ¶
func GetSnapshotCIDByNetwork ¶ added in v0.0.7
func GetStartMessage ¶
func IsEthereumExecutionClient ¶ added in v0.3.0
IsEthereumExecutionClient reports whether name is one of the container names the "ethereum" network can run its execution client as.
func IsSupportedExtendedInfoSoftware ¶ added in v0.0.7
func NetworkContainerMap ¶
func NetworkDefaultRPCPorts ¶
func ResolveContainerName ¶ added in v0.3.0
ResolveContainerName returns the container that currently represents network. For most networks that is just the registry's ContainerName. For a network whose primary service can run as one of several clients it discovers which one, in order: the explicit --<ClientFlag> value, the one running right now, the one that has a data directory or compose file, and finally the default. If several match at a step it returns *AmbiguousClientError rather than guessing.
func RunningContainerNames ¶ added in v0.3.0
RunningContainerNames returns the names of all running Docker containers.
func StackOwner ¶ added in v0.3.0
StackOwner returns the network whose compose stack network runs inside (e.g. "ethereum" for "lighthouse"), if any.
Types ¶
type AmbiguousClientError ¶ added in v0.3.0
type AmbiguousClientError struct {
Network string
Flag string
Candidates []string
// Running is true when the candidates are running right now, false when
// they are only present on disk (data directory or compose file).
Running bool
}
AmbiguousClientError means a network can run as several containers (see NetworkInfo.AlternateContainerNames) and more than one of them is present, so nodevin will not guess which one the user means.
func (*AmbiguousClientError) Error ¶ added in v0.3.0
func (e *AmbiguousClientError) Error() string
type NetworkInfo ¶
type NetworkInfo struct {
ContainerName string
// AlternateContainerNames are other containers the network's primary
// service may run as (e.g. Ethereum's execution client is chosen with
// --execution-client). ContainerName is the default. See ResolveContainerName.
AlternateContainerNames []string
// ClientFlag names the CLI flag that selects between ContainerName and
// AlternateContainerNames.
ClientFlag string
// PartOf marks a network that only ever runs inside another network's
// compose stack (e.g. lighthouse inside ethereum): it has no compose file
// of its own and cannot be stopped independently.
PartOf string
DockerHubImage string
SnapshotCID string
RPCPort int
DataSize int
SnapshotSize int
StartMessage string
CommandSupported bool
}