pub struct StoffelRuntime { /* private fields */ }Implementations§
Source§impl StoffelRuntime
impl StoffelRuntime
pub fn program(&self) -> &Program
Sourcepub fn to_bytecode(&self) -> Result<Vec<u8>>
pub fn to_bytecode(&self) -> Result<Vec<u8>>
Serialize the compiled program as CLI-compatible Stoffel bytecode.
Sourcepub fn save_bytecode(&self, path: impl AsRef<Path>) -> Result<()>
pub fn save_bytecode(&self, path: impl AsRef<Path>) -> Result<()>
Save the compiled program as CLI-compatible Stoffel bytecode.
Sourcepub fn bytecode_summary(&self) -> Result<BytecodeSummary>
pub fn bytecode_summary(&self) -> Result<BytecodeSummary>
Summarize the CLI-compatible bytecode artifact without changing it.
pub fn client(&self) -> ClientBuilder
Sourcepub fn client_for_deployment(
&self,
deployment: &NetworkDeployment,
) -> ClientBuilder
pub fn client_for_deployment( &self, deployment: &NetworkDeployment, ) -> ClientBuilder
Create a client builder with this runtime’s program and all deployment servers.
Sourcepub fn offchain_client_config(
&self,
client_slot: u64,
) -> Result<OffChainClientConfigBuilder>
pub fn offchain_client_config( &self, client_slot: u64, ) -> Result<OffChainClientConfigBuilder>
Create an off-chain client IO config builder from this runtime’s typed program metadata.
The runtime supplies the MPC backend, topology, and output count for
client_slot. Callers still provide coordinator/node endpoints,
timestamp, and client identity explicitly.
pub fn server(&self, party_id: usize) -> ServerBuilder
Sourcepub fn server_for_config(&self, config: &NetworkConfig) -> ServerBuilder
pub fn server_for_config(&self, config: &NetworkConfig) -> ServerBuilder
Create a server builder for one party config while carrying this program.
Sourcepub fn servers_for_deployment(
&self,
deployment: &NetworkDeployment,
) -> Vec<ServerBuilder>
pub fn servers_for_deployment( &self, deployment: &NetworkDeployment, ) -> Vec<ServerBuilder>
Create one server builder per party in a validated deployment plan.
Each builder carries this runtime’s compiled program metadata and uses the corresponding party’s network config.
pub fn mpc_config(&self) -> Option<&MpcConfig>
pub fn network_config(&self) -> Option<&NetworkConfig>
pub fn mpc_summary(&self) -> Result<Option<MpcConfigSummary>>
pub fn network_summary(&self) -> Result<Option<NetworkConfigSummary>>
pub fn summary(&self) -> Result<RuntimeSummary>
pub fn local_runner_binary_path(&self) -> Option<&Path>
pub fn inputs(&self) -> &[(String, Value)]
pub fn client_inputs(&self) -> &[(u64, Vec<Value>)]
pub fn configured_expected_clients(&self) -> Option<usize>
pub fn validate_client_inputs(&self) -> Result<()>
Sourcepub fn with_inputs<V>(self, inputs: &[(&str, V)]) -> Self
pub fn with_inputs<V>(self, inputs: &[(&str, V)]) -> Self
Replace named function inputs for clear execution.
Sourcepub fn with_input<V>(self, name: impl Into<String>, value: V) -> Self
pub fn with_input<V>(self, name: impl Into<String>, value: V) -> Self
Add one named function input for clear execution.
Sourcepub fn with_input_file(self, path: impl AsRef<Path>) -> Result<Self>
pub fn with_input_file(self, path: impl AsRef<Path>) -> Result<Self>
Replace named function inputs with values loaded from a .json, .csv, or .txt file.
Sourcepub fn with_client_input<V>(self, client_slot: u64, values: &[V]) -> Self
pub fn with_client_input<V>(self, client_slot: u64, values: &[V]) -> Self
Add one coordinator client input set for local networked execution.
Sourcepub fn with_client_input_file(self, path: impl AsRef<Path>) -> Result<Self>
pub fn with_client_input_file(self, path: impl AsRef<Path>) -> Result<Self>
Replace local ClientStore inputs with values loaded from a .json, .csv, or .txt file.
Sourcepub fn with_client_inputs<V>(self, inputs: &[(u64, &[V])]) -> Self
pub fn with_client_inputs<V>(self, inputs: &[(u64, &[V])]) -> Self
Replace all coordinator client input sets for local networked execution.
Sourcepub fn expected_output_clients(self, n: usize) -> Self
pub fn expected_output_clients(self, n: usize) -> Self
Declare output-capable client slots 0..n-1 for local execution.
Sourcepub fn local_runner_path(self, path: impl AsRef<Path>) -> Self
pub fn local_runner_path(self, path: impl AsRef<Path>) -> Self
Set the stoffel-run binary path used by local coordinator execution.
Sourcepub fn local_network(&self) -> LocalNetworkBuilder<'_>
pub fn local_network(&self) -> LocalNetworkBuilder<'_>
Configure a real localhost coordinator-backed MPC run.
This builder exposes local development controls without replacing the networking, coordinator, or protocol implementations owned by the lower crates.
pub fn execute_clear(&self) -> Result<Vec<Value>>
pub fn execute_clear_function(&self, name: &str) -> Result<Vec<Value>>
Sourcepub fn execute<A>(&self, name: &str, args: A) -> Result<Vec<Value>>where
A: ProgramArgs,
pub fn execute<A>(&self, name: &str, args: A) -> Result<Vec<Value>>where
A: ProgramArgs,
Execute a named function with positional SDK values.
This is the direct, local cleartext execution path for a loaded or compiled program. Arguments are validated against the function metadata stored in the binary before the VM is invoked.
Sourcepub fn execute_main<A>(&self, args: A) -> Result<Vec<Value>>where
A: ProgramArgs,
pub fn execute_main<A>(&self, args: A) -> Result<Vec<Value>>where
A: ProgramArgs,
Execute main with positional SDK values.
Sourcepub async fn execute_local(&self) -> Result<Vec<Value>>
pub async fn execute_local(&self) -> Result<Vec<Value>>
Execute the runtime’s main entrypoint using the local coordinator runner.
This uses the same real localhost party mesh as crate::Stoffel::execute_local.
It is intended for runtimes that were built from no-argument
ClientStore entrypoints with client input supplied through the builder.
Trait Implementations§
Source§impl Clone for StoffelRuntime
impl Clone for StoffelRuntime
Auto Trait Implementations§
impl Freeze for StoffelRuntime
impl RefUnwindSafe for StoffelRuntime
impl Send for StoffelRuntime
impl Sync for StoffelRuntime
impl Unpin for StoffelRuntime
impl UnsafeUnpin for StoffelRuntime
impl UnwindSafe for StoffelRuntime
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more