Establish a Connection
The Client creates an instance of RpcClient in its get_rpc_client method.
This sets up an HTTP client to the Solana network, configured from ~/.config/solana/cli/config.yml. Once established, the client can:
- Query accounts
- Send transactions
- Get cluster information
- And much more (see the RpcClient docs)
The json_rpc_url entry in ~/.config/solana/cli/config.yml is set via:
solana config set --url localhost
Other options: devnet, testnet, mainnet-beta.