Make `rpc_url` arg optional
- update
rpc_urlarg to be optional and based off of solana cli config
Been thinking more about this and whether a stateless cli is better. With a stateless ux, there's no ambiguity in which cluster you are querying. You can build a mental model where no flags = mainnet and you never accidentally use a different cluster. It's less important for an explorer but I think stateless is the way to go. If anyone wants to chime in with opinion @Eliascm17, would love to hear thoughts for the contrary
Also, the -u suggestion is already present in the cli:
Options:
-u, --rpc-url <RPC_URL> The url/endpoint to use for any rpc requests [default: http://api.mainnet-beta.solana.com]
-h, --help Print help
-V, --version Print version
I was referring to the "local" vs "l" shorthand.
Been thinking more about this and whether a stateless cli is better. With a stateless ux, there's no ambiguity in which cluster you are querying. You can build a mental model where no flags = mainnet and you never accidentally use a different cluster. It's less important for an explorer but I think stateless is the way to go. If anyone wants to chime in with opinion @Eliascm17, would love to hear thoughts for the contrary
Also, the
-usuggestion is already present in the cli:Options: -u, --rpc-url <RPC_URL> The url/endpoint to use for any rpc requests [default: http://api.mainnet-beta.solana.com] -h, --help Print help -V, --version Print version
Yeah I see your point. I think it's important to think of this cli tool as an explorer and default to mainnet unless specified otherwise. On the other hand who else would be using this cli tool besides devs? In my mind I would have assumed that this cli would be pointing to the cluster based on my current solana cli config but would others also think that?
I was referring to the "local" vs "l" shorthand.
I'm confused as to what this means/ what you're asking me to do lol.
Been thinking more about this and whether a stateless cli is better. With a stateless ux, there's no ambiguity in which cluster you are querying. You can build a mental model where no flags = mainnet and you never accidentally use a different cluster. It's less important for an explorer but I think stateless is the way to go. If anyone wants to chime in with opinion @Eliascm17, would love to hear thoughts for the contrary Also, the
-usuggestion is already present in the cli:Options: -u, --rpc-url <RPC_URL> The url/endpoint to use for any rpc requests [default: http://api.mainnet-beta.solana.com] -h, --help Print help -V, --version Print versionYeah I see your point. I think it's important to think of this cli tool as an explorer and default to mainnet unless specified otherwise. On the other hand who else would be using this cli tool besides devs? In my mind I would have assumed that this cli would be pointing to the cluster based on my current solana cli config but would others also think that?
I was referring to the "local" vs "l" shorthand.
I'm confused as to what this means/ what you're asking me to do lol.
- Wish we could survey to find out what devs want lol.
- When I suggested add "-ul" was referring more to the "l" not the "u". The help prints out
-u, --rpc-url <RPC_URL>so ppl can see that -u is aliased already. However, what's not clear from here is what the accepted shortcuts are -- those are kind of tucked away inget_networkrn and not really documented. I think at the very least l/m/d/t should be documented as options in addition to local, mainnet, devnet, testnet.
I updated the docs to reflect the accepted shortcuts for the rpc_url
/// Specify your RPC endpoint with shortcuts (l=localnet, d=devnet, m=mainnet, t=testnet). Defaults to Solana CLI config. Alias: -u
#[clap(long, short = 'u', global = true)]
rpc_url: Option<String>,
Options:
-u, --rpc-url <RPC_URL> Specify your RPC endpoint with shortcuts (l=localnet, d=devnet, m=mainnet, t=testnet). Defaults to Solana CLI config. Alias: -u
-h, --help Print help
-V, --version Print version