@@ -46,7 +46,6 @@ use std::{borrow::Cow, path::PathBuf};
4646#[ cfg( feature = "serde" ) ]
4747use serde:: { Deserialize , Serialize } ;
4848
49- use cuprate_database:: { config:: SyncMode , resize:: ResizeAlgorithm } ;
5049use cuprate_helper:: {
5150 fs:: { blockchain_path, CUPRATE_DATA_DIR } ,
5251 network:: Network ,
@@ -71,9 +70,6 @@ pub struct ConfigBuilder {
7170
7271 data_dir : Option < PathBuf > ,
7372
74- /// [`Config::cuprate_database_config`].
75- db_config : cuprate_database:: config:: ConfigBuilder ,
76-
7773 /// [`Config::reader_threads`].
7874 reader_threads : Option < ReaderThreads > ,
7975}
@@ -87,10 +83,6 @@ impl ConfigBuilder {
8783 Self {
8884 network : Network :: default ( ) ,
8985 data_dir : None ,
90- db_config : cuprate_database:: config:: ConfigBuilder :: new ( Cow :: Owned ( blockchain_path (
91- & CUPRATE_DATA_DIR ,
92- Network :: Mainnet ,
93- ) ) ) ,
9486 reader_threads : None ,
9587 }
9688 }
@@ -110,14 +102,9 @@ impl ConfigBuilder {
110102 . unwrap_or_else ( || CUPRATE_DATA_DIR . to_path_buf ( ) ) ;
111103
112104 let reader_threads = self . reader_threads . unwrap_or_default ( ) ;
113- let db_config = self
114- . db_config
115- . db_directory ( Cow :: Owned ( blockchain_path ( & data_dir, self . network ) ) )
116- . reader_threads ( reader_threads. as_threads ( ) )
117- . build ( ) ;
118105
119106 Config {
120- db_config ,
107+ data_dir : blockchain_path ( & data_dir , self . network ) ,
121108 blob_data_dir : None ,
122109 reader_threads,
123110 }
@@ -137,20 +124,6 @@ impl ConfigBuilder {
137124 self
138125 }
139126
140- /// Calls [`cuprate_database::config::ConfigBuilder::sync_mode`].
141- #[ must_use]
142- pub fn sync_mode ( mut self , sync_mode : SyncMode ) -> Self {
143- self . db_config = self . db_config . sync_mode ( sync_mode) ;
144- self
145- }
146-
147- /// Calls [`cuprate_database::config::ConfigBuilder::resize_algorithm`].
148- #[ must_use]
149- pub fn resize_algorithm ( mut self , resize_algorithm : ResizeAlgorithm ) -> Self {
150- self . db_config = self . db_config . resize_algorithm ( resize_algorithm) ;
151- self
152- }
153-
154127 /// Set a custom [`ReaderThreads`].
155128 #[ must_use]
156129 pub const fn reader_threads ( mut self , reader_threads : ReaderThreads ) -> Self {
@@ -164,8 +137,6 @@ impl ConfigBuilder {
164137 /// Good default for testing, and resource-available machines.
165138 #[ must_use]
166139 pub fn fast ( mut self ) -> Self {
167- self . db_config = self . db_config . fast ( ) ;
168-
169140 self . reader_threads = Some ( ReaderThreads :: OnePerThread ) ;
170141 self
171142 }
@@ -176,8 +147,6 @@ impl ConfigBuilder {
176147 /// Good default for resource-limited machines, e.g. a cheap VPS.
177148 #[ must_use]
178149 pub fn low_power ( mut self ) -> Self {
179- self . db_config = self . db_config . low_power ( ) ;
180-
181150 self . reader_threads = Some ( ReaderThreads :: One ) ;
182151 self
183152 }
@@ -187,11 +156,7 @@ impl Default for ConfigBuilder {
187156 fn default ( ) -> Self {
188157 Self {
189158 network : Network :: default ( ) ,
190- data_dir : Some ( CUPRATE_DATA_DIR . to_path_buf ( ) ) ,
191- db_config : cuprate_database:: config:: ConfigBuilder :: new ( Cow :: Owned ( blockchain_path (
192- & CUPRATE_DATA_DIR ,
193- Network :: default ( ) ,
194- ) ) ) ,
159+ data_dir : Some ( blockchain_path ( & CUPRATE_DATA_DIR , Network :: default ( ) ) ) ,
195160 reader_threads : Some ( ReaderThreads :: default ( ) ) ,
196161 }
197162 }
@@ -208,8 +173,7 @@ impl Default for ConfigBuilder {
208173#[ derive( Debug , Clone , PartialEq , PartialOrd ) ]
209174#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
210175pub struct Config {
211- /// The database configuration.
212- pub db_config : cuprate_database:: config:: Config ,
176+ pub data_dir : PathBuf ,
213177
214178 /// The directory to store block/tx blobs.
215179 pub blob_data_dir : Option < PathBuf > ,
0 commit comments