MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / main

Function main

ciphercore-base/src/bin/ciphercore_millionaires.rs:15–34  ·  view source on GitHub ↗

This binary prints the serialized millionaires-problem-graph context on the non-encrypted input in (serde) JSON format. # Usage < this_binary >

()

Source from the content-addressed store, hash-verified

13///
14/// < this_binary >
15fn main() {
16 // Initialize a logger that collects information about errors and panics within CipherCore.
17 // This information can be accessed via RUST_LOG.
18 env_logger::init();
19 // Execute CipherCore code such that all the internal errors are properly formatted and logged.
20 execute_main(|| -> Result<()> {
21 // Create a context
22 let context = create_context()?;
23 // Create a Millionaires' problem graph in the context
24 let graph: Graph = create_millionaires_graph(context.clone())?;
25 // Set this graph as main to be able to finalize the context
26 context.set_main_graph(graph)?;
27 // Finalize the context. This makes sure that all the graphs of the contexts are ready for computation.
28 // After this action the context can't be changed.
29 context.finalize()?;
30 // Serialize the context and print it to stdout
31 println!("{}", serde_json::to_string(&context)?);
32 Ok(())
33 });
34}

Callers

nothing calls this directly

Calls 6

execute_mainFunction · 0.85
cloneMethod · 0.80
create_contextFunction · 0.50
set_main_graphMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected