Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electrs-rockdb what comparator was used please? #1160

Open
mahalamobile opened this issue Feb 19, 2025 · 0 comments
Open

Electrs-rockdb what comparator was used please? #1160

mahalamobile opened this issue Feb 19, 2025 · 0 comments

Comments

@mahalamobile
Copy link

Error: Error { message: "Invalid argument: leveldb.BytewiseComparator: does not match existing comparator rocksdict" }

electrs-rocksdb = "0.19.0-e3"

fn open_db(db_path: &str) -> Result<DB, Box> {
let mut opts = Options::default();
opts.create_if_missing(true);
opts.create_missing_column_families(true);
// No custom comparator, RocksDB will use the default comparator

let cf_descriptors = vec![
    ColumnFamilyDescriptor::new("default", opts.clone()),
    ColumnFamilyDescriptor::new("headers", opts.clone()),
    ColumnFamilyDescriptor::new("txid", opts.clone()),
    ColumnFamilyDescriptor::new("funding", opts.clone()),
    ColumnFamilyDescriptor::new("spending", opts.clone()),
];

let db = DB::open_cf_descriptors(&opts, db_path, cf_descriptors)?;
Ok(db)

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant