solana-program-library
solana-program-library copied to clipboard
spl-stake-pool program requires id.json for all actions
This is a trend for Solana Labs/Solana Foundation produced command line programs -- they always require a ~/.config/solana/id.json file to exist, even for operations that do not require an id at all. I do not ever keep an keypair stored permanently in that location, and don't think these commands should require that file to exist.
All commands should allow keypairs to be specified on the command line and not read ~/.config/solana/id.json. Creating a mechanism encouraging end users to store keys in the open in persistent storage is bad policy; and requiring such keys for commands that don't even need a keypair (such as "spl-stake-pool list") is even worse.
My current solution will be to wrap all Solana Labs/Solana Foundation command line programs with a script that:
- Checks if ~/.config/solana/id.json exists, if so exit in error
- Generate a random keypair into ~/.config/solana/id.json
- Execute the original command with the original arguments
This is extremely inconvenient but more convenient than not being able to use solana commands at all because of the id.json issue.