Skip to main content

EngineBuilder

Struct EngineBuilder 

Source
pub struct EngineBuilder { /* private fields */ }
Expand description

Builder for constructing an Engine with composable configuration.

§Example

ⓘ
let engine = EngineBuilder::new(Box::new(MemoryStorage::new()))
    .with_topic("tm_ship", Box::new(SHIPTopicManager::new()))
    .with_lookup("ls_ship", Box::new(SHIPLookupService::new(storage)))
    .with_hosting_url("https://my-overlay.example.com")
    .with_ship_trackers(vec!["https://overlay-us-1.bsvb.tech".into()])
    .build();

Implementations§

Source§

impl EngineBuilder

Source

pub fn new(storage: Box<dyn Storage>) -> Self

Create a new builder with the given storage backend.

Source

pub fn with_topic( self, name: impl Into<String>, manager: Box<dyn TopicManager>, ) -> Self

Register a topic manager.

Source

pub fn with_lookup( self, name: impl Into<String>, service: Box<dyn LookupService>, ) -> Self

Register a lookup service.

Source

pub fn with_advertiser(self, advertiser: Box<dyn Advertiser>) -> Self

Set the advertiser for SHIP/SLAP advertisement management.

Source

pub fn with_broadcaster(self, broadcaster: Box<dyn Broadcaster>) -> Self

Set the broadcaster for SHIP propagation to peer nodes.

Source

pub fn with_arc_broadcaster(self, arc: Box<dyn ArcBroadcaster>) -> Self

Set the ARC broadcaster for network broadcast to miners.

Source

pub fn with_chain_tracker(self, tracker: Box<dyn ChainTracker>) -> Self

Set the chain tracker for SPV verification.

Source

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

Set the hosting URL for this overlay node.

Source

pub fn with_ship_trackers(self, trackers: Vec<String>) -> Self

Add SHIP tracker URLs for bootstrapping peer discovery.

Source

pub fn with_slap_trackers(self, trackers: Vec<String>) -> Self

Add SLAP tracker URLs for bootstrapping service discovery.

Source

pub fn suppress_default_sync_advertisements(self, suppress: bool) -> Self

Control whether default SHIP/SLAP sync advertisements are suppressed.

Source

pub fn with_script_verification(self, enabled: bool) -> Self

Reference-parity script verification on submit, DEFAULT ON.

On, every submit outside HistoricalTxNoSpv runs the reference’s tx.verify(chainTracker) walk: merkle paths against the chain tracker AND every unproven input’s unlocking script EXECUTED against its source output, recursively over the ancestry in the BEEF; with no chain tracker the walk is the ts-sdk’s 'scripts only'. A spend the interpreter refuses is crate::engine::EngineError::ScriptVerificationFailed.

false is an ESCAPE HATCH, not a mode: for an operator who must admit a body the interpreter wrongly refuses while the defect is fixed. It restores the pre-2026-09-08 structural check (BEEF validity + roots, tracker permitting; nothing without a tracker), under which an invalid spend no broadcaster had yet refused was admitted on structure alone.

Source

pub fn with_walk_budget(self, budget: DoorBudget) -> Self

The budget of the submit’s own script walk (bsv-low #592): the door’s two limbs, crate::engine::DoorBudget::DEFAULT unless set. See Engine::set_walk_budget.

Source

pub fn build(self) -> Engine

Build the Engine.

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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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