forked from solana-foundation/anchor
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.rs
More file actions
38 lines (33 loc) · 801 Bytes
/
main.rs
File metadata and controls
38 lines (33 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use anyhow::Result;
use clap::Parser;
use solana_sdk::pubkey::Pubkey;
#[cfg(not(feature = "async"))]
mod blocking;
#[cfg(feature = "async")]
mod nonblocking;
#[derive(Parser, Debug)]
pub struct Opts {
#[clap(long)]
composite_pid: Pubkey,
#[clap(long)]
basic_2_pid: Pubkey,
#[clap(long)]
basic_4_pid: Pubkey,
#[clap(long)]
events_pid: Pubkey,
#[clap(long)]
optional_pid: Pubkey,
#[clap(long, default_value = "false")]
multithreaded: bool,
}
// This example assumes a local validator is running with the programs
// deployed at the addresses given by the CLI args.
#[cfg(not(feature = "async"))]
fn main() -> Result<()> {
blocking::main()
}
#[cfg(feature = "async")]
#[tokio::main]
async fn main() -> Result<()> {
nonblocking::main().await
}