Use rocksdb as storage backend (#585)
* finish rocksdb storage service * use rocksdb * create missing cf * Update Cargo.toml
This commit is contained in:
parent
502c791318
commit
fd8ea50dd1
|
@ -30,10 +30,12 @@ nomos-mempool = { path = "../../nomos-services/mempool", features = [
|
||||||
] }
|
] }
|
||||||
nomos-metrics = { path = "../../nomos-metrics" }
|
nomos-metrics = { path = "../../nomos-metrics" }
|
||||||
nomos-http = { path = "../../nomos-services/http", features = ["http"] }
|
nomos-http = { path = "../../nomos-services/http", features = ["http"] }
|
||||||
|
nomos-storage = { path = "../../nomos-services/storage", features = ["rocksdb"] }
|
||||||
|
|
||||||
carnot-consensus = { path = "../../nomos-services/carnot-consensus", features = [
|
carnot-consensus = { path = "../../nomos-services/carnot-consensus", features = [
|
||||||
"libp2p",
|
"libp2p",
|
||||||
] }
|
] }
|
||||||
nomos-storage = { path = "../../nomos-services/storage", features = ["sled"] }
|
|
||||||
nomos-libp2p = { path = "../../nomos-libp2p" }
|
nomos-libp2p = { path = "../../nomos-libp2p" }
|
||||||
nomos-da = { path = "../../nomos-services/data-availability", features = [
|
nomos-da = { path = "../../nomos-services/data-availability", features = [
|
||||||
"libp2p",
|
"libp2p",
|
||||||
|
|
|
@ -34,7 +34,7 @@ use nomos_mempool::{
|
||||||
use nomos_metrics::Metrics;
|
use nomos_metrics::Metrics;
|
||||||
use nomos_network::backends::libp2p::Libp2p as NetworkBackend;
|
use nomos_network::backends::libp2p::Libp2p as NetworkBackend;
|
||||||
use nomos_storage::{
|
use nomos_storage::{
|
||||||
backends::{sled::SledBackend, StorageSerde},
|
backends::{rocksdb::RocksBackend, StorageSerde},
|
||||||
StorageService,
|
StorageService,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ pub type Carnot = CarnotConsensus<
|
||||||
TreeOverlay<RoundRobin, RandomBeaconState>,
|
TreeOverlay<RoundRobin, RandomBeaconState>,
|
||||||
FillSizeWithTx<MB16, Tx>,
|
FillSizeWithTx<MB16, Tx>,
|
||||||
FillSizeWithBlobsCertificate<MB16, Certificate>,
|
FillSizeWithBlobsCertificate<MB16, Certificate>,
|
||||||
SledBackend<Wire>,
|
RocksBackend<Wire>,
|
||||||
>;
|
>;
|
||||||
|
|
||||||
pub type DataAvailability = DataAvailabilityService<
|
pub type DataAvailability = DataAvailabilityService<
|
||||||
|
@ -99,7 +99,7 @@ pub struct Nomos {
|
||||||
consensus: ServiceHandle<Carnot>,
|
consensus: ServiceHandle<Carnot>,
|
||||||
http: ServiceHandle<ApiService<AxumBackend<Tx, Wire, MB16>>>,
|
http: ServiceHandle<ApiService<AxumBackend<Tx, Wire, MB16>>>,
|
||||||
da: ServiceHandle<DataAvailability>,
|
da: ServiceHandle<DataAvailability>,
|
||||||
storage: ServiceHandle<StorageService<SledBackend<Wire>>>,
|
storage: ServiceHandle<StorageService<RocksBackend<Wire>>>,
|
||||||
#[cfg(feature = "metrics")]
|
#[cfg(feature = "metrics")]
|
||||||
metrics: ServiceHandle<Metrics>,
|
metrics: ServiceHandle<Metrics>,
|
||||||
system_sig: ServiceHandle<SystemSig>,
|
system_sig: ServiceHandle<SystemSig>,
|
||||||
|
|
|
@ -99,8 +99,10 @@ fn main() -> Result<()> {
|
||||||
#[cfg(feature = "metrics")]
|
#[cfg(feature = "metrics")]
|
||||||
metrics: MetricsSettings { registry },
|
metrics: MetricsSettings { registry },
|
||||||
da: config.da,
|
da: config.da,
|
||||||
storage: nomos_storage::backends::sled::SledBackendSettings {
|
storage: nomos_storage::backends::rocksdb::RocksBackendSettings {
|
||||||
db_path: std::path::PathBuf::from(DEFAULT_DB_PATH),
|
db_path: std::path::PathBuf::from(DEFAULT_DB_PATH),
|
||||||
|
read_only: false,
|
||||||
|
column_family: Some("blocks".into()),
|
||||||
},
|
},
|
||||||
system_sig: (),
|
system_sig: (),
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,7 +24,7 @@ nomos-mempool = { path = "../../nomos-services/mempool", features = [
|
||||||
"openapi",
|
"openapi",
|
||||||
] }
|
] }
|
||||||
nomos-metrics = { path = "../../nomos-metrics" }
|
nomos-metrics = { path = "../../nomos-metrics" }
|
||||||
nomos-storage = { path = "../../nomos-services/storage", features = ["sled"] }
|
nomos-storage = { path = "../../nomos-services/storage", features = ["rocksdb"] }
|
||||||
nomos-libp2p = { path = "../../nomos-libp2p" }
|
nomos-libp2p = { path = "../../nomos-libp2p" }
|
||||||
full-replication = { path = "../../nomos-da/full-replication" }
|
full-replication = { path = "../../nomos-da/full-replication" }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
|
|
@ -24,7 +24,7 @@ use nomos_core::{
|
||||||
use nomos_mempool::{
|
use nomos_mempool::{
|
||||||
backend::mockpool::MockPool, network::adapters::libp2p::Libp2pAdapter as MempoolNetworkAdapter,
|
backend::mockpool::MockPool, network::adapters::libp2p::Libp2pAdapter as MempoolNetworkAdapter,
|
||||||
};
|
};
|
||||||
use nomos_storage::backends::{sled::SledBackend, StorageSerde};
|
use nomos_storage::backends::{rocksdb::RocksBackend, StorageSerde};
|
||||||
|
|
||||||
pub type Carnot<Tx, SS, const SIZE: usize> = CarnotConsensus<
|
pub type Carnot<Tx, SS, const SIZE: usize> = CarnotConsensus<
|
||||||
ConsensusNetworkAdapter,
|
ConsensusNetworkAdapter,
|
||||||
|
@ -42,7 +42,7 @@ pub type Carnot<Tx, SS, const SIZE: usize> = CarnotConsensus<
|
||||||
TreeOverlay<RoundRobin, RandomBeaconState>,
|
TreeOverlay<RoundRobin, RandomBeaconState>,
|
||||||
FillSizeWithTx<SIZE, Tx>,
|
FillSizeWithTx<SIZE, Tx>,
|
||||||
FillSizeWithBlobsCertificate<SIZE, Certificate>,
|
FillSizeWithBlobsCertificate<SIZE, Certificate>,
|
||||||
SledBackend<SS>,
|
RocksBackend<SS>,
|
||||||
>;
|
>;
|
||||||
|
|
||||||
pub async fn carnot_info<Tx, SS, const SIZE: usize>(
|
pub async fn carnot_info<Tx, SS, const SIZE: usize>(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use nomos_core::block::Block;
|
use nomos_core::block::Block;
|
||||||
use nomos_core::header::HeaderId;
|
use nomos_core::header::HeaderId;
|
||||||
use nomos_storage::{
|
use nomos_storage::{
|
||||||
backends::{sled::SledBackend, StorageSerde},
|
backends::{rocksdb::RocksBackend, StorageSerde},
|
||||||
StorageMsg, StorageService,
|
StorageMsg, StorageService,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ where
|
||||||
S: StorageSerde + Send + Sync + 'static,
|
S: StorageSerde + Send + Sync + 'static,
|
||||||
{
|
{
|
||||||
let relay = handle
|
let relay = handle
|
||||||
.relay::<StorageService<SledBackend<S>>>()
|
.relay::<StorageService<RocksBackend<S>>>()
|
||||||
.connect()
|
.connect()
|
||||||
.await?;
|
.await?;
|
||||||
let (msg, receiver) = StorageMsg::new_load_message(id);
|
let (msg, receiver) = StorageMsg::new_load_message(id);
|
||||||
|
|
Loading…
Reference in New Issue