pub struct DomainBuilder<S> { /* private fields */ }Expand description
Builder to configure and create new domains
Obtain an instance via Domain::builder or Domain::from_config, then configure the domain with, for example:
with_rpcto connect to a base layer RPCwith_proving_clientto set the proving client
Implementations§
Source§impl<S> DomainBuilder<S>
impl<S> DomainBuilder<S>
Sourcepub fn with_rocksdb(self, db_options: DbOptions) -> DomainBuilder<DbOptions>
pub fn with_rocksdb(self, db_options: DbOptions) -> DomainBuilder<DbOptions>
Use RocksDb with the given configuration as storage
Source§impl<S> DomainBuilder<S>
impl<S> DomainBuilder<S>
Sourcepub fn with_proving_client(self, proving: Box<dyn Proving>) -> Self
pub fn with_proving_client(self, proving: Box<dyn Proving>) -> Self
Use the given proving client to generate proofs.
This can be a custom implementation of Proving or a provided one, for
example SP1 (the sp1 feature needs to be active for that):
use delta_domain_sdk::{proving, Domain};
builder.with_proving_client(
Box::new(proving::sp1::Client::global_laws_cpu()
.with_local_laws_cpu(local_laws_elf))
);Sourcepub fn with_storage<S2>(self, storage: S2) -> DomainBuilder<Database<S2>>where
S2: KeyValueStorageWithColumnFamilies<ColumnFamilyIdentifier = ColumnFamilies, Error = StorageError> + Send + Sync + 'static,
pub fn with_storage<S2>(self, storage: S2) -> DomainBuilder<Database<S2>>where
S2: KeyValueStorageWithColumnFamilies<ColumnFamilyIdentifier = ColumnFamilies, Error = StorageError> + Send + Sync + 'static,
Use a custom KeyValueStorageWithColumnFamilies implementation
§Note
The SDK assumes that iteration order for [ColumnFamilies::PendingVerifiables] (i.e. the column family) is in lexicographical order of the keys/indices.
Sourcepub fn with_database<S2>(
self,
database: Database<S2>,
) -> DomainBuilder<Database<S2>>where
S2: KeyValueStorageWithColumnFamilies<ColumnFamilyIdentifier = ColumnFamilies, Error = StorageError> + Send + Sync + 'static,
pub fn with_database<S2>(
self,
database: Database<S2>,
) -> DomainBuilder<Database<S2>>where
S2: KeyValueStorageWithColumnFamilies<ColumnFamilyIdentifier = ColumnFamilies, Error = StorageError> + Send + Sync + 'static,
Use a custom KeyValueStorageWithColumnFamilies implementation wrapped in a Database.
§Note
The SDK assumes that iteration order for [ColumnFamilies::PendingVerifiables] (i.e. the column family) is in lexicographical order of the keys/indices.
Sourcepub fn with_mock_rpc(self, mock_vaults: HashMap<Address, Vault>) -> Self
pub fn with_mock_rpc(self, mock_vaults: HashMap<Address, Vault>) -> Self
Override any previously configured RPC (even rpc_url from config file)
and use a mock RPC as base layer network that can return the given
mock_vaults when requested.
Note that only sharded vaults are supported.
Source§impl<S> DomainBuilder<Database<S>>where
S: KeyValueStorageWithColumnFamilies<ColumnFamilyIdentifier = ColumnFamilies, Error = StorageError> + Send + Sync + 'static,
impl<S> DomainBuilder<Database<S>>where
S: KeyValueStorageWithColumnFamilies<ColumnFamilyIdentifier = ColumnFamilies, Error = StorageError> + Send + Sync + 'static,
Trait Implementations§
Auto Trait Implementations§
impl<S> !Freeze for DomainBuilder<S>
impl<S> !RefUnwindSafe for DomainBuilder<S>
impl<S> Send for DomainBuilder<S>where
S: Send,
impl<S> Sync for DomainBuilder<S>where
S: Sync,
impl<S> Unpin for DomainBuilder<S>where
S: Unpin,
impl<S> !UnwindSafe for DomainBuilder<S>
Blanket Implementations§
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request