Skip to content

Commit

Permalink
The actual main.rs implementation for the Replicated Ledger Service
Browse files Browse the repository at this point in the history
Change-Id: I979320a25b9f7023822aa5954dd2e9e62d9a5550
  • Loading branch information
stanischikn committed Jul 25, 2024
1 parent b3db424 commit 0f8072c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion replicated_ledger_enclave_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ license = "Apache-2.0"
forced-target = "x86_64-unknown-none"

[dependencies]
federated_compute = { path = "../third_party/federated_compute" }
ledger_service = { path = "../ledger_service" }
oak_restricted_kernel_sdk = { workspace = true }
tcp_proto = { workspace = true }
tcp_runtime = { workspace = true }

[[bin]]
name = "replicated_ledger_enclave_app"
Expand Down
8 changes: 6 additions & 2 deletions replicated_ledger_enclave_app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@
extern crate alloc;

use alloc::boxed::Box;
use ledger_service::actor::LedgerActor;
use oak_restricted_kernel_sdk::{
channel::{start_blocking_server, FileDescriptorChannel},
crypto::InstanceSigner,
entrypoint,
utils::samplestore::StaticSampleStore,
};
use tcp_proto::runtime::endpoint::EndpointServiceServer;
use tcp_runtime::service::ApplicationService;

#[entrypoint]
fn run_server() -> ! {
let mut invocation_stats = StaticSampleStore::<1000>::new().unwrap();
let service = ledger_service::LedgerService::new(Box::new(InstanceSigner::create().unwrap()));
let server = federated_compute::proto::LedgerServer::new(service);
let actor = LedgerActor::new(Box::new(InstanceSigner::create().unwrap()));
let service: ApplicationService<LedgerActor> = ApplicationService::new(actor);
let server = EndpointServiceServer::new(service);
start_blocking_server(Box::<FileDescriptorChannel>::default(), server, &mut invocation_stats)
.expect("server encountered an unrecoverable error");
}

0 comments on commit 0f8072c

Please sign in to comment.