()
| 114 | } |
| 115 | |
| 116 | fn default_client() -> Client { |
| 117 | #[cfg(not(feature = "localnet"))] |
| 118 | let host = "https://api.devnet.solana.com"; |
| 119 | #[cfg(feature = "localnet")] |
| 120 | let host = "http://localhost:8899"; |
| 121 | |
| 122 | let config_file = solana_cli_config::CONFIG_FILE.as_ref().unwrap().as_str(); |
| 123 | let config = solana_cli_config::Config::load(config_file).unwrap(); |
| 124 | let payer = read_keypair_file(&config.keypair_path).unwrap(); |
| 125 | Client::new(payer, host.into()) |
| 126 | } |