Skip to main content

ServerBuilder

Struct ServerBuilder 

Source
pub struct ServerBuilder { /* private fields */ }

Implementations§

Source§

impl ServerBuilder

Source

pub fn new(party_id: PartyId) -> Self

Source

pub fn bind<A: ToSocketAddrs>(self, addr: A) -> Self

Source

pub fn peers<I, S>(self, peers: I) -> Self
where I: IntoIterator<Item = (usize, S)>, S: Into<String>,

Source

pub fn with_peers(self, peers: &[(usize, &str)]) -> Self

Source

pub fn peer(self, party_id: usize, address: impl Into<String>) -> Self

Source

pub fn with_program(self, program: Program) -> Self

Source

pub fn with_preprocessing(self, triples: usize, random_shares: usize) -> Self

Source

pub fn expected_clients(self, n: usize) -> Self

Source

pub fn consensus_timeout(self, duration: Duration) -> Self

Source

pub fn backend(self, backend: MpcBackend) -> Self

Source

pub fn manifest<M: GeneratedProgramManifest>(self) -> Self

Source

pub fn honeybadger(self) -> Self

Source

pub fn avss(self, curve: Curve) -> Self

Source

pub fn mpc_config(self, config: &MpcConfig) -> Self

Source

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.

Source

pub fn with_verified_ordering(self, ordering: VerifiedOrdering) -> Self

Source

pub fn runner_path(self, path: impl AsRef<Path>) -> Self

Override the stoffel-run binary used by StoffelServer::start.

Source

pub fn entry(self, entry: impl Into<String>) -> Self

Set the entrypoint passed to stoffel-run. Default is main.

Source

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.

Source

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.

Source

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.

Source

pub fn configured_party_id(&self) -> PartyId

Source

pub fn configured_bind_addr(&self) -> Option<&str>

Source

pub fn configured_peers(&self) -> &[(usize, String)]

Source

pub fn configured_program(&self) -> Option<&Program>

Source

pub fn has_configured_program(&self) -> bool

Source

pub fn configured_preprocessing(&self) -> (usize, usize)

Source

pub fn configured_expected_clients(&self) -> usize

Source

pub fn configured_consensus_timeout(&self) -> Duration

Source

pub fn configured_backend(&self) -> MpcBackend

Source

pub fn configured_mpc_config(&self) -> Option<&MpcConfig>

Source

pub fn configured_avss_engine(&self) -> Option<&AvssEngine>

Source

pub fn has_configured_avss_engine(&self) -> bool

Source

pub fn configured_verified_ordering(&self) -> Option<&VerifiedOrdering>

Source

pub fn has_configured_verified_ordering(&self) -> bool

Source

pub fn configured_runner_path(&self) -> Option<&Path>

Source

pub fn configured_entry(&self) -> &str

Source

pub fn configured_bootstrap(&self) -> Option<&str>

Source

pub fn configured_advertise(&self) -> Option<SocketAddr>

Source

pub fn configured_offchain_coordinator(&self) -> Option<&OffChainServerConfig>

Source

pub fn network_config(self, config: &NetworkConfig) -> Self

Source

pub fn network_deployment(self, deployment: &NetworkDeployment) -> Self

Configure this server from the matching party config in a deployment.

Source

pub fn network_config_file(self, path: impl AsRef<Path>) -> Self

Source

pub fn build(self) -> Result<StoffelServer>

Trait Implementations§

Source§

impl Clone for ServerBuilder

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServerBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more