| title | ROFL |
|---|---|
| description | Manage "Runtime OFfchain Logic" apps |
The rofl command combines a series of actions for managing the Runtime
OFfchain Logic (ROFL) apps:
- build ROFL locally,
- verify the ROFL bundle,
- register, deregister and update ROFL apps on the network,
- show information about the registered ROFL apps,
- other convenient tooling for ROFL app developers.
The rofl init command will prepare a new ROFL manifest in the given directory
(defaults to the current directory). The manifest is a YAML file named
rofl.yaml which defines the versions of all components, upgrade policies, etc.
needed to manage, build and deploy the ROFL app.
You can create a new ROFL manifest file based on the existing one by passing
--reset flag. This is useful if you want to make your own deployment of
the existing ROFL project. It will remove information on previous user-specific
deployments but keep information such as the minimum CPU, memory and storage
requirements.
Use rofl create to register a new ROFL app on the network using an existing
manifest.
You can also define specific Network, ParaTime and Account parameters as those get recorded into the manfiest so you don't need to specify them on each invocation:
Returned is the unique ROFL app ID starting with rofl1 and which you
will refer to for managing your ROFL app in the future. The manifest is
automatically updated with the newly assigned app identifier.
:::info
In order to prevent spam attacks registering a ROFL app requires a certain amount to be deposited from your account until you decide to remove it. The deposit remains locked for the lifetime of the app. Check out the Stake Requirements chapter for more information.
:::
With the --scheme parameter, you can select one of the following ROFL app ID
derivation schemes:
cnfor the ROFL app creator address (the account you're using to sign the transaction) combined with the account's nonce (default). This behavior is similar to the one of the Ethereum smart contract address derivation and is deterministic.criuses the ROFL app creator address combined with the block round the transaction will be validated in and its position inside that block.
The rofl build command will execute a series of build commands depending on
the target Trusted Execution Environment (TEE) and produce the Oasis Runtime
Container (ORC) bundle.
Additionally, the following flags are available:
-
--outputthe filename of the output ORC bundle. Defaults to the pattern<name>.<deployment>.orcwhere<name>is the app name from the manifest and<deployment>is the deployment name from the manifest. -
--verifyalso verifies the locally built enclave identity against the identity that is currently defined in the manifest and also against the identity that is currently set in the on-chain policy. It does not update the manifest file with new entity id(s). -
--no-update-manifestdo not update the enclave identity stored in the app manifest.
:::info
Building ROFL apps does not require a working TEE on your machine. However, you do need to install all corresponding tools. Check out the ROFL Prerequisites chapter for details.
:::
Run rofl secret set <secret_name> <filename>|- command to end-to-end encrypt a
secret with a key derived from the selected deployment network and store it to
the manifest file.
If you have your secret in a file, run:
You can also feed the secret from a standard input like this:
Once the secret is encrypted and stored, there is no way of obtaining the unencrypted value back again apart from within the TEE on the designated ROFL deployment.
Additionally, the following flags are available:
--forcereplaces an existing secret.--public-name <public-name>defines the name of the secret that will be publicly exposed e.g. in the Oasis Explorer. By default, the public name is the same as the name of the secret.
:::danger Shells store history
Passing secrets as a command line argument will store them in your shell history file as well! Use this approach only for testing. In production, always use file-based secrets.
:::
Run rofl secret import <dot-env-file>|- to bulk-import secrets from a
dotenv compatible file (key=value with
# comments). This is handy for files like .env, .env.production,
.env.testnet, or symlinks such as .env → .env.production. You can also
pass - to read from standard input.
Each KEY=VALUE pair becomes a separate secret entry in your manifest.
Quoted values may span multiple physical lines;
newline characters are preserved.
Double-quoted values also support common escapes (\n, \r, \t, \", \\).
Lines starting with # are ignored. Unquoted values stop at an unquoted #
comment.
oasis rofl secret import .envBy default, if a secret with the same name already exists,
the command will
fail. Use --force to replace existing secrets.
After importing, run:
oasis rofl updateto push the updated secrets on-chain.
Run rofl secret get <secret-name> to check whether the secret exists in your
manifest file.
Run rofl secret rm <secret-name> to remove the secret from your manifest file.
Use rofl update command to push the ROFL app's configuration to the chain:
The current on-chain policy, metadata and secrets will be replaced with the ones in the manifest file. Keep in mind that ROFL replicas need to be restarted in order for changes to take effect.
Run rofl show to obtain the information from the network on the ROFL admin
account, staked amount, current ROFL policy and running instances:
Run rofl deploy to automatically deploy your app to a machine obtained from
the ROFL marketplace. If a machine is already configured in your manifest file
a new version of your ROFL app will be deployed there. If no machines are rented
yet, you can use the following arguments to select a specific provider and
offer:
--provider <address>specifies the provider to rent the machine from. On Sapphire Testnet, the Oasis-managed provider will be selected by default.--offer <offer_name>specifies the offer of the machine to rent. By default it takes the most recent offer. Run--show-offersto list offers and specifications.--term <hour|month|year>specifies the base rent period. It takes the first available provider term by default.--term-count <number>specifies the multiplier. Default is1.--replace-machineif the existing machine in the manifest file expired, rent a new machine and replace the existing machine ID.
Once a ROFL app is deployed, you can manage the machine it's running on using
the oasis rofl machine subcommands.
To view details about a deployed machine, including its status, expiration,
and any proxy URLs, run oasis rofl machine show:
If you have published ports in your compose.yaml, the output will include
a Proxy section with public URLs to access your services. For more details on
how to configure the proxy and for troubleshooting, see the ROFL Proxy
feature page.
Run rofl machine top-up to extend the rental of the machine obtained from
the ROFL marketplace. You can check the current expiration date of your
machine in the Paid until field from
the oasis rofl machine show output.
The rental is extended under the terms of the original
offer. Specify the extension period with --term and
--term-count parameters.
You can fetch logs from your running ROFL app using oasis rofl machine logs.
:::danger Logs are not encrypted!
While only the app admin can access the logs, they are stored unencrypted on the ROFL node. In production, make sure you never print any confidential data to the standard or error outputs!
:::
To restart a running machine, use oasis rofl machine restart.
If you wish to clear the machine's persistent storage,
pass the --wipe-storage flag.
To stop a machine, use oasis rofl machine stop.
To start it back again, use oasis rofl machine restart.
To cancel the rental and permanently remove a machine,
including its persistent storage, use oasis rofl machine remove.
:::info
Canceling a machine rental will not refund any payment for the already paid term.
:::
Run rofl upgrade to bump ROFL bundle TDX artifacts in your manifest file to
their latest versions. This includes:
- the firmware
- the kernel
- stage two boot
- ROFL containers middleware (for TDX containers kind only)
Run rofl remove to deregister your ROFL app:
The deposit required to register the ROFL app will be returned to the current administrator account.
:::danger Secrets and key generation seed will be permanently lost
All secrets stored on-chain will be permanently lost when the ROFL app is deregistered! If you backed up your manifest file, those secrets will not be recoverable since they were encrypted with a ROFL deployment-specific keypair.
Similarly, the ROFL's internal seed for key generation will be lost, so you will not be able to generate the same keys in another ROFL.
:::
The rofl provider commands offers tools for managing your on-chain provider
information and your offers.
An example provider configuration file looks like this:
# Network name in your Oasis CLI
network: testnet
# ParaTime name in your Oasis CLI
paratime: sapphire
# Account name in your Oasis CLI
provider: rofl_provider
# List of Base64-encoded node IDs allowed to execute ROFL apps
nodes:
-
# Address of the scheduler app
scheduler_app: rofl1qrqw99h0f7az3hwt2cl7yeew3wtz0fxunu7luyfg
# Account name or address of who receives ROFL machine rental payments
payment_address: rofl_provider
offers:
- id: small # Short human-readable name
resources:
tee: tdx # Possible values: sgx, tdx
memory: 4096 # In MiB
cpus: 2
storage: 20000 # In MiB
payment:
native: # Possible keys: native, evm
terms:
hourly: 10 # Possible keys: hourly, monthly, yearly
capacity: 50 # Max number of actively rented machinesThe rofl provider init initializes a new provider configuration file.
:::info
Network and ParaTime selectors are available for the
rofl provider init command.
:::
Run rofl provider create to register your account as a provider on the
configured network and ParaTime.
:::info
In order to prevent spam attacks registering a ROFL provider requires a certain amount to be deposited from your account until you decide to remove it. The deposit remains locked for the lifetime of the provider entity. Check out the Stake Requirements chapter for more information.
:::
Use rofl provider update to update the list of endorsed nodes, the scheduler
app address, the payment recipient address and other provider settings.
To update your offers, run
rofl provider update-offers instead.
Use rofl provider update-offers to replace the on-chain offers with the ones
in your provider manifest file.
To update your provider policies, run rofl provider update
instead.
Use rofl provider list to display all ROFL providers registered on the
selected ParaTime:
The command displays provider addresses, scheduler app IDs, node counts, and offer/instance counts for each provider.
To see detailed information about all offers from each provider, use the
--show-offers flag:
Use rofl provider show <address> to display detailed information about a
specific ROFL provider, including all their offers:
This command provides comprehensive information including:
- Basic provider information (address, scheduler app, payment address)
- List of endorsed nodes
- Stake amount
- Detailed information about all offers (resources, pricing terms, capacity)
Use --format json to get the full provider metadata in machine-readable
format.
Run rofl provider remove to deregister your ROFL provider account:
The deposit required to register the ROFL provider will be returned to its address.
Run rofl identity to compute the cryptographic identity of the ROFL app:
The output above is Base64-encoded enclave identity which depends on the ROFL source code and the build environment. Enclave identities should be reproducible on any computer and are used to prove and verify the integrity of ROFL binaries on the network. See the Reproducibility chapter to learn more.
In order the ROFL app can trust the environment it is executed in, it needs to have a hardcoded trust root. Typically, it consists of:
- the ParaTime ID,
- the chain domain separation context,
- the specific consensus block hash and its height.
To obtain the latest trust root in rust programming language, run
oasis rofl trust-root:
You can also define specific Network and ParaTime parameters: