Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I want to test my solana program on mainnet. I know that on devnet the deployment costs 5 SOL.
So I was wondering whether I could close the program account and get some of the deployment funds back?
Yes, it is possible to close down a program. It probably has to be marked as upgradeable and only the upgrade_authority can close the program and recover the rent.
If the program is upgradeable, you can do:
solana program close <PROGRAM_ID>
Which will give:
Closed Program Id <PROGRAM_ID>, 5.21619288 SOL reclaimed
Required, but never shown