Skip to content

Commit

Permalink
Add check tool for plugin config (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid authored Jan 6, 2023
1 parent ca7e43f commit 7295fb3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
$ solana-validator --geyser-plugin-config ./config.json
```

### Plugin config check

```
cargo-fmt && cargo run --bin config-check -- --config config.json
```

### Client

- Always broadcast new slots
Expand Down
16 changes: 16 additions & 0 deletions src/bin/config-check.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use {clap::Parser, solana_geyser_grpc::config::Config};

#[derive(Debug, Parser)]
#[clap(author, version, about)]
struct Args {
#[clap(short, long, default_value_t = String::from("config.json"))]
/// Path to config
config: String,
}

fn main() -> anyhow::Result<()> {
let args = Args::parse();
let _config = Config::load_from_file(args.config)?;
println!("Config is OK!");
Ok(())
}

0 comments on commit 7295fb3

Please sign in to comment.