common

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TermHour  = "hour"
	TermMonth = "month"
	TermYear  = "year"
)

Machine payment terms.

View Source
const RentRefundWarning = "WARNING: Machine rental is non-refundable. You will not get a refund for the already paid term if you cancel."

RentRefundWarning is a standardized message shown before renting, topping up, or canceling a machine.

Variables

View Source
var (
	// WipeFlags is the flag for wiping the machine storage on deployment/restart.
	WipeFlags *flag.FlagSet

	// DeploymentFlags provide the deployment name.
	DeploymentFlags *flag.FlagSet

	// NoUpdateFlag is the flag for disabling the rofl.yaml manifest file update.
	NoUpdateFlag *flag.FlagSet

	// TermFlags provide the term and count setting.
	TermFlags *flag.FlagSet

	// ShowOffersFlag is the flag for showing all provider offers.
	ShowOffersFlag *flag.FlagSet

	// DeploymentName is the name of the ROFL app deployment.
	DeploymentName string

	// WipeStorage enables wiping the machine storage on deployment/restart.
	WipeStorage bool

	// NoUpdate disables updating the rofl.yaml manifest file.
	NoUpdate bool

	// Term specifies the rental base unit.
	Term string

	// TermCount specific the rental base unit multiplier.
	TermCount uint64

	// ShowOffers controls whether to display all offers for each provider.
	ShowOffers bool
)

Functions

func ComputeComponentIdentity added in v0.12.1

func ComputeComponentIdentity(bnd *bundle.Bundle, comp *bundle.Component) ([]bundle.Identity, error)

ComputeComponentIdentity computes the enclave identity of the given component.

func ComputeEnclaveIdentity

func ComputeEnclaveIdentity(bnd *bundle.Bundle, compID string) ([]bundle.Identity, error)

ComputeEnclaveIdentity computes the enclave identity of the given ROFL components. If no specific component ID is passed, it uses the first ROFL component.

func FormatTeeType added in v0.17.1

func FormatTeeType(tee roflmarket.TeeType) string

FormatTeeType formats a roflmarket.TeeType into a human-readable string.

func FormatTerm added in v0.17.1

func FormatTerm(term roflmarket.Term) string

FormatTerm formats a roflmarket.Term into a human-readable string.

func FormatTermAdjectival added in v0.17.1

func FormatTermAdjectival(term roflmarket.Term) string

FormatTermAdjectival formats a roflmarket.Term into an adjectival form (e.g., "hourly").

func GetOrcFilename added in v0.12.1

func GetOrcFilename(manifest *rofl.Manifest, deploymentName string) string

GetOrcFilename generates a filename based on the project name and deployment.

func GetRegisteredEnclaves added in v0.12.1

func GetRegisteredEnclaves(ctx context.Context, rawAppID string, npa *common.NPASelection) (map[sgx.EnclaveIdentity]struct{}, error)

GetRegisteredEnclaves retrieves currently registered on-chain enclaves for the given deployment.

func LoadManifestAndSetNPA

func LoadManifestAndSetNPA(opts *ManifestOptions) (*rofl.Manifest, *rofl.Deployment, *common.NPASelection)

LoadManifestAndSetNPA loads the ROFL app manifest and reconfigures the network/paratime/account selection.

In case there is an error in loading the manifest, it aborts the application.

func MaybeLoadManifestAndSetNPA

func MaybeLoadManifestAndSetNPA(cfg *cliConfig.Config, npa *common.NPASelection, deployment string, opts *ManifestOptions) (*rofl.Manifest, *rofl.Deployment, error)

MaybeLoadManifestAndSetNPA loads the ROFL app manifest and reconfigures the network/paratime/account selection.

In case there is an error in loading the manifest, it is returned.

func ParseMachineTerm added in v0.13.0

func ParseMachineTerm(term string) roflmarket.Term

ParseMachineTerm parses the given machine payment term.

Terminates the process in case of errors.

func PrintRentRefundWarning added in v0.16.0

func PrintRentRefundWarning()

PrintRentRefundWarning prints the standardized, user-facing refund policy warning.

Types

type ManifestOptions added in v0.11.1

type ManifestOptions struct {
	// NeedAppID specifies whether a configured app ID is required in the manifest.
	NeedAppID bool
	// NeedAdmin specifies whether a valid admin is required in the manifest. In case this is set to
	// false and the admin account does not exist, the account will not be modified.
	NeedAdmin bool
}

ManifestOptions configures the manifest options.

Jump to

Keyboard shortcuts

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