application

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const EthereumHDPath = "m/44'/60'/0'/0/0"

EthereumHDPath is the BIP44 HD path for Ethereum (coin type 60). Used for eth_secp256k1 keys in EVM-compatible chains.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevnetService

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

DevnetService provides unified access to devnet operations using Clean Architecture principles with DI Container and UseCases. This replaces the legacy DevnetService that directly used internal packages.

func GetService

func GetService(homeDir string) (*DevnetService, error)

GetService returns a DevnetService instance using global homeDir. It automatically loads the network module if devnet exists with stored blockchain network.

func GetServiceWithConfig

func GetServiceWithConfig(cfg ServiceConfig) (*DevnetService, error)

GetServiceWithConfig returns a DevnetService with full configuration. Use this when you need to specify network module, docker mode, etc.

func NewDevnetService

func NewDevnetService(homeDir string, logger *output.Logger, opts ...di.Option) (*DevnetService, error)

NewDevnetService creates a new DevnetService with DI Container.

func NewDevnetServiceWithConfig

func NewDevnetServiceWithConfig(cfg ServiceConfig) (*DevnetService, error)

NewDevnetServiceWithConfig creates a DevnetService with full configuration.

func (*DevnetService) Container

func (s *DevnetService) Container() *di.Container

Container returns the DI container for advanced usage.

func (*DevnetService) Destroy

func (s *DevnetService) Destroy(ctx context.Context, cleanCache bool) (*dto.DestroyOutput, error)

Destroy destroys the devnet using DestroyUseCase.

func (*DevnetService) DevnetExists

func (s *DevnetService) DevnetExists() bool

DevnetExists checks if a devnet exists.

func (*DevnetService) Export

func (s *DevnetService) Export(ctx context.Context, outputDir string, force bool) (*dto.ExportOutput, error)

Export exports blockchain state using ExportUseCase.

func (*DevnetService) ExportKeys

func (s *DevnetService) ExportKeys(ctx context.Context, keyType string) (*dto.ExportKeysOutput, error)

ExportKeys exports validator and account keys.

func (*DevnetService) GetBlockchainNetwork

func (s *DevnetService) GetBlockchainNetwork(ctx context.Context) (string, error)

GetBlockchainNetwork returns the blockchain network name.

func (*DevnetService) GetChainID

func (s *DevnetService) GetChainID(ctx context.Context) (string, error)

GetChainID returns the chain ID.

func (*DevnetService) GetCurrentVersion

func (s *DevnetService) GetCurrentVersion(ctx context.Context) (string, error)

GetCurrentVersion returns the current binary version.

func (*DevnetService) GetExecutionMode

func (s *DevnetService) GetExecutionMode(ctx context.Context) (types.ExecutionMode, error)

GetExecutionMode returns the execution mode (docker/local).

func (*DevnetService) GetExecutionModeInfo

func (s *DevnetService) GetExecutionModeInfo(ctx context.Context, nodeIndex int) (*dto.ExecutionModeInfo, error)

GetExecutionModeInfo returns execution mode information for a node.

func (*DevnetService) GetHealth

func (s *DevnetService) GetHealth(ctx context.Context) (*dto.HealthOutput, error)

GetHealth returns health status using HealthUseCase.

func (*DevnetService) GetNetworkSource

func (s *DevnetService) GetNetworkSource(ctx context.Context) (string, error)

GetNetworkSource returns the network source (mainnet/testnet).

func (*DevnetService) GetNode

func (s *DevnetService) GetNode(ctx context.Context, nodeIndex int) (*dto.NodeInfo, error)

GetNode returns node information by index.

func (*DevnetService) GetNodeHealth

func (s *DevnetService) GetNodeHealth(ctx context.Context, nodeIndex int) (*dto.NodeHealthStatus, error)

GetNodeHealth returns the health status of a specific node.

func (*DevnetService) GetNodeLogPath

func (s *DevnetService) GetNodeLogPath(ctx context.Context, nodeIndex int) (string, error)

GetNodeLogPath returns the log file path for a node.

func (*DevnetService) GetNodeLogs

func (s *DevnetService) GetNodeLogs(ctx context.Context, nodeIndex, lines int, since string) (*dto.LogsOutput, error)

GetNodeLogs returns log lines for a specific node.

func (*DevnetService) GetNumValidators

func (s *DevnetService) GetNumValidators(ctx context.Context) (int, error)

GetNumValidators returns the number of validators in the devnet.

func (*DevnetService) GetStatus

func (s *DevnetService) GetStatus(ctx context.Context) (*dto.StatusOutput, error)

GetStatus returns the full status of the devnet.

func (*DevnetService) IsDockerMode

func (s *DevnetService) IsDockerMode(ctx context.Context) (bool, error)

IsDockerMode returns true if the devnet uses Docker execution mode.

func (*DevnetService) IsRunning

func (s *DevnetService) IsRunning(ctx context.Context) (bool, error)

IsRunning returns true if the devnet is in running state.

func (*DevnetService) LoadDevnetInfo

func (s *DevnetService) LoadDevnetInfo(ctx context.Context) (*dto.DevnetInfo, error)

LoadDevnetInfo loads devnet information for display.

func (*DevnetService) LoadMetadata

func (s *DevnetService) LoadMetadata(ctx context.Context) (*ports.DevnetMetadata, error)

LoadMetadata returns the raw metadata for advanced operations.

func (*DevnetService) Provision

func (s *DevnetService) Provision(ctx context.Context, input dto.ProvisionInput) (*dto.ProvisionOutput, error)

Provision provisions a new devnet using ProvisionUseCase.

func (*DevnetService) Reset

func (s *DevnetService) Reset(ctx context.Context, hard bool) (*dto.ResetOutput, error)

Reset resets the devnet using ResetUseCase.

func (*DevnetService) Restart

func (s *DevnetService) Restart(ctx context.Context, timeout time.Duration) (*dto.RestartOutput, error)

Restart restarts all devnet nodes.

func (*DevnetService) Run

func (s *DevnetService) Run(ctx context.Context, input dto.RunInput) (*dto.RunOutput, error)

Run starts devnet nodes using RunUseCase.

func (*DevnetService) SaveMetadata

func (s *DevnetService) SaveMetadata(ctx context.Context, metadata *ports.DevnetMetadata) error

SaveMetadata saves updated metadata.

func (*DevnetService) SetCurrentVersion

func (s *DevnetService) SetCurrentVersion(ctx context.Context, version string) error

SetCurrentVersion updates the current binary version.

func (*DevnetService) Start

func (s *DevnetService) Start(ctx context.Context, timeout time.Duration) (*dto.RunOutput, error)

Start starts all devnet nodes (convenience wrapper for Run).

func (*DevnetService) StartNode

func (s *DevnetService) StartNode(ctx context.Context, nodeIndex int) (*dto.NodeActionOutput, error)

StartNode starts a specific node.

func (*DevnetService) Stop

func (s *DevnetService) Stop(ctx context.Context, timeout time.Duration) (*dto.StopOutput, error)

Stop stops devnet nodes using StopUseCase.

func (*DevnetService) StopAll

func (s *DevnetService) StopAll(ctx context.Context, timeout time.Duration) error

StopAll stops all nodes with given timeout.

func (*DevnetService) StopNode

func (s *DevnetService) StopNode(ctx context.Context, nodeIndex int, timeout time.Duration) (*dto.NodeActionOutput, error)

StopNode stops a specific node.

type NodeNotFoundError

type NodeNotFoundError struct {
	Index int
}

NodeNotFoundError is returned when a node is not found.

func (*NodeNotFoundError) Error

func (e *NodeNotFoundError) Error() string

type ServiceConfig

type ServiceConfig struct {
	HomeDir       string
	Logger        *output.Logger
	NetworkModule network.NetworkModule
	DockerMode    bool
	Options       []di.Option
}

ServiceConfig holds configuration for creating a DevnetService.

Directories

Path Synopsis
Package build contains UseCases for building binaries from source.
Package build contains UseCases for building binaries from source.
Package devnet contains UseCases for devnet lifecycle management.
Package devnet contains UseCases for devnet lifecycle management.
Package ports defines the interfaces (ports) that the application layer requires from the infrastructure layer.
Package ports defines the interfaces (ports) that the application layer requires from the infrastructure layer.
Package upgrade contains UseCases for chain upgrade operations.
Package upgrade contains UseCases for chain upgrade operations.
Package version provides use cases for version management.
Package version provides use cases for version management.

Jump to

Keyboard shortcuts

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