playground

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 59 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolUDP = "udp"
	ProtocolTCP = "tcp"
)

Variables

View Source
var Components = []ComponentGen{}
View Source
var CustomRecipesFS fs.FS

CustomRecipesFS holds the embedded custom recipes filesystem, set by main package

View Source
var MinimumGenesisDelay uint64 = 10

minimumGenesisDelay is the minimum delay for the genesis time. This is required because lighthouse takes some time to start and we need to make sure it is ready otherwise, some blocks are missed.

Functions

func Connect

func Connect(service, port string) string

func ConnectEnode

func ConnectEnode(service, id string) string

func ConnectRaw

func ConnectRaw(service, port, protocol, user string) string

func ConnectWs

func ConnectWs(service, port string) string

func CreatePrometheusServices

func CreatePrometheusServices(manifest *Manifest, out *output) error

func DownloadRelease

func DownloadRelease(outputFolder string, artifact *release) (string, error)

func GenerateCustomRecipeToDir

func GenerateCustomRecipeToDir(customRecipeName, targetDir string) (string, error)

GenerateCustomRecipeToDir extracts a custom recipe and its dependencies to the specified directory Returns the path to the generated playground.yaml file

func GenerateDocs

func GenerateDocs(recipes []Recipe) error

func GenerateFromCustomRecipe

func GenerateFromCustomRecipe(customRecipeName string, force bool) error

GenerateFromCustomRecipe extracts a custom recipe and its dependencies to current directory customRecipeName should be in the format "dir/filename" (e.g., "rbuilder/custom") If force is false, it will error if any files already exist

func GetEmbeddedCustomRecipes

func GetEmbeddedCustomRecipes() ([]string, error)

GetEmbeddedCustomRecipes returns a list of custom recipe names from the embedded custom recipes Custom recipe names can be: - "name" for recipes directly under custom-recipes/ (e.g., custom-recipes/foo.yaml -> "foo") - "dir/name" for recipes in subdirectories (e.g., custom-recipes/rbuilder/bin.yaml -> "rbuilder/bin")

func GetHomeDir

func GetHomeDir() (string, error)

func GetLocalSessions

func GetLocalSessions() ([]string, error)

func GetRecipeComponents

func GetRecipeComponents(recipe Recipe) []string

GetRecipeComponents returns the component names for a recipe

func GetRecipeComponentsFormatted

func GetRecipeComponentsFormatted(recipe Recipe) string

GetRecipeComponentsFormatted returns a formatted string of component names for a recipe If a component is itself a recipe (ends with "-recipe"), it formats as "base + extra1, extra2"

func GetSessionServices

func GetSessionServices(session string) ([]string, error)

func Inspect

func Inspect(ctx context.Context, serviceName, portName string) error

Inspect incldues the logic for the inspect command

func IsYAMLRecipeFile

func IsYAMLRecipeFile(path string) bool

IsYAMLRecipeFile checks if the given path looks like a YAML recipe file

func Logs

func Logs(ctx context.Context, sessionName, serviceName string, follow bool) error

func NewOutput

func NewOutput(dst string) (*output, error)

func RecipeToYAML

func RecipeToYAML(recipe Recipe) (string, error)

RecipeToYAML converts a recipe to a playground.yaml format

func SendTestTransaction

func SendTestTransaction(ctx context.Context, cfg *TestTxConfig) error

SendTestTransaction sends a test transaction and waits for the receipt

func StopSession

func StopSession(id string, keepResources bool) error

func UseHealthmon

func UseHealthmon(component *Component, s *Service, chain string)

Types

type ArtifactsBuilder

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

func NewArtifactsBuilder

func NewArtifactsBuilder() *ArtifactsBuilder

func (*ArtifactsBuilder) ApplyLatestL1Fork

func (b *ArtifactsBuilder) ApplyLatestL1Fork(applyLatestL1Fork bool) *ArtifactsBuilder

func (*ArtifactsBuilder) ApplyLatestL2Fork

func (b *ArtifactsBuilder) ApplyLatestL2Fork(applyLatestL2Fork *uint64) *ArtifactsBuilder

func (*ArtifactsBuilder) Build

func (b *ArtifactsBuilder) Build(out *output) error

func (*ArtifactsBuilder) GenesisDelay

func (b *ArtifactsBuilder) GenesisDelay(genesisDelaySeconds uint64) *ArtifactsBuilder

func (*ArtifactsBuilder) L1BlockTime

func (b *ArtifactsBuilder) L1BlockTime(blockTimeSeconds uint64) *ArtifactsBuilder

func (*ArtifactsBuilder) OpBlockTime

func (b *ArtifactsBuilder) OpBlockTime(blockTimeSeconds uint64) *ArtifactsBuilder

func (*ArtifactsBuilder) PredeployFile

func (b *ArtifactsBuilder) PredeployFile(filePath string) *ArtifactsBuilder

func (*ArtifactsBuilder) PrefundedAccounts

func (b *ArtifactsBuilder) PrefundedAccounts(accounts []string) *ArtifactsBuilder

func (*ArtifactsBuilder) WithExtraFile

func (b *ArtifactsBuilder) WithExtraFile(artifactName, sourcePath string) *ArtifactsBuilder

func (*ArtifactsBuilder) WithL2

func (b *ArtifactsBuilder) WithL2() *ArtifactsBuilder

type BProxy

type BProxy struct {
	TargetAuthrpc         string
	Peers                 []string
	Flashblocks           bool
	FlashblocksBuilderURL string
}

func (*BProxy) Apply

func (f *BProxy) Apply(ctx *ExContext) *Component

type BootnodeRef

type BootnodeRef struct {
	Service string
	ID      string
}

func (*BootnodeRef) Connect

func (b *BootnodeRef) Connect() string

type BuilderHub

type BuilderHub struct {
	BuilderIP     string
	BuilderConfig string
}

func (*BuilderHub) Apply

func (b *BuilderHub) Apply(ctx *ExContext) *Component

type BuilderNetRecipe

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

BuilderNetRecipe is a recipe that extends the L1 recipe to include builder-hub

func (*BuilderNetRecipe) Apply

func (b *BuilderNetRecipe) Apply(ctx *ExContext) *Component

func (*BuilderNetRecipe) Artifacts

func (b *BuilderNetRecipe) Artifacts() *ArtifactsBuilder

func (*BuilderNetRecipe) Description

func (b *BuilderNetRecipe) Description() string

func (*BuilderNetRecipe) Flags

func (b *BuilderNetRecipe) Flags() *flag.FlagSet

func (*BuilderNetRecipe) Name

func (b *BuilderNetRecipe) Name() string

func (*BuilderNetRecipe) Output

func (b *BuilderNetRecipe) Output(manifest *Manifest) map[string]interface{}

type Callback

type Callback func(serviceName string, update TaskStatus)

type ChainMonitor

type ChainMonitor struct {
	L1RPC            string
	L2BlockTime      uint64
	L2BuilderAddress string
	L2RPC            string
}

func (*ChainMonitor) Apply

func (c *ChainMonitor) Apply(ctx *ExContext) *Component

type ClProxy

type ClProxy struct {
	PrimaryBuilder   string
	SecondaryBuilder string
}

func (*ClProxy) Apply

func (c *ClProxy) Apply(ctx *ExContext) *Component

type Component

type Component struct {
	Name     string
	Services []*Service
	Inner    []*Component
}

func NewComponent

func NewComponent(name string) *Component

func (*Component) AddComponent

func (p *Component) AddComponent(ctx *ExContext, gen ComponentGen)

func (*Component) AddService

func (p *Component) AddService(srv ComponentGen)

func (*Component) NewService

func (p *Component) NewService(name string) *Service

func (*Component) RunContenderIfEnabled

func (component *Component) RunContenderIfEnabled(ctx *ExContext)

type ComponentGen

type ComponentGen interface {
	Apply(manifest *ExContext) *Component
}

type Contender

type Contender struct {
	ExtraArgs   []string
	TargetChain string // defaults to "el", may be any chain name in a recipe's spec
}

func (*Contender) Apply

func (c *Contender) Apply(ctx *ExContext) *Component

type ContenderContext

type ContenderContext struct {
	// Run `contender spam` automatically once all playground services are running.
	Enabled bool

	// Provide additional args to contender's CLI.
	ExtraArgs []string

	// Override the default target chain for contender to spam.
	TargetChain string
}

func (*ContenderContext) Contender

func (cc *ContenderContext) Contender() *Contender

Converts a `ContenderContext` into a `Contender` service. `Enabled` is ignored.

type CustomRecipeInfo

type CustomRecipeInfo struct {
	Name               string
	Description        string
	Base               string
	ModifiedComponents []string
	NewComponents      []string
}

CustomRecipeInfo contains metadata about a custom recipe

func GetCustomRecipeInfo

func GetCustomRecipeInfo(customRecipeName string, baseRecipes []Recipe) (*CustomRecipeInfo, error)

GetCustomRecipeInfo returns metadata about a specific custom recipe

type DependsOn

type DependsOn struct {
	Name      string
	Condition DependsOnCondition
}

type DependsOnCondition

type DependsOnCondition string
const (
	DependsOnConditionRunning DependsOnCondition = "service_started"
	DependsOnConditionHealthy DependsOnCondition = "service_healthy"
)

type EnodeAddr

type EnodeAddr struct {
	PrivKey  *ecdsa.PrivateKey
	Artifact string
}

func (*EnodeAddr) NodeID

func (e *EnodeAddr) NodeID() string

func (*EnodeAddr) PrivKeyHex

func (e *EnodeAddr) PrivKeyHex() string

type ExContext

type ExContext struct {
	LogLevel LogLevel

	// This dependency is not ideal. Doing it so that I do not
	// have to modify the serviceDesc interface to give services
	// access to the output.
	Output *output

	// Bootnode reference for EL nodes.
	// TODO: Extend for CL nodes too
	Bootnode *BootnodeRef

	Contender *ContenderContext
}

Execution context

type FlashblocksRPC

type FlashblocksRPC struct {
	FlashblocksWSService string
	BaseOverlay          bool
	UseWebsocketProxy    bool // Whether to add /ws path for websocket proxy
}

func (*FlashblocksRPC) Apply

func (f *FlashblocksRPC) Apply(ctx *ExContext) *Component

type HealthCheckResponse

type HealthCheckResponse struct {
	Output   string
	ExitCode int
}

func ExecuteHealthCheckManually

func ExecuteHealthCheckManually(serviceName string) (*HealthCheckResponse, error)

type InteractiveDisplay

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

func NewInteractiveDisplay

func NewInteractiveDisplay(manifest *Manifest) *InteractiveDisplay

func (*InteractiveDisplay) HandleUpdate

func (i *InteractiveDisplay) HandleUpdate(serviceName string, status TaskStatus)

type L1Recipe

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

func (*L1Recipe) Apply

func (l *L1Recipe) Apply(ctx *ExContext) *Component

func (*L1Recipe) Artifacts

func (l *L1Recipe) Artifacts() *ArtifactsBuilder

func (*L1Recipe) Description

func (l *L1Recipe) Description() string

func (*L1Recipe) Flags

func (l *L1Recipe) Flags() *flag.FlagSet

func (*L1Recipe) Name

func (l *L1Recipe) Name() string

func (*L1Recipe) Output

func (l *L1Recipe) Output(manifest *Manifest) map[string]interface{}

type LighthouseBeaconNode

type LighthouseBeaconNode struct {
	ExecutionNode string
	MevBoostNode  string
}

func (*LighthouseBeaconNode) Apply

func (l *LighthouseBeaconNode) Apply(ctx *ExContext) *Component

type LighthouseValidator

