diff --git a/crates/db-utils/README.md b/crates/db-utils/README.md index e69de29..a4570e1 100644 --- a/crates/db-utils/README.md +++ b/crates/db-utils/README.md @@ -0,0 +1,3 @@ +# `op-db-utils` + +Various utilities for working with the legacy Optimism data directories. diff --git a/crates/db-utils/src/leveldb.rs b/crates/db-utils/src/leveldb.rs index 60c3b3b..65b3dba 100644 --- a/crates/db-utils/src/leveldb.rs +++ b/crates/db-utils/src/leveldb.rs @@ -1,34 +1 @@ -use std::path::PathBuf; - -use leveldb::{database::Database, options::Options}; - -struct LevelDB { - path: PathBuf, - database: Database, -} - -impl LevelDB { - pub fn new(path: PathBuf) -> Self { - let options = Options::new(); - Self { - path, - database: Database::open(path.as_path(), options).unwrap(), - } - } -} - -#[cfg(test)] -mod test { - use super::*; - - fn print_type_of(_: &T) { - println!("{}", std::any::type_name::()) - } - - #[test] - fn test_leveldb() { - let db = LevelDB::new(PathBuf::from("testdb")); - let ddb = db.database; - dbg!(print_type_of(&db)); - } -} +// todo diff --git a/download-datadir.sh b/download-datadir.sh new file mode 100755 index 0000000..bd0e96d --- /dev/null +++ b/download-datadir.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "Downloading Bedrock Goerli datadir from gcloud..." + +# Download the Bedrock Goerli datadir from gcloud +curl -L https://datadirs.optimism.io/goerli-bedrock.tar.zst --output goerli-bedrock.tar.zst + +echo "Done. Untarring..." + +# Untar the datadir +tar --zstd -xvf goerli-bedrock.tar.zst + +rm goerli-bedrock.tar.zst + +echo "Done."