mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
refactor(db): derive Clone for DatabaseEnv (#21641)
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
committed by
GitHub
parent
781128eece
commit
370a548f34
@@ -44,12 +44,12 @@ async fn main() -> eyre::Result<()> {
|
||||
// 1. Set up the DB
|
||||
let db_path = std::env::var("RETH_DB_PATH")?;
|
||||
let db_path = Path::new(&db_path);
|
||||
let db = Arc::new(open_db_read_only(
|
||||
let db = open_db_read_only(
|
||||
db_path.join("db").as_path(),
|
||||
DatabaseArguments::new(ClientVersion::default()),
|
||||
)?);
|
||||
)?;
|
||||
let spec = Arc::new(ChainSpecBuilder::mainnet().build());
|
||||
let factory = ProviderFactory::<NodeTypesWithDBAdapter<EthereumNode, Arc<DatabaseEnv>>>::new(
|
||||
let factory = ProviderFactory::<NodeTypesWithDBAdapter<EthereumNode, DatabaseEnv>>::new(
|
||||
db.clone(),
|
||||
spec.clone(),
|
||||
StaticFileProvider::read_only(db_path.join("static_files"), true)?,
|
||||
|
||||
Reference in New Issue
Block a user