Documentation
¶
Index ¶
- Constants
- func CalculateAndSignApiPermissionDigest(cCtx *cli.Context, permission [4]byte, expiry *big.Int) ([]byte, error)
- func CheckAppLogPermission(cCtx *cli.Context, appAddress ethcommon.Address) (bool, error)
- func ConfirmMainnetEnvironment(env string) error
- func GenerateAuthHeaders(cCtx *cli.Context, permission [4]byte, expiry *big.Int) (map[string]string, error)
- func GetAndPrintAppInfo(cCtx *cli.Context, appID ethcommon.Address, statusOverride ...string) error
- func GetAppControllerBinding(cCtx *cli.Context) (*ethclient.Client, *AppController.AppController, error)
- func GetAppID(cCtx *cli.Context, argIndex int) (ethcommon.Address, error)
- func GetAppIDInteractive(cCtx *cli.Context, argIndex int, action string) (ethcommon.Address, error)
- func GetAvailableAppNameInteractive(context, imageRef string) (string, error)
- func GetContractCaller(cCtx *cli.Context) (*common.ContractCaller, error)
- func GetDeveloperAddress(cCtx *cli.Context) (ethcommon.Address, error)
- func GetDockerfileInteractive(cCtx *cli.Context) (string, error)
- func GetEnvFileInteractive(cCtx *cli.Context) (string, error)
- func GetEnvironmentConfig(cCtx *cli.Context) (common.EnvironmentConfig, error)
- func GetEnvironmentDescription(name, fallback string, withPrefix bool) string
- func GetEnvironmentInteractive(cCtx *cli.Context, argIndex int) (string, error)
- func GetImageReferenceInteractive(cCtx *cli.Context, argIndex int, buildFromDockerfile bool) (string, error)
- func GetInstanceTypeInteractive(cCtx *cli.Context, defaultSKU string) (string, error)
- func GetLayeredTargetImageInteractive(cCtx *cli.Context, sourceImageRef string) (string, error)
- func GetLogSettingsInteractive(cCtx *cli.Context) (logRedirect string, publicLogs bool, err error)
- func GetOrPromptAppName(cCtx *cli.Context, context string, imageRef string) (string, error)
- func GetPrivateKeyOrFail(cCtx *cli.Context) (string, error)
- func IsAppNameAvailable(context, name string) bool
- func IsPushPermissionError(err error) bool
- func PrepareReleaseFromContext(cCtx *cli.Context, environmentConfig *common.EnvironmentConfig, ...) (appcontrollerV2.IAppControllerRelease, string, error)
- func PrintAppInfo(ctx context.Context, logger iface.Logger, client *ethclient.Client, ...) error
- func PrintAppInfoWithStatus(ctx context.Context, logger iface.Logger, client *ethclient.Client, ...) error
- func SelectRegistryInteractive(registries []registryInfo, imageName string, tag string, promptMessage string, ...) (string, error)
- func ShowCountdown(ctx context.Context, seconds int)
- func WatchAppInfoLoop(cCtx *cli.Context, appID ethcommon.Address, ...) error
- func WatchUntilRunning(cCtx *cli.Context, appID ethcommon.Address, statusOverride ...string) error
- type AppInfo
- type AppInfoResponse
- type AppStatus
- type AppStatusResponse
- type EnvSourceScriptTemplateData
- type InstanceType
- type LayeredDockerfileTemplateData
- type Platform
- type PreflightContext
- type PushPermissionError
- type SKUListResponse
- type UserApiClient
- func (cc *UserApiClient) GetInfos(cCtx *cli.Context, appIDs []ethcommon.Address, addressCount int) (*AppInfoResponse, error)
- func (cc *UserApiClient) GetLogs(cCtx *cli.Context, appID ethcommon.Address) (string, error)
- func (cc *UserApiClient) GetSKUs(cCtx *cli.Context) (*SKUListResponse, error)
- func (cc *UserApiClient) GetStatuses(cCtx *cli.Context, appIDs []ethcommon.Address) (*AppStatusResponse, error)
Constants ¶
const ( KMSEncryptionPublicKeyPath = "keys/%s/kms-encryption-public-key.pem" KMSSigningPublicKeyPath = "keys/%s/kms-signing-public-key.pem" KMSClientPath = "tools/kms-client" LayeredDockerfilePath = "internal/templates/docker/Dockerfile.layered.tmpl" EnvSourceScriptTemplatePath = "internal/templates/scripts/compute-source-env.sh.tmpl" JWTFilePath = "/run/container_launcher/attestation_verifier_claims_token" // Build-related constants TempImagePrefix = "eigenx-temp-" LayeredBuildDirPrefix = "eigenx-layered-build" LayeredDockerfileName = "Dockerfile.eigencompute" EnvSourceScriptName = "compute-source-env.sh" KMSClientBinaryName = "kms-client" KMSEncryptionKeyName = "kms-encryption-public-key.pem" KMSSigningKeyName = "kms-signing-public-key.pem" TlsKeygenBinaryName = "tls-keygen" CaddyfileName = "Caddyfile" DockerPlatform = "linux/amd64" LinuxOS = "linux" AMD64Arch = "amd64" SHA256Prefix = "sha256:" RegistryPropagationWaitSeconds = 3 )
const MAX_ADDRESS_COUNT = 5
Variables ¶
This section is empty.
Functions ¶
func CalculateAndSignApiPermissionDigest ¶
func CalculateAndSignApiPermissionDigest( cCtx *cli.Context, permission [4]byte, expiry *big.Int, ) ([]byte, error)
CalculateAndSignApiPermissionDigest calculates the API permission digest using the contract and signs it with the user's private key
func CheckAppLogPermission ¶
CheckAppLogPermission checks if an app currently has public log viewing permissions
func ConfirmMainnetEnvironment ¶
ConfirmMainnetEnvironment shows a confirmation prompt for mainnet environments
func GenerateAuthHeaders ¶
func GenerateAuthHeaders( cCtx *cli.Context, permission [4]byte, expiry *big.Int, ) (map[string]string, error)
GenerateAuthHeaders generates Authorization and X-eigenx-expiry headers for API authentication by using the contract to calculate and sign the permission digest
func GetAndPrintAppInfo ¶
func GetAppControllerBinding ¶
func GetAppControllerBinding(cCtx *cli.Context) (*ethclient.Client, *AppController.AppController, error)
func GetAppID ¶
GetAppID gets the app id from CLI args or auto-detects from project context. App id is the address of the app contract on L1.
func GetAppIDInteractive ¶
GetAppIDInteractive gets app ID from args or interactive selection
func GetAvailableAppNameInteractive ¶
GetAvailableAppNameInteractive interactively gets an available app name
func GetContractCaller ¶
func GetContractCaller(cCtx *cli.Context) (*common.ContractCaller, error)
GetContractCaller creates a contract caller from the CLI context
func GetDeveloperAddress ¶
GetDeveloperAddress gets developer address from private key
func GetDockerfileInteractive ¶
GetDockerfileInteractive prompts to build from Dockerfile if it exists
func GetEnvFileInteractive ¶
GetEnvFileInteractive prompts for env file path if not provided
func GetEnvironmentConfig ¶
func GetEnvironmentConfig(cCtx *cli.Context) (common.EnvironmentConfig, error)
func GetEnvironmentDescription ¶
GetEnvironmentDescription returns a human-readable description for an environment
func GetEnvironmentInteractive ¶
GetEnvironmentInteractive gets environment from args or interactive selection
func GetImageReferenceInteractive ¶
func GetImageReferenceInteractive(cCtx *cli.Context, argIndex int, buildFromDockerfile bool) (string, error)
GetImageReferenceInteractive prompts for image reference if not provided
func GetInstanceTypeInteractive ¶ added in v0.2.8
GetInstanceTypeInteractive prompts for instance type if not provided via flag. The defaultSKU parameter is used as the default selection in interactive mode: - For new deployments: pass empty string (uses first SKU from backend) - For upgrades: pass current app's instance type
func GetLayeredTargetImageInteractive ¶
GetLayeredTargetImageInteractive prompts for target image when layering a published image
func GetLogSettingsInteractive ¶
GetLogSettingsInteractive gets log redirection and visibility settings from flags or interactive prompt
func GetOrPromptAppName ¶
GetOrPromptAppName gets app name from flag or prompts interactively
func GetPrivateKeyOrFail ¶
GetPrivateKeyOrFail gets the private key from flag, environment, or keyring, failing with clear instructions if not found
func IsAppNameAvailable ¶
IsAppNameAvailable checks if an app name is available in the given context
func IsPushPermissionError ¶
IsPushPermissionError checks if an error is a push permission error
func PrepareReleaseFromContext ¶
func PrepareReleaseFromContext(cCtx *cli.Context, environmentConfig *common.EnvironmentConfig, appID gethcommon.Address, dockerfilePath string, imageRef string, envFilePath string, logRedirect string, instanceType string, maxPushRetries int) (appcontrollerV2.IAppControllerRelease, string, error)
PrepareReleaseFromContext prepares a release with separated Dockerfile handling The dockerfile path and env file path are provided as parameters (already collected earlier) maxPushRetries controls how many times to retry on push permission errors (0 = no retries)
func PrintAppInfo ¶
func PrintAppInfoWithStatus ¶
func SelectRegistryInteractive ¶
func SelectRegistryInteractive(registries []registryInfo, imageName string, tag string, promptMessage string, validator func(string) error) (string, error)
SelectRegistryInteractive provides interactive selection of registry for image reference
func ShowCountdown ¶ added in v0.2.5
ShowCountdown displays a countdown timer with gray text
func WatchAppInfoLoop ¶ added in v0.2.5
func WatchAppInfoLoop(cCtx *cli.Context, appID ethcommon.Address, stopCondition func(string, string) (bool, error), notifyOnStates []string, statusOverride ...string) error
WatchAppInfoLoop is the shared watch logic for monitoring app status changes stopCondition is called with (status, ip) and returns (shouldStop, error) If stopCondition is nil, watches indefinitely notifyOnStates: if provided, only print status changes when transitioning TO these states statusOverride: if provided, overrides the initial status display for user clarity
func WatchUntilRunning ¶ added in v0.2.5
WatchUntilRunning watches app info until it reaches Running status with an IP address statusOverride: if provided, overrides the initial status display (e.g., "Deploying", "Upgrading")
Types ¶
type AppInfo ¶
type AppInfo struct {
Addresses kmstypes.SignedResponse[kmstypes.AddressesResponse] `json:"addresses"`
Status string `json:"app_status"`
Ip string `json:"ip"`
MachineType string `json:"machine_type"`
}
type AppInfoResponse ¶
type AppInfoResponse struct {
Apps []AppInfo `json:"apps"`
}
type AppStatusResponse ¶
type AppStatusResponse struct {
Apps []AppStatus `json:"apps"`
}
type InstanceType ¶ added in v0.2.8
type InstanceType struct {
SKU string `json:"sku"` // SKU value (e.g., "g1-standard-4t")
Description string `json:"description"` // Human-readable description (e.g., "4 vCPUs, 16 GB memory, TDX")
}
InstanceType represents a machine instance type configuration. This struct matches the backend API response format for SKUs.
type Platform ¶
Platform represents a container platform
func (Platform) IsLinuxAMD64 ¶
IsLinuxAMD64 checks if platform matches required linux/amd64
type PreflightContext ¶
type PreflightContext struct {
Caller *common.ContractCaller
EnvironmentConfig *common.EnvironmentConfig
Client *ethclient.Client
PrivateKey string
}
PreflightContext contains validated context needed for contract operations
func DoPreflightChecks ¶
func DoPreflightChecks(cCtx *cli.Context) (*PreflightContext, error)
DoPreflightChecks performs early validation of authentication and network connectivity This should be called at the beginning of any command that requires contract interaction
type PushPermissionError ¶
PushPermissionError indicates a push failed due to authentication/permission issues
func (*PushPermissionError) Error ¶
func (e *PushPermissionError) Error() string
func (*PushPermissionError) Unwrap ¶
func (e *PushPermissionError) Unwrap() error
type SKUListResponse ¶ added in v0.2.8
type SKUListResponse struct {
SKUs []InstanceType `json:"skus"`
}
type UserApiClient ¶
func NewUserApiClient ¶
func NewUserApiClient(cCtx *cli.Context) (*UserApiClient, error)
func (*UserApiClient) GetInfos ¶
func (cc *UserApiClient) GetInfos(cCtx *cli.Context, appIDs []ethcommon.Address, addressCount int) (*AppInfoResponse, error)
func (*UserApiClient) GetSKUs ¶ added in v0.2.8
func (cc *UserApiClient) GetSKUs(cCtx *cli.Context) (*SKUListResponse, error)
func (*UserApiClient) GetStatuses ¶
func (cc *UserApiClient) GetStatuses(cCtx *cli.Context, appIDs []ethcommon.Address) (*AppStatusResponse, error)