I am working with the Solana command-line tools and I need to point them at my own RPC node instead of the default public endpoint. I have tried this:
solana config set --url http://localhost:8899
When I run commands such as solana balance
or solana slot
they use the default cluster.
How do I verify which RPC endpoint the CLI is targeting?
Switch it to my local endpoint
Ensure solana-keygen
picks it up
You can verify your current endpoint by the following command
solana config get
Look for the RPC URL in the output.
The command you have tried should work but ensure your validator is actually running on 8899. Use the confirmed
flag to ensure the config change is saved.
solana config set --url http://localhost:8899 --confirmed
solana-keygen
reads from the config file located at ~/.config/solana/cli/config.yml
Using solana config set
updates this file. Hope that clarifies your question.