Skip to content

Commit 8567317

Browse files
committed
docs: Update for TDX container-based ROFL apps
1 parent 7628c8f commit 8567317

16 files changed

+122
-116
lines changed

docs/rofl.md

Lines changed: 60 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,72 +16,44 @@ OFfchain Logic (ROFL)][rofl] apps:
1616

1717
[rofl]: https://github.com/oasisprotocol/docs/blob/main/docs/build/rofl/README.mdx
1818

19-
## Build ROFL {#build}
20-
21-
The `build` command will execute a series of build commands depending on the
22-
target Trusted Execution Environment (TEE) and produce the Oasis Runtime
23-
Container (ORC) bundle.
24-
25-
Building a ROFL bundle requires a ROFL app manifest (`rofl.yaml`) to be present
26-
in the current working directory. All information about what kind of ROFL app
27-
to build is specified in the manifest.
28-
29-
Additionally, the following flags are available:
30-
31-
- `--output` the filename of the output ORC bundle. Defaults to the package name
32-
inside `Cargo.toml` and the `.orc` extension.
33-
34-
:::info
35-
36-
Building ROFL apps involves **cross compilation**, so you do not need a working
37-
TEE on your machine. However, you do need to install all corresponding compilers
38-
and toolchains. Check out the [ROFL Prerequisites] chapter for details.
39-
40-
:::
41-
42-
[ROFL Prerequisites]: https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/rofl/prerequisites.md
43-
[npa]: ./account.md#npa
19+
## Initialize a new ROFL app manifest {#init}
4420

45-
## Show ROFL identity {#identity}
21+
The `rofl init` command will prepare a new ROFL app manifest in the given
22+
directory (defaults to the current directory). The manifest is a YAML file named
23+
`rofl.yaml` which defines the versions of all components, upgrade policies, etc.
24+
needed to manage, build and deploy the ROFL app.
4625

47-
Run `rofl identity` to compute the **cryptographic identity** of the ROFL app:
48-
49-
![code shell](../examples/rofl/identity.in.static)
26+
You can also define specific [Network, ParaTime and Account][npa] parameters
27+
as those get recorded into the manfiest so you don't need to specify them on
28+
each invocation:
5029

51-
![code](../examples/rofl/identity.out.static)
30+
![code shell](../examples/rofl/init.in.static)
5231

53-
The output above is Base64-encoded enclave identity which depends on the ROFL
54-
source code and the build environment. Enclave identities should be reproducible
55-
on any computer and are used to prove and verify the integrity of ROFL binaries
56-
on the network. See the [Reproducibility] chapter to learn more.
57-
58-
[Reproducibility]: https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/runtime/reproducibility.md
32+
![code](../examples/rofl/init.out.static)
5933

6034
## Create a new ROFL app on the network {#create}
6135

62-
Use `rofl create` to register a new ROFL app on the network using a
63-
specific [policy] file:
36+
Use `rofl create` to register a new ROFL app on the network using an existing
37+
manifest.
6438

6539
![code shell](../examples/rofl/create.in.static)
6640

6741
![code](../examples/rofl/create.out.static)
6842

6943
Returned is the unique ROFL app ID starting with `rofl1` and which you
70-
will refer to for managing your ROFL app in the future.
44+
will refer to for managing your ROFL app in the future. If you specify the
45+
`--update-manifest` parameter the manifest will be automatically updated with
46+
the newly assigned app identifier.
7147

7248
:::info
7349

