main.rs 816 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. use anchor_client::solana_sdk::pubkey::Pubkey;
  2. use anyhow::Result;
  3. use clap::Parser;
  4. #[cfg(not(feature = "async"))]
  5. mod blocking;
  6. #[cfg(feature = "async")]
  7. mod nonblocking;
  8. #[derive(Parser, Debug)]
  9. pub struct Opts {
  10. #[clap(long)]
  11. composite_pid: Pubkey,
  12. #[clap(long)]
  13. basic_2_pid: Pubkey,
  14. #[clap(long)]
  15. basic_4_pid: Pubkey,
  16. #[clap(long)]
  17. events_pid: Pubkey,
  18. #[clap(long)]
  19. optional_pid: Pubkey,
  20. #[clap(long, default_value = "false")]
  21. multithreaded: bool,
  22. }
  23. // This example assumes a local validator is running with the programs
  24. // deployed at the addresses given by the CLI args.
  25. #[cfg(not(feature = "async"))]
  26. fn main() -> Result<()> {
  27. blocking::main()
  28. }
  29. #[cfg(feature = "async")]
  30. #[tokio::main]
  31. async fn main() -> Result<()> {
  32. nonblocking::main().await
  33. }