-
Notifications
You must be signed in to change notification settings - Fork 32
rofl-appd-localnet: Add appd for Localnet #2430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: release-rofl-appd-localnet | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "rofl-appd-localnet/v[0-9]+.[0-9]+*" | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| release-rofl-appd-localnet: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Oasis CLI | ||
| uses: oasisprotocol/setup-cli-action@0.0.2 | ||
| with: | ||
| version: '0.18.5' | ||
|
|
||
| - name: Build rofl-appd-localnet for Localnet | ||
| working-directory: rofl-appd-localnet | ||
| run: oasis rofl build --deployment localnet --offline | ||
|
|
||
| - name: Publish the release | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| artifacts: rofl-appd-localnet/rofl-appd-localnet.localnet.orc | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| artifactErrorsFailBuild: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [build] | ||
| rustflags = ["-C", "target-feature=+aes,+ssse3"] | ||
| rustdocflags = ["-C", "target-feature=+aes,+ssse3"] | ||
|
|
||
| [test] | ||
| rustflags = ["-C", "target-feature=+aes,+ssse3"] | ||
| rustdocflags = ["-C", "target-feature=+aes,+ssse3"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.orc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [package] | ||
| name = "rofl-appd-localnet" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
|
|
||
| [dependencies] | ||
| # Oasis SDK. | ||
| oasis-runtime-sdk = { path = "../runtime-sdk", features = ["debug-mock-sgx"] } | ||
| rofl-app-core = { path = "../rofl-app-core" } | ||
| rofl-appd = { path = "../rofl-appd" } | ||
|
|
||
| # Third-party dependencies. | ||
| async-trait = "0.1.77" | ||
| tokio = { version = "1.38", features = ["rt", "rt-multi-thread"] } | ||
|
|
||
| [features] | ||
| # Mock SGX in non-SGX builds. | ||
| debug-mock-sgx = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: rofl-appd-localnet | ||
| version: 0.1.0 | ||
| tee: sgx | ||
| kind: raw | ||
| resources: | ||
| memory: 512 | ||
| cpus: 1 | ||
| artifacts: | ||
| builder: ghcr.io/oasisprotocol/rofl-dev:v0.1.0@sha256:1d2b77c25811f70219f366153265702417e0e4a08067a68cce4d132e253d7607 | ||
| deployments: | ||
| localnet: | ||
| app_id: rofl1qqn9xndja7e2pnxhttktmecvwzz0yqwxsquqyxdf | ||
| network: testnet | ||
| paratime: sapphire | ||
| admin: test:bob | ||
| debug: true | ||
| policy: | ||
| quotes: | ||
| pcs: | ||
| tcb_validity_period: 30 | ||
| min_tcb_evaluation_data_number: 18 | ||
| enclaves: | ||
| - id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== | ||
| - id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== | ||
| - id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== | ||
| - id: 0+tTmlVjUvP0eIHXH7Dld3svPppCUdKDwYxnzplndLdOPdSOjtlloBWDuG9YL6TzIL975QTZJ8zMhMUdWMkR8A== | ||
| endorsements: | ||
| - any: {} | ||
| fees: endorsing_node | ||
| max_expiration: 3 | ||
| tooling: | ||
| version: 0.18.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [toolchain] | ||
| channel = "nightly-2025-05-09" | ||
| components = ["rustfmt", "clippy"] | ||
| targets = ["x86_64-fortanix-unknown-sgx", "x86_64-unknown-linux-musl"] | ||
| profile = "minimal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| use std::sync::Arc; | ||
|
|
||
| use oasis_runtime_sdk::core::common::{logger::get_logger, process}; | ||
| use rofl_app_core::prelude::*; | ||
| use rofl_appd::services; | ||
|
|
||
| /// UNIX socket address where the REST API server will listen on. | ||
| const ROFL_APPD_ADDRESS: &str = "unix:/rofls/rofl-appd.sock"; | ||
|
|
||
| struct AppdLocalnetApp; | ||
|
|
||
| #[async_trait] | ||
| impl App for AppdLocalnetApp { | ||
| /// Application version. | ||
| const VERSION: Version = sdk::version_from_cargo!(); | ||
|
|
||
| async fn post_registration_init(self: Arc<Self>, env: Environment<Self>) { | ||
| let logger = get_logger("post_registration_init"); | ||
|
|
||
| // Start the key management service and wait for it to initialize. | ||
| let kms: Arc<dyn services::kms::KmsService> = | ||
| Arc::new(services::kms::OasisKmsService::new(env.clone())); | ||
| let kms_task = kms.clone(); | ||
| tokio::spawn(async move { kms_task.start().await }); | ||
| let _ = kms.wait_ready().await; | ||
|
|
||
| // Initialize the metadata service. | ||
| let metadata = match services::metadata::OasisMetadataService::new(env.clone()).await { | ||
| Ok(service) => Arc::new(service) as Arc<dyn services::metadata::MetadataService>, | ||
| Err(err) => { | ||
| slog::error!(logger, "failed to create metadata service"; "err" => ?err); | ||
| process::abort(); | ||
| } | ||
| }; | ||
|
|
||
| // Start the REST API server. | ||
| slog::info!(logger, "starting the API server"); | ||
| let cfg = rofl_appd::Config { | ||
| address: ROFL_APPD_ADDRESS, | ||
| kms, | ||
| metadata, | ||
| }; | ||
| tokio::spawn(async move { | ||
| if let Err(err) = rofl_appd::start(cfg, env).await { | ||
| slog::error!(logger, "failed to start API server"; "err" => ?err); | ||
| process::abort(); | ||
| } | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| fn main() { | ||
| AppdLocalnetApp.start(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.