7450
In order to prevent spam attacks registering a ROFL app requires a
7551
certain amount to be deposited from your account until you decide to
7652
[remove it](#remove). The deposit remains locked for the lifetime of the app.
77-
Check out the [ROFL chapter][policy] to view the current staking requirements.
53+
Check out the [ROFL chapter][app] to view the current staking requirements.
7854

7955
:::
8056

81-
You can also define specific [Network, ParaTime and Account][npa] parameters:
82-
83-
![code shell](../examples/rofl/create-npa.in.static)
84-
8557
With the `--scheme` parameter, you can select one of the following ROFL app ID
8658
derivation schemes:
8759

@@ -92,28 +64,46 @@ derivation schemes:
9264
- `cri` uses the ROFL app creator address combined with the block round the
9365
transaction will be validated in and its position inside that block.
9466

95-
[policy]: https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/rofl/deployment.md#register-the-app
67+
[app]: https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/rofl/app.mdx
9668
[smart contract address derivation]: https://ethereum.org/en/developers/docs/accounts/#contract-accounts
9769

98-
## Update ROFL policy {#update}
70+
## Build ROFL {#build}
9971

100-
Use `rofl update` command to set the new policy and the new administrator of the
101-
ROFL app:
72+
The `rofl build` command will execute a series of build commands depending on
73+
the target Trusted Execution Environment (TEE) and produce the Oasis Runtime
74+
Container (ORC) bundle.
10275

103-
![code shell](../examples/rofl/update.in.static)
76+
Additionally, the following flags are available:
10477

105-
![code shell](../examples/rofl/update.out.static)
78+
- `--update-manifest` updates the enclave identity in the app manifest with the
79+
identity of the locally built app.
80+
81+
- `--output` the filename of the output ORC bundle. Defaults to the pattern
82+
`<name>.<deployment>.orc` where `<name>` is the app name from the manifest and
83+
`<deployment>` is the deployment name from the manifest.
84+
85+
- `--verify` also verifies the locally built enclave identity against the
86+
identity that is currently defined in the manifest and also against the
87+
identity that is currently set in the on-chain policy.
10688

107-
For the administrator, you can also specify an account name in your wallet or
108-
address book.
89+
:::info
10990

110-
To keep the existing administrator, pass `self`:
91+
Building ROFL apps does not require a working TEE on your machine. However, you
92+
do need to install all corresponding tools. Check out the [ROFL Prerequisites]
93+
chapter for details.
11194

112-
![code shell](../examples/rofl/update-self.in.static)
95+
:::
11396

114-
You can also define specific [Network, ParaTime and Account][npa] parameters:
97+
[ROFL Prerequisites]: https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/rofl/prerequisites.md
98+
[npa]: ./account.md#npa
11599

116-
![code shell](../examples/rofl/update-npa.in.static)
100+
## Update ROFL app config {#update}
101+
102+
Use `rofl update` command to update the ROFL app's configuration on chain:
103+
104+
![code shell](../examples/rofl/update.in.static)
105+
106+
![code shell](../examples/rofl/update.out.static)
117107

118108
## Remove ROFL app from the network {#remove}
119109

@@ -126,10 +116,6 @@ Run `rofl remove` to deregister your ROFL app:
126116
The deposit required to register the ROFL app will be returned to the current
127117
administrator account.
128118

129-
You can also define specific [Network, ParaTime and Account][npa] parameters:
130-
131-
![code shell](../examples/rofl/remove-npa.in.static)
132-
133119
## Show ROFL information {#show}
134120

135121
Run `rofl show` to obtain the information from the network on the ROFL admin
@@ -139,11 +125,22 @@ account, staked amount, current ROFL policy and running instances:
139125

140126
![code](../examples/rofl/show.out.static)
141127

142-
You can also define specific [Network and ParaTime][npa] parameters:
128+
## Advanced
143129

144-
![code shell](../examples/rofl/show-np.in.static)
130+
### Show ROFL identity {#identity}
145131

146-
## Advanced
132+
Run `rofl identity` to compute the **cryptographic identity** of the ROFL app:
133+
134+
![code shell](../examples/rofl/identity.in.static)
135+
136+
![code](../examples/rofl/identity.out.static)
137+
138+
The output above is Base64-encoded enclave identity which depends on the ROFL
139+
source code and the build environment. Enclave identities should be reproducible
140+
on any computer and are used to prove and verify the integrity of ROFL binaries
141+
on the network. See the [Reproducibility] chapter to learn more.
142+
143+
[Reproducibility]: https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/runtime/reproducibility.md
147144

148145
### Show the current trust-root {#trust-root}
149146

examples/rofl/create-npa.in.static

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/rofl/create.in.static

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
oasis rofl create policy.yml
1+
oasis rofl create --update-manifest

examples/rofl/create.out.static

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ Body:
77
"quotes": {
88
"pcs": {
99
"tcb_validity_period": 30,
10-
"min_tcb_evaluation_data_number": 16
10+
"min_tcb_evaluation_data_number": 17,
11+
"tdx": {}
1112
}
1213
},
13-
"enclaves": [
14-
"0+tTmlVjUvP0eIHXH7Dld3svPppCUdKDwYxnzplndLea/8+uR7hI7CyvHEm0soNTHhzEJfk1grNoBuUqQ9eNGg=="
15-
],
14+
"enclaves": [],
1615
"endorsements": [
1716
{
1817
"any": {}
@@ -24,21 +23,22 @@ Body:
2423
"scheme": 1
2524
}
2625
Authorized signer(s):
27-
1. YgkEiVSR4SMQdfXw+ppuFYlqH0seutnCKk8KG8PyAx0= (ed25519)
28-
Nonce: 2
26+
1. sk5kvBHaZ/si0xXRdjllIOxOgr7o2d1K+ckVaU3ndG4= (ed25519)
27+
Nonce: 319
2928
Fee:
30-
Amount: 0.0101487
31-
Gas limit: 101487
32-
(gas price: 0.0000001 per gas unit)
29+
Amount: 0.0101405 TEST
30+
Gas limit: 101405
31+
(gas price: 0.0000001 TEST per gas unit)
3332

34-
Network: localnet
35-
ParaTime: sapphire
36-
Account: test:bob
33+
Network: testnet
34+
ParaTime: sapphire (Sapphire Testnet)
35+
Account: test:alice
3736
? Sign this transaction? Yes
3837
(In case you are using a hardware-based signer you may need to confirm on device.)
3938
Broadcasting transaction...
4039
Transaction included in block successfully.
41-
Round: 18715
42-
Transaction hash: 91d86ededa202bce7fb6fd8b5db10f0284a90d3e61ce5f73ea8031c1c1cce342
40+
Round: 412
41+
Transaction hash: 2d8ef6e832256986a19d7b92dcf182976205c5247aff71487832877ff4d72edd
4342
Execution successful.
44-
Created ROFL application: rofl1qqn9xndja7e2pnxhttktmecvwzz0yqwxsquqyxdf
43+
Created ROFL app: rofl1qzd82n99vtwesvcqjfyur4tcm45varz2due7s635
44+
Run `oasis rofl build --update-manifest` to build your ROFL app.

examples/rofl/init.in.static

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oasis rofl init --network testnet --account my_rofl_acc

examples/rofl/init.out.static

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Creating a new ROFL app with default policy...
2+
Name: myapp
3+
Version: 0.1.0
4+
TEE: tdx
5+
Kind: container
6+
Deployment 'default':
7+
Network: testnet
8+
ParaTime: sapphire
9+
Debug: false
10+
Admin: test_a
11+
Created manifest in 'rofl.yaml'.
12+
Run `oasis rofl create --update-manifest` to register your ROFL app and configure an app ID.

examples/rofl/remove-npa.in.static

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/rofl/remove.in.static

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
oasis rofl remove rofl1qrtetspnld9efpeasxmryl6nw9mgllr0euls3dwn
1+
oasis rofl remove

examples/rofl/remove.out.static

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ Format: plain
33
Method: rofl.Remove
44
Body:
55
{
6-
"id": "rofl1qqn9xndja7e2pnxhttktmecvwzz0yqwxsquqyxdf"
6+
"id": "rofl1qzd82n99vtwesvcqjfyur4tcm45varz2due7s635"
77
}
88
Authorized signer(s):
9-
1. YgkEiVSR4SMQdfXw+ppuFYlqH0seutnCKk8KG8PyAx0= (ed25519)
10-
Nonce: 1
9+
1. sk5kvBHaZ/si0xXRdjllIOxOgr7o2d1K+ckVaU3ndG4= (ed25519)
10+
Nonce: 321
1111
Fee:
12-
Amount: 0.0011285
13-
Gas limit: 11285
14-
(gas price: 0.0000001 per gas unit)
12+
Amount: 0.0011288 TEST
13+
Gas limit: 11288
14+
(gas price: 0.0000001 TEST per gas unit)
1515

16-
Network: localnet
17-
ParaTime: sapphire
18-
Account: test:bob
16+
Network: testnet
17+
ParaTime: sapphire (Sapphire Testnet)
18+
Account: test:alice
1919
? Sign this transaction? Yes
2020
(In case you are using a hardware-based signer you may need to confirm on device.)
2121
Broadcasting transaction...
2222
Transaction included in block successfully.
23-
Round: 18692
24-
Transaction hash: d6f738868b9b0e5bfb55e9baa5ed2f23ac8bf8bcb6eb679179a895fd726b0fc2
23+
Round: 510
24+
Transaction hash: b3a6f36c7a846dcf3f28c2dd3d2383cc2c3f7c1e05cea4be92fff2338849d825
2525
Execution successful.

examples/rofl/show-np.in.static

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)