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

Function main

ciphercore-base/src/bin/ciphercore_compile.rs:182–213  ·  view source on GitHub ↗

This binary prints to stdout the serialized context, which is optimized and MPC-ready, from a given context. # Arguments `context_path` - path to file that contains the serialized context `inline_mode` - argument to specify the inline mode required, valid values are `simple`, `depth-optimized-default` and `depth-optimized-extreme` `input_parties` - string comprising of either a comma separated

()

Source from the content-addressed store, hash-verified

180///
181/// < this_binary > <context_path> <inline_mode> <input_parties> <output_parties>
182fn main() {
183 // Initialize a logger that collects information about errors and panics within CipherCore.
184 // This information can be accessed via RUST_LOG.
185 env_logger::init();
186 // Execute CipherCore code such that all the internal errors are properly formatted and logged.
187 execute_main(|| -> Result<()> {
188 // Parse the input arguments
189 let args = Args::parse();
190 // Read the entire file containing a serialized context as a string
191 let serialized_context = fs::read_to_string(&args.context_path)?;
192 // Deserialize into a context object from the serialized context string
193 let context = serde_json::from_str::<Context>(&serialized_context)?;
194 // Parse the input party information
195 let input_parties = parse_input_parties(args.input_parties)?;
196 // Parse the output party information
197 let output_parties = parse_output_parties(args.output_parties)?;
198 // Obtain the compiled context
199 let compiled_context = compile_context(
200 context,
201 input_parties,
202 output_parties,
203 InlineConfig {
204 default_mode: get_inline_mode(args.inline_mode),
205 ..Default::default()
206 },
207 get_evaluator,
208 )?;
209 // Print the serialized and compiled context to stdout
210 println!("{}", serde_json::to_string(&compiled_context).unwrap());
211 Ok(())
212 });
213}

Callers

nothing calls this directly

Calls 5

execute_mainFunction · 0.85
parse_input_partiesFunction · 0.85
parse_output_partiesFunction · 0.85
compile_contextFunction · 0.85
get_inline_modeFunction · 0.70

Tested by

no test coverage detected