mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat(storage, mdbx): transaction manager (#6126)
This commit is contained in:
@@ -17,8 +17,8 @@ use std::path::Path;
|
||||
fn main() -> eyre::Result<()> {
|
||||
// Opens a RO handle to the database file.
|
||||
// TODO: Should be able to do `ProviderFactory::new_with_db_path_ro(...)` instead of
|
||||
// doing in 2 steps.
|
||||
let db = open_db_read_only(Path::new(&std::env::var("RETH_DB_PATH")?), None)?;
|
||||
// doing in 2 steps.
|
||||
let db = open_db_read_only(Path::new(&std::env::var("RETH_DB_PATH")?), Default::default())?;
|
||||
|
||||
// Instantiate a provider factory for Ethereum mainnet using the provided DB.
|
||||
// TODO: Should the DB version include the spec so that you do not need to specify it here?
|
||||
|
||||
@@ -35,7 +35,10 @@ pub mod myrpc_ext;
|
||||
#[tokio::main]
|
||||
async fn main() -> eyre::Result<()> {
|
||||
// 1. Setup the DB
|
||||
let db = Arc::new(open_db_read_only(Path::new(&std::env::var("RETH_DB_PATH")?), None)?);
|
||||
let db = Arc::new(open_db_read_only(
|
||||
Path::new(&std::env::var("RETH_DB_PATH")?),
|
||||
Default::default(),
|
||||
)?);
|
||||
let spec = Arc::new(ChainSpecBuilder::mainnet().build());
|
||||
let factory = ProviderFactory::new(db.clone(), spec.clone());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user