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

Add geyser plugin runner #83

Merged
merged 23 commits into from
May 7, 2024

Conversation

gagliardetto
Copy link
Collaborator

@gagliardetto gagliardetto commented Feb 7, 2024

This PR adds the rust code that can be used to read old-faithful CAR files and send their contents to a Solana geyser plugin.

This PR provides the rust libraries to read CAR files, and a CLI to dum a CAR file to a geyser plugin.

Copy link
Contributor

@fanatid fanatid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use workspaces here? https://doc.rust-lang.org/cargo/reference/workspaces.html
would be good to have rust-toolchain.toml so rust version would be fixed https://rust-lang.github.io/rustup/overrides.html

}

impl DataFrame {
pub fn from_bytes(data: Vec<u8>) -> Result<DataFrame, Box<dyn Error>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyhow + thiserror usually is idiomatic error handing in rust

pub fn from_bytes(data: Vec<u8>) -> Result<DataFrame, Box<dyn Error>> {
let decoded_data: serde_cbor::Value = serde_cbor::from_slice(&data).unwrap();
let data_frame = DataFrame::from_cbor(decoded_data)?;
return Ok(data_frame);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return Ok(data_frame);
Ok(data_frame)

I guess there more things like this, would be good to have cargo tree / fmt / clippy in CI

geyser-plugin-runner/src/dataframe.rs Outdated Show resolved Hide resolved
geyser-plugin-runner/demo-plugin/src/lib.rs Outdated Show resolved Hide resolved
geyser-plugin-runner/demo-plugin/src/lib.rs Outdated Show resolved Hide resolved
@gagliardetto gagliardetto merged commit bd6ab88 into rpcpool:main May 7, 2024
1 of 3 checks passed
@gagliardetto gagliardetto deleted the geyser-plugin-runner branch June 6, 2024 13:45
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 this pull request may close these issues.

3 participants