mod setup;
use std::path::Path;
use common::peer::BlobsStore;
use crate::state::BlobStoreConfig;
#[derive(Clone)]
pub struct Blobs(BlobsStore);
impl Blobs {
pub async fn setup(
config: &BlobStoreConfig,
jax_dir: &Path,
max_import_size: u64,
) -> Result<Self, BlobsSetupError> {
let store = setup::setup_blobs_store(config, jax_dir, max_import_size).await?;
Ok(Self(store))
}
pub fn into_inner(self) -> BlobsStore {
self.0
}
}
#[derive(Debug, thiserror::Error)]
pub enum BlobsSetupError {
#[error("blob store error: {0}")]
StoreError(String),
}