8000 Fog Ledger Enclave Health Check by dolanbernard · Pull Request #3530 · mobilecoinfoundation/mobilecoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fog Ledger Enclave Health Check #3530

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions fog/ledger/server/src/bin/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::env;
use clap::Parser;
use mc_attest_net::{Client, RaClient};
use mc_common::logger::log;
use mc_fog_ledger_enclave::{LedgerSgxEnclave, ENCLAVE_FILE};
use mc_fog_ledger_enclave::{LedgerEnclave, LedgerSgxEnclave, ENCLAVE_FILE};
use mc_fog_ledger_server::{LedgerRouterConfig, LedgerRouterServer};
use mc_ledger_db::LedgerDB;
use mc_watcher::watcher_db::WatcherDB;
Expand Down Expand Up @@ -53,11 +53,21 @@ fn main() {
WatcherDB::open_ro(&config.watcher_db, logger.clone()).expect("Could not open watcher DB");

let ias_client = Client::new(&config.ias_api_key).expect("Could not create IAS client");
let mut router_server =
LedgerRouterServer::new(config, enclave, ias_client, ledger_db, watcher_db, logger);
let mut router_server = LedgerRouterServer::new(
config,
enclave.clone(),
ias_client,
ledger_db,
watcher_db,
logger.clone(),
);
router_server.start();

loop {
std::thread::sleep(std::time::Duration::from_millis(1000));
if enclave.get_identity().is_err() {
mc_common::logger::log::crit!(logger, "get_identity call to ledger enclave failed. Enclave may not be running or is not in a healthy state.");
panic!("Panicking to restart enclave");
}
}
}
0