Skip to content

Commit 2db735d

Browse files
committed
examples/runtime-sdk/rofl-oracle-tdx-raw: Revamp
1 parent 2a95207 commit 2db735d

File tree

10 files changed

+112
-30
lines changed

10 files changed

+112
-30
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ exclude = [
3939
"examples/contract-sdk/hello-world",
4040
"examples/contract-sdk/c10l-hello-world",
4141
"examples/runtime-sdk/minimal-runtime",
42-
"examples/runtime-sdk/rofl-oracle",
43-
"examples/runtime-sdk/rofl-oracle-tdx",
42+
"examples/runtime-sdk/rofl-oracle-sgx",
43+
"examples/runtime-sdk/rofl-oracle-tdx-raw",
4444
]
4545
resolver = "2"
4646

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[advisories]
2+
ignore = [
3+
"RUSTSEC-2023-0071", # Does not affect our current use of the library.
4+
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build]
2+
rustflags = ["-C", "target-feature=+aes,+ssse3"]
3+
rustdocflags = ["-C", "target-feature=+aes,+ssse3"]
4+
5+
[test]
6+
rustflags = ["-C", "target-feature=+aes,+ssse3"]
7+
rustdocflags = ["-C", "target-feature=+aes,+ssse3"]
File renamed without changes.

examples/runtime-sdk/rofl-oracle-tdx/Cargo.lock renamed to examples/runtime-sdk/rofl-oracle-tdx-raw/Cargo.lock

Lines changed: 57 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/runtime-sdk/rofl-oracle-tdx/Cargo.toml renamed to examples/runtime-sdk/rofl-oracle-tdx-raw/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[package]
2-
name = "rofl-oracle-tdx"
2+
name = "rofl-oracle-tdx-raw"
33
version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
77
# Oasis SDK.
88
oasis-runtime-sdk = { path = "../../../runtime-sdk", features = ["tdx"] }
9+
rofl-app-core = { path = "../../../rofl-app-core", features = ["tdx"] }
910
module-evm = { path = "../../../runtime-sdk/modules/evm", package = "oasis-runtime-sdk-evm" }
1011

1112
# Third-party dependencies.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../rofl-oracle-sgx/contracts
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: rofl-oracle-tdx-raw
2+
version: 0.1.0
3+
tee: tdx
4+
kind: raw
5+
resources:
6+
memory: 512
7+
cpus: 1
8+
storage:
9+
kind: disk-persistent
10+
size: 512
11+
artifacts:
12+
builder: ghcr.io/oasisprotocol/rofl-dev:v0.1.0@sha256:1d2b77c25811f70219f366153265702417e0e4a08067a68cce4d132e253d7607
13+
firmware: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/ovmf.tdx.fd#db47100a7d6a0c1f6983be224137c3f8d7cb09b63bb1c7a5ee7829d8e994a42f
14+
kernel: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/stage1.bin#23877530413a661e9187aad2eccfc9660fc4f1a864a1fbad2f6c7d43512071ca
15+
stage2: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/stage2-basic.tar.bz2#72c84d2566959799fdd98fae08c143a8572a5a09ee426be376f9a8bbd1675f2b
16+
deployments:
17+
testnet:
18+
app_id: rofl1qzxxvcstj3upfxfrf7l32quzd2cuvkqsvsa2huu3
19+
network: testnet
20+
paratime: sapphire
21+
admin: dave
22+
trust_root:
23+
height: 27512977
24+
hash: 202066c13513069cf50c4b24fd3a6c7d6ec2134780781310975034995c69f24c
25+
policy:
26+
quotes:
27+
pcs:
28+
tcb_validity_period: 30
29+
min_tcb_evaluation_data_number: 18
30+
tdx: {}
31+
enclaves:
32+
- id: qzAcTlNHoJLLIYOUkI2MkCIxbSqtrl6tgmjepoKpeBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
33+
- id: 2ix2fpJND5LSx3oKQBPu5EyOkKQ7+sf8VDnQBJj/HPYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
34+
endorsements:
35+
- any: {}
36+
fees: endorsing_node
37+
max_expiration: 3

examples/runtime-sdk/rofl-oracle-tdx/rust-toolchain.toml renamed to examples/runtime-sdk/rofl-oracle-tdx-raw/rust-toolchain.toml

File renamed without changes.

examples/runtime-sdk/rofl-oracle-tdx/src/main.rs renamed to examples/runtime-sdk/rofl-oracle-tdx-raw/src/main.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
use oasis_runtime_sdk::modules::rofl::app::prelude::*;
1+
use rofl_app_core::prelude::*;
22

33
/// Address where the oracle contract is deployed.
4-
// #region oracle-contract-address
5-
const ORACLE_CONTRACT_ADDRESS: &str = "0x1234845aaB7b6CD88c7fAd9E9E1cf07638805b20"; // TODO: Replace with your contract address.
6-
// #endregion oracle-contract-address
4+
const ORACLE_CONTRACT_ADDRESS: &str = "0x5FbDB2315678afecb367f032d93F642f64180aa3"; // TODO: Replace with your contract address.
75

86
struct OracleApp;
97

@@ -12,28 +10,6 @@ impl App for OracleApp {
1210
/// Application version.
1311
const VERSION: Version = sdk::version_from_cargo!();
1412

15-
/// Identifier of the application (used for registrations).
16-
// #region app-id
17-
fn id() -> AppId {
18-
"rofl1qp55evqls4qg6cjw5fnlv4al9ptc0fsakvxvd9uw".into() // TODO: Replace with your application ID.
19-
}
20-
// #endregion app-id
21-
22-
/// Return the consensus layer trust root for this runtime; if `None`, consensus layer integrity
23-
/// verification will not be performed (e.g. Localnet).
24-
// #region consensus-trust-root
25-
fn consensus_trust_root() -> Option<TrustRoot> {
26-
// The trust root below is for Sapphire Testnet at consensus height 22110615.
27-
Some(TrustRoot {
28-
height: 22110615,
29-
hash: "95d1501f9cb88619050a5b422270929164ce739c5d803ed9500285b3b040985e".into(),
30-
runtime_id: "000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c".into(),
31-
chain_context: "0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76"
32-
.to_string(),
33-
})
34-
}
35-
// #endregion consensus-trust-root
36-
3713
async fn run(self: Arc<Self>, _env: Environment<Self>) {
3814
// We are running now!
3915
println!("Hello ROFL world!");

0 commit comments

Comments
 (0)