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

Low level database access? #1892

Closed
andy-thomason opened this issue May 9, 2024 · 3 comments · Fixed by #1939
Closed

Low level database access? #1892

andy-thomason opened this issue May 9, 2024 · 3 comments · Fixed by #1939
Assignees

Comments

@andy-thomason
Copy link

It would be very useful to be able to access the database from an external process such as in the following example:

fn access_database() -> anyhow::Result<()> {
    let path = Path::new("/data/fuel/data/fuel_beta5");
    let database = Database::open(path, None)?;

    let h = database.latest_height()?;
    println!("h={h}");
    Ok(())
}

We can do this with many blockchain nodes without stopping the service
and it provides a low-latency, high-throughput interface to the state of the node.
But it seems that the rocksdb database has a permanent lock on the LOCK file.

Perhaps there is something I don't understand or an alternative table-level interface
such as Erigon's KV gRPC (not ideal, but better than GraphQL).

If I am being an idiot, please say so!

@andy-thomason
Copy link
Author

Thanks. @xgreenx

I'll pass this on to Mahdi who is implementing data ingestion.

@xgreenx xgreenx self-assigned this Jun 10, 2024
@malivix
Copy link

malivix commented Jun 28, 2024

@xgreenx
For read only and secondary mode should call try_catch_up_with_primary but seems is not happening now, so will not data updated

@xgreenx
Copy link
Collaborator

xgreenx commented Jun 28, 2024

Read only doesn't support try_catch_up_with_primary; only secondary mode supports it. You need to call it manually on your side=)

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

Successfully merging a pull request may close this issue.

3 participants