paths

package
v1.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package paths provides centralized path management for devnet-builder.

Index

Constants

View Source
const (
	DevnetDir      = "devnet"
	BinDir         = "bin"
	CacheDir       = "cache"
	BinaryCacheDir = "cache/binaries"
	SnapshotsDir   = "snapshots"
	ExportsDir     = "exports"
	PluginsDir     = "plugins"
)

Directory constants relative to home directory.

View Source
const (
	ConfigDir  = "config"
	DataDir    = "data"
	KeyringDir = "keyring-test"
)

Node subdirectory constants.

View Source
const (
	ConfigFile        = "config.toml"
	AppConfigFile     = "app.toml"
	GenesisFile       = "genesis.json"
	MetadataFile      = "metadata.json"
	SnapshotMetaFile  = "snapshot.meta.json"
	DefaultBinaryName = "binary"
)

File name constants.

View Source
const (
	CommitHashLength  = 40
	ConfigHashLength  = 8
	CacheKeySeparator = "-"
)

Cache key format constants.

View Source
const DefaultHomeDirName = ".devnet-builder"

Variables

This section is empty.

Functions

func AccountKeyPath

func AccountKeyPath(homeDir string, index int) string

func BinPath

func BinPath(homeDir string) string

func BinaryCacheKeyPath

func BinaryCacheKeyPath(homeDir, networkType, cacheKey string) string

func BinaryCacheNetworkPath

func BinaryCacheNetworkPath(homeDir, networkType string) string

func BinaryCachePath

func BinaryCachePath(homeDir string) string

func BinarySymlinkPath

func BinarySymlinkPath(homeDir, binaryName string) string

func BuildCacheKey

func BuildCacheKey(commitHash, configHash string) string

func BuildExportName

func BuildExportName(networkType, commitHash string, blockHeight int64, timestamp string) string

func BuildGenesisFileName

func BuildGenesisFileName(blockHeight int64, commitHash string) string

func CachedBinaryMetadataPath

func CachedBinaryMetadataPath(homeDir, networkType, cacheKey string) string

func CachedBinaryPath

func CachedBinaryPath(homeDir, networkType, cacheKey, binaryName string) string

func ConfigPath

func ConfigPath(homeDir string) string

func DefaultHomeDir

func DefaultHomeDir() string

DefaultHomeDir returns $HOME/.devnet-builder or falls back to current directory.

func DevnetAccountsPath

func DevnetAccountsPath(homeDir string) string

func DevnetGenesisPath

func DevnetGenesisPath(homeDir string) string

func DevnetMetadataPath

func DevnetMetadataPath(homeDir string) string

func DevnetPath

func DevnetPath(homeDir string) string

func EnsureDir

func EnsureDir(path string) error

func Exists

func Exists(path string) bool

func ExportGenesisPath

func ExportGenesisPath(homeDir, exportName, genesisFileName string) string

func ExportMetadataPath

func ExportMetadataPath(homeDir, exportName string) string

func ExportPath

func ExportPath(homeDir, exportName string) string

func ExportsPath

func ExportsPath(homeDir string) string

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool
func IsSymlink(path string) bool

func IsValidCacheKey

func IsValidCacheKey(cacheKey string) bool

IsValidCacheKey validates cache key format: {commitHash(40hex)}-{configHash(8hex)}

func NodeAppTomlPath

func NodeAppTomlPath(homeDir string, index int) string

func NodeConfigPath

func NodeConfigPath(homeDir string, index int) string

func NodeConfigTomlPath

func NodeConfigTomlPath(homeDir string, index int) string

func NodeDataPath

func NodeDataPath(homeDir string, index int) string

func NodeGenesisPath

func NodeGenesisPath(homeDir string, index int) string

func NodeKeyringPath

func NodeKeyringPath(homeDir string, index int) string

func NodeLogPath

func NodeLogPath(nodeHomeDir, binaryName string) string

func NodePIDPath

func NodePIDPath(nodeHomeDir, binaryName string) string

func NodePath

func NodePath(homeDir string, index int) string

func PluginsPath

func PluginsPath(homeDir string) string

func RelativeCacheTargetPath

func RelativeCacheTargetPath(cacheKey, binaryName string) string

RelativeCacheTargetPath returns relative path from bin dir to cache entry. cacheKey format: {networkType}/{commitHash}-{configHash}

func SnapshotCacheKeyPath

func SnapshotCacheKeyPath(homeDir, cacheKey string) string

func SnapshotCachePath

func SnapshotCachePath(homeDir string) string

func SnapshotFilePath

func SnapshotFilePath(homeDir, cacheKey, extension string) string

func SnapshotMetadataPath

func SnapshotMetadataPath(homeDir, cacheKey string) string

func ValidatorKeyPath

func ValidatorKeyPath(homeDir string, index int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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