pub struct ServerBuilder { /* private fields */ }Implementations§
Source§impl ServerBuilder
impl ServerBuilder
pub fn new(party_id: PartyId) -> Self
pub fn bind<A: ToSocketAddrs>(self, addr: A) -> Self
pub fn peers<I, S>(self, peers: I) -> Self
pub fn with_peers(self, peers: &[(usize, &str)]) -> Self
pub fn peer(self, party_id: usize, address: impl Into<String>) -> Self
pub fn with_program(self, program: Program) -> Self
pub fn with_preprocessing(self, triples: usize, random_shares: usize) -> Self
pub fn expected_clients(self, n: usize) -> Self
pub fn consensus_timeout(self, duration: Duration) -> Self
pub fn backend(self, backend: MpcBackend) -> Self
pub fn manifest<M: GeneratedProgramManifest>(self) -> Self
pub fn honeybadger(self) -> Self
pub fn avss(self, curve: Curve) -> Self
pub fn mpc_config(self, config: &MpcConfig) -> Self
Sourcepub fn with_avss_engine(self, engine: AvssEngine) -> Self
pub fn with_avss_engine(self, engine: AvssEngine) -> Self
Attach a VM-backed AVSS engine that this server should expose.
The builder validates that the selected backend is AVSS and that the engine curve matches the backend curve. The SDK does not construct live AVSS engines on its own.
pub fn with_verified_ordering(self, ordering: VerifiedOrdering) -> Self
Sourcepub fn runner_path(self, path: impl AsRef<Path>) -> Self
pub fn runner_path(self, path: impl AsRef<Path>) -> Self
Override the stoffel-run binary used by StoffelServer::start.
Sourcepub fn entry(self, entry: impl Into<String>) -> Self
pub fn entry(self, entry: impl Into<String>) -> Self
Set the entrypoint passed to stoffel-run. Default is main.
Sourcepub fn bootstrap(self, address: impl Into<String>) -> Self
pub fn bootstrap(self, address: impl Into<String>) -> Self
Configure this server as a follower of an existing bootnode.
Without a bootstrap address, party 0 starts as the leader/bootnode.
Sourcepub fn advertise<A: ToSocketAddrs>(self, addr: A) -> Self
pub fn advertise<A: ToSocketAddrs>(self, addr: A) -> Self
Set the address other parties dial to reach this party’s mesh listener.
The address is forwarded to stoffel-run as --advertise and is what
the bootnode hands to the other parties, so it must be reachable from
them. The port must be the party mesh port: for the leader (party 0
without a bootstrap address) that is the bind port + 1000, for every
other party it is the bind port itself.
Host names are resolved once, here, preferring IPv4. When unset, the runner advertises the address derived from the bind address, which is only dialable by other hosts if the bind address itself is routable.
Sourcepub fn offchain_coordinator(self, config: OffChainServerConfig) -> Self
pub fn offchain_coordinator(self, config: OffChainServerConfig) -> Self
Configure the off-chain coordinator flags passed to stoffel-run.
This is required when the attached program declares ClientStore IO.
pub fn configured_party_id(&self) -> PartyId
pub fn configured_bind_addr(&self) -> Option<&str>
pub fn configured_peers(&self) -> &[(usize, String)]
pub fn configured_program(&self) -> Option<&Program>
pub fn has_configured_program(&self) -> bool
pub fn configured_preprocessing(&self) -> (usize, usize)
pub fn configured_expected_clients(&self) -> usize
pub fn configured_consensus_timeout(&self) -> Duration
pub fn configured_backend(&self) -> MpcBackend
pub fn configured_mpc_config(&self) -> Option<&MpcConfig>
pub fn configured_avss_engine(&self) -> Option<&AvssEngine>
pub fn has_configured_avss_engine(&self) -> bool
pub fn configured_verified_ordering(&self) -> Option<&VerifiedOrdering>
pub fn has_configured_verified_ordering(&self) -> bool
pub fn configured_runner_path(&self) -> Option<&Path>
pub fn configured_entry(&self) -> &str
pub fn configured_bootstrap(&self) -> Option<&str>
pub fn configured_advertise(&self) -> Option<SocketAddr>
pub fn configured_offchain_coordinator(&self) -> Option<&OffChainServerConfig>
pub fn network_config(self, config: &NetworkConfig) -> Self
Sourcepub fn network_deployment(self, deployment: &NetworkDeployment) -> Self
pub fn network_deployment(self, deployment: &NetworkDeployment) -> Self
Configure this server from the matching party config in a deployment.
pub fn network_config_file(self, path: impl AsRef<Path>) -> Self
pub fn build(self) -> Result<StoffelServer>
Trait Implementations§
Source§impl Clone for ServerBuilder
impl Clone for ServerBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for ServerBuilder
impl !UnwindSafe for ServerBuilder
impl Freeze for ServerBuilder
impl Send for ServerBuilder
impl Sync for ServerBuilder
impl Unpin for ServerBuilder
impl UnsafeUnpin for ServerBuilder
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