type LighthouseValidator struct {
	BeaconNode string
}

func (*LighthouseValidator) Apply

func (l *LighthouseValidator) Apply(ctx *ExContext) *Component

type LocalRunner

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

LocalRunner is a component that runs the services from the manifest on the local host machine. By default, it uses docker and docker compose to run all the services. But, some services (if they are configured to do so) can be run on the host machine instead. When running inside docker, each service will use the port numbers they define in the component description. Besides, they will also bind to an available public port on the host machine. If the service runs on the host, it will use the host port numbers instead directly.

func NewLocalRunner

func NewLocalRunner(cfg *RunnerConfig) (*LocalRunner, error)

func (*LocalRunner) ExitErr

func (d *LocalRunner) ExitErr() <-chan error

func (*LocalRunner) Run

func (d *LocalRunner) Run(ctx context.Context) error

func (*LocalRunner) Stop

func (d *LocalRunner) Stop(keepResources bool) error

func (*LocalRunner) WaitForReady

func (d *LocalRunner) WaitForReady(ctx context.Context) error

type LogLevel

type LogLevel string
var (
	LevelDebug LogLevel = "debug"
	LevelInfo  LogLevel = "info"
	LevelWarn  LogLevel = "warn"
	LevelError LogLevel = "error"
	LevelTrace LogLevel = "trace"
)

func (*LogLevel) Unmarshal

func (l *LogLevel) Unmarshal(s string) error

type Manifest

type Manifest struct {
	ID string `json:"session_id"`

	// list of Services
	Services []*Service `json:"services"`
	// contains filtered or unexported fields
}

Manifest describes a list of services and their dependencies

func NewManifest

func NewManifest(name string, component *Component) *Manifest

func ReadManifest

func ReadManifest(outputFolder string) (*Manifest, error)

func (*Manifest) ApplyOverrides

func (m *Manifest) ApplyOverrides(overrides map[string]string) error

func (*Manifest) ExecutePostHookActions

func (m *Manifest) ExecutePostHookActions() error

func (*Manifest) GenerateDotGraph

func (s *Manifest) GenerateDotGraph() string

func (*Manifest) GenerateMermaidGraph

func (s *Manifest) GenerateMermaidGraph() string

func (*Manifest) GetService

func (s *Manifest) GetService(name string) (*Service, bool)

func (*Manifest) MustGetService

func (s *Manifest) MustGetService(name string) *Service

func (*Manifest) NewService

func (s *Manifest) NewService(name string) *Service

func (*Manifest) SaveJson

func (m *Manifest) SaveJson(out *output) error

func (*Manifest) Validate

func (s *Manifest) Validate(out *output) error

Validate validates the manifest - checks if all the port dependencies are met from the service description - downloads any local release artifacts for the services that require host execution

type MapStringFlag

type MapStringFlag map[string]string

func (*MapStringFlag) Set

func (n *MapStringFlag) Set(s string) error

func (*MapStringFlag) String

func (n *MapStringFlag) String() string

func (*MapStringFlag) Type

func (n *MapStringFlag) Type() string

type MevBoost

type MevBoost struct {
	RelayEndpoints []string
}

func (*MevBoost) Apply

func (m *MevBoost) Apply(ctx *ExContext) *Component

type MevBoostRelay

type MevBoostRelay struct {
	BeaconClient     string
	ValidationServer string
}

func (*MevBoostRelay) Apply

func (m *MevBoostRelay) Apply(ctx *ExContext) *Component

type NodeRef

type NodeRef struct {
	Service   string `json:"service"`
	PortLabel string `json:"port_label"`
	Protocol  string `json:"protocol"`
	User      string `json:"user"`
}

NodeRef describes a reference from one service to another

type OpBatcher

type OpBatcher struct {
	L1Node             string
	L2Node             string
	RollupNode         string
	MaxChannelDuration uint64
}

func (*OpBatcher) Apply

func (o *OpBatcher) Apply(ctx *ExContext) *Component

type OpGenesisTmplInput

type OpGenesisTmplInput struct {
	Timestamp  uint64
	LatestFork *uint64
}

type OpGeth

type OpGeth struct {
	// outputs
	Enode *EnodeAddr
}

func (*OpGeth) Apply

func (o *OpGeth) Apply(ctx *ExContext) *Component

type OpNode

type OpNode struct {
	L1Node   string
	L1Beacon string
	L2Node   string
}

func (*OpNode) Apply

func (o *OpNode) Apply(ctx *ExContext) *Component

type OpRbuilder

type OpRbuilder struct {
	Flashblocks bool
}

func (*OpRbuilder) Apply

func (o *OpRbuilder) Apply(ctx *ExContext) *Component

type OpRecipe

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

OpRecipe is a recipe that deploys an OP stack

func (*OpRecipe) Apply

func (o *OpRecipe) Apply(ctx *ExContext) *Component

func (*OpRecipe) Artifacts

func (o *OpRecipe) Artifacts() *ArtifactsBuilder

func (*OpRecipe) Description

func (o *OpRecipe) Description() string

func (*OpRecipe) Flags

func (o *OpRecipe) Flags() *flag.FlagSet

func (*OpRecipe) Name

func (o *OpRecipe) Name() string

func (*OpRecipe) Output

func (o *OpRecipe) Output(manifest *Manifest) map[string]interface{}

type OpReth

type OpReth struct{}

func (*OpReth) Apply

func (o *OpReth) Apply(ctx *ExContext) *Component

type Port

type Port struct {
	// Name is the name of the port
	Name string `json:"name"`

	// Port is the port number
	Port int `json:"port"`

	// Protocol (tcp or udp)
	Protocol string

	// HostPort is the port number assigned on the host machine for this
	// container port. It is populated by the local runner
	// TODO: We might want to move this to the runner itself.
	HostPort int
}

Port describes a port that a service exposes

type ReadyCheck

type ReadyCheck struct {
	QueryURL    string        `json:"query_url"`
	Test        []string      `json:"test"`
	Interval    time.Duration `json:"interval"`
	StartPeriod time.Duration `json:"start_period"`
	Timeout     time.Duration `json:"timeout"`
	Retries     int           `json:"retries"`
}

type Recipe

type Recipe interface {
	Name() string
	Description() string
	Flags() *flag.FlagSet
	Artifacts() *ArtifactsBuilder
	Apply(ctx *ExContext) *Component
	Output(manifest *Manifest) map[string]interface{}
}

func LoadCustomRecipe

func LoadCustomRecipe(customRecipeName string, baseRecipes []Recipe) (Recipe, func(), error)

LoadCustomRecipe generates a custom recipe to a temp directory and parses it. Returns the parsed recipe and a cleanup function to remove the temp directory.

type RethEL

type RethEL struct {
	UseRethForValidation bool
	UseNativeReth        bool
}

func (*RethEL) Apply

func (r *RethEL) Apply(ctx *ExContext) *Component

type RollupBoost

type RollupBoost struct {
	ELNode  string
	Builder string

	Flashblocks           bool
	FlashblocksBuilderURL string
}

func (*RollupBoost) Apply

func (r *RollupBoost) Apply(ctx *ExContext) *Component

type RunnerConfig

type RunnerConfig struct {
	Out                  *output
	Manifest             *Manifest
	BindHostPortsLocally bool
	NetworkName          string
	Labels               map[string]string
	LogInternally        bool
	Platform             string
	Callbacks            []Callback
}

func (*RunnerConfig) AddCallback

func (r *RunnerConfig) AddCallback(c Callback)

type Service

type Service struct {
	Name string   `json:"name"`
	Args []string `json:"args"`

	Labels map[string]string `json:"labels,omitempty"`

	// list of environment variables to set for the service
	Env map[string]string `json:"env,omitempty"`

	ReadyCheck *ReadyCheck `json:"ready_check,omitempty"`

	DependsOn []*DependsOn `json:"depends_on,omitempty"`

	Ports    []*Port    `json:"ports,omitempty"`
	NodeRefs []*NodeRef `json:"node_refs,omitempty"`

	FilesMapped   map[string]string `json:"files_mapped,omitempty"`
	VolumesMapped map[string]string `json:"volumes_mapped,omitempty"`

	Tag        string `json:"tag,omitempty"`
	Image      string `json:"image,omitempty"`
	Entrypoint string `json:"entrypoint,omitempty"`
	HostPath   string `json:"host_path,omitempty"`

	UngracefulShutdown bool `json:"ungraceful_shutdown,omitempty"`
	// contains filtered or unexported fields
}

func (*Service) DependsOnHealthy

func (s *Service) DependsOnHealthy(name string) *Service

func (*Service) DependsOnRunning

func (s *Service) DependsOnRunning(name string) *Service

func (*Service) GetPort

func (s *Service) GetPort(name string) (*Port, bool)

func (*Service) GetPorts

func (s *Service) GetPorts() []*Port

func (*Service) MustGetPort

func (s *Service) MustGetPort(name string) *Port

func (*Service) UseHostExecution

func (s *Service) UseHostExecution() *Service

func (*Service) WithArgs

func (s *Service) WithArgs(args ...string) *Service

func (*Service) WithArtifact

func (s *Service) WithArtifact(localPath, artifactName string) *Service

func (*Service) WithEntrypoint

func (s *Service) WithEntrypoint(entrypoint string) *Service

func (*Service) WithEnv

func (s *Service) WithEnv(key, value string) *Service

func (*Service) WithImage

func (s *Service) WithImage(image string) *Service

func (*Service) WithLabel

func (s *Service) WithLabel(key, value string) *Service

func (*Service) WithPort

func (s *Service) WithPort(name string, portNumber int, protocolVar ...string) *Service

func (*Service) WithPostHook

func (s *Service) WithPostHook(hook *postHook) *Service

func (*Service) WithReady

func (s *Service) WithReady(check ReadyCheck) *Service

func (*Service) WithRelease

func (s *Service) WithRelease(rel *release) *Service

func (*Service) WithTag

func (s *Service) WithTag(tag string) *Service

func (*Service) WithUngracefulShutdown

func (s *Service) WithUngracefulShutdown() *Service

func (*Service) WithVolume

func (s *Service) WithVolume(name, localPath string) *Service

type ServiceReady

type ServiceReady interface {
	Ready(service *Service) error
}

type TaskStatus

type TaskStatus string
var (
	TaskStatusPulling  TaskStatus = "pulling"
	TaskStatusPulled   TaskStatus = "pulled"
	TaskStatusPending  TaskStatus = "pending"
	TaskStatusStarted  TaskStatus = "started"
	TaskStatusDie      TaskStatus = "die"
	TaskStatusHealthy  TaskStatus = "healthy"
	TaskStatusUnhealty TaskStatus = "unhealthy"
)

type TestTxConfig

type TestTxConfig struct {
	RPCURL     string // Target RPC URL for sending transactions (e.g., rbuilder)
	ELRPCURL   string // EL RPC URL for chain queries (e.g., reth). If empty, uses RPCURL
	PrivateKey string
	ToAddress  string
	Value      *big.Int
	GasLimit   uint64
	GasPrice   *big.Int
	Timeout    time.Duration // Timeout for waiting for receipt. If 0, defaults to 2 minutes
}

TestTxConfig holds configuration for the test transaction

func DefaultTestTxConfig

func DefaultTestTxConfig() *TestTxConfig

DefaultTestTxConfig returns the default test transaction configuration Sends from second prefunded account to first prefunded account (builder/coinbase)

type WebsocketProxy

type WebsocketProxy struct {
	Upstream string
}

func (*WebsocketProxy) Apply

func (w *WebsocketProxy) Apply(ctx *ExContext) *Component

type YAMLComponentConfig

type YAMLComponentConfig struct {
	// Remove indicates whether to remove this component
	Remove bool `yaml:"remove,omitempty"`

	// Services is a map of service name to service config
	Services map[string]*YAMLServiceConfig `yaml:"services,omitempty"`
}

YAMLComponentConfig represents a component in the YAML recipe

type YAMLRecipe

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

YAMLRecipe wraps a base recipe and applies YAML-based modifications

func ParseYAMLRecipe

func ParseYAMLRecipe(filePath string, baseRecipes []Recipe) (*YAMLRecipe, error)

ParseYAMLRecipe parses a YAML recipe file and returns a YAMLRecipe

func (*YAMLRecipe) Apply

func (y *YAMLRecipe) Apply(ctx *ExContext) *Component

func (*YAMLRecipe) Artifacts

func (y *YAMLRecipe) Artifacts() *ArtifactsBuilder

func (*YAMLRecipe) Description

func (y *YAMLRecipe) Description() string

func (*YAMLRecipe) Flags

func (y *YAMLRecipe) Flags() *flag.FlagSet

func (*YAMLRecipe) Name

func (y *YAMLRecipe) Name() string

func (*YAMLRecipe) Output

func (y *YAMLRecipe) Output(manifest *Manifest) map[string]interface{}

type YAMLRecipeConfig

type YAMLRecipeConfig struct {
	// Base is the name of the base recipe (l1, opstack, buildernet)
	Base string `yaml:"base"`

	// Description is an optional description of the recipe
	Description string `yaml:"description,omitempty"`

	// Recipe contains the component/service hierarchy to apply as overrides or additions
	Recipe map[string]*YAMLComponentConfig `yaml:"recipe"`
}

YAMLRecipeConfig represents the structure of a YAML recipe file

type YAMLReleaseConfig

type YAMLReleaseConfig struct {
	Name    string `yaml:"name"`
	Org     string `yaml:"org"`
	Repo    string `yaml:"repo,omitempty"`
	Version string `yaml:"version"`
	// Format specifies the download format: "tar.gz" (default) or "binary"
	// For "binary", downloads the raw binary directly without extraction
	Format string `yaml:"format,omitempty"`
}

YAMLReleaseConfig specifies a GitHub release to download

type YAMLServiceConfig

type YAMLServiceConfig struct {
	// Remove indicates whether to remove this service
	Remove bool `yaml:"remove,omitempty"`

	// Image is the docker image to use
	Image string `yaml:"image,omitempty"`

	// Tag is the docker image tag
	Tag string `yaml:"tag,omitempty"`

	// Entrypoint overrides the container entrypoint
	Entrypoint string `yaml:"entrypoint,omitempty"`

	// Args are the arguments to pass to the service
	Args []string `yaml:"args,omitempty"`

	// Env is a map of environment variables
	Env map[string]string `yaml:"env,omitempty"`

	// Ports is a map of port name to port number
	Ports map[string]int `yaml:"ports,omitempty"`

	// Files is a map of container path to file source
	// File source can be:
	// - "artifact:<name>" to reference a runtime-generated artifact (e.g., "artifact:genesis.json")
	// - A relative path to a file in the same directory as the YAML recipe file
	Files map[string]string `yaml:"files,omitempty"`

	// Volumes is a map of container path to volume name
	Volumes map[string]string `yaml:"volumes,omitempty"`

	// DependsOn is a list of services this service depends on
	// Format: "service_name" or "service_name:condition" where condition is "healthy" or "running"
	DependsOn []string `yaml:"depends_on,omitempty"`

	// HostPath is the path to the binary on the host to run instead of Docker
	// When set, the service runs on the host machine instead of in a container
	HostPath string `yaml:"host_path,omitempty"`

	// Release specifies a GitHub release to download for host execution
	Release *YAMLReleaseConfig `yaml:"release,omitempty"`
}

YAMLServiceConfig represents a service configuration in the YAML recipe

Jump to

Keyboard shortcuts

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