Skip to main content
13 votes
Accepted

Why is SOL refunded after a program deploy?

Solana programs can be quite large (often > 400kB) and you cannot upload the whole program in a single transaction since the TX size limit is 1232 bytes (which also must include the pubkeys so ...
kklas's user avatar
  • 156
7 votes
Accepted

Blockhash expired. 5 retries remaining

This is fixed by installing Solana SDK v1.13.3 from Github. I confirmed that v1.10.40 has the problem above. solana-install update does NOT update to a functioning version, you must download the ...
Tristyn's user avatar
  • 86
6 votes

Increase Deployed Program Account Allocation

Now possible! ­čą│ Using Solana CLI (>1.18) you can do: $ solana program extend <PROGRAM_ID> <MORE_BYTES> To allocate more bytes, then try again.
kevinrodriguez-io's user avatar
6 votes
Accepted

Deploying program with Ledger: best way to deploy without having to click 600 times for each tx?

https://docs.solana.com/cli/deploy-a-program#using-an-intermediary-buffer-account Instead of deploying directly to the program account, the program can be written to an intermediary buffer account. ...
Ripleys 0x's user avatar
6 votes
Accepted

Close solana program to get 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.
Henry E's user avatar
  • 3,050
6 votes
Accepted

How do you figure out your current program deployed max size?

Hey you could get the account info from the executable data account and count the As at the end. var programAccount = await Web3.Instance.WalletBase.ActiveRpcClient.GetAccountInfoAsync( ...
Jonas H.'s user avatar
  • 5,727
6 votes
Accepted

How do I get real-time information about newly created tokens on Solana?

Helius will be your friend here. I am not sure how much latency u are looking for. Two approaches: 1 - set up a free webhook on helius, to pipe blocks, and parse block contents. u should also be able ...
bill_papas_12's user avatar
5 votes

Deployment price

Devnet and mainnet have no differences in terms of program deployment costs. Devnet is intended to be functionally equivalent to mainnet, with the exception of airdrop.
HelmetFace's user avatar
  • 1,747
5 votes
Accepted

What is the use case of program's secret key after initial deployment?

The secret key of the program address is only needed for the initial deploy. Once it's deployed (to all networks) there is no need for it. As of now, at least.
kwelliott's user avatar
  • 514
5 votes

What's the difference between the different program loaders?

BPFLoaderUpgradeab1e11111111111111111111111 is the latest version of the loader. As the name implies, it optionally allows upgrading programs. BPFLoader2111111111111111111111111111111111 allows ...
Jacob Creech's user avatar
  • 3,854
5 votes

How do I get real-time information about newly created tokens on Solana?

The most efficient method for receiving real-time updates on account and transaction changes is to operate a read-only validator equipped with a Geyser plugin. This setup allows for direct streaming ...
Kyle Espinola's user avatar
4 votes

Deploying program with Ledger: best way to deploy without having to click 600 times for each tx?

Why don't you use multisig for deploying programs to mainnet? We use Snowflake.so at Solvent Protocol and it works really well. Steps 1-3 are just to be one time when setting things up. For every ...
Dhrumil Mehta's user avatar
4 votes
Accepted

Is there a limit in size to the program (.so) file?

The current account data size limit is 10MB. 681kb is an average program size and there are many programs that are above that. Hard to tell what went wrong without seeing the logs but if the problems ...
acheron's user avatar
  • 2,571
4 votes

is solana program (smart contract) immutable?

Redeploy a program A program can be redeployed to the same address to facilitate rapid development, bug fixes, or upgrades. Matching keypair files are generated once so that redeployments will be to ...
vicyyn's user avatar
  • 4,073
4 votes

Close solana program to get deployment funds back?

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
Jon C's user avatar
  • 15.1k
4 votes
Accepted

Anchor says deployed but can't find it on sol explorer

Are you sure you are deploying the program to the devnet an not in your local validator? can you run the deploy with the provider.cluster flag to be sure?: anchor deploy --provider.cluster devnet
Juan Marchetto's user avatar
4 votes

Problems to deploy program with Anchor 0.28.0 to localnet

So the problem with not being able to build was that my platform tools folder was for some reason linked to an old version in /Users/***/.cache/solana/v1.37 So i deleted all these cached versions and ...
Jonas H.'s user avatar
  • 5,727
3 votes
Accepted

How to safely close program buffers?

To give a quick rundown, a program account is actually just data for a pubkey pointing towards the account that actually contains the program executable data. The program executable data account ...
Jon C's user avatar
  • 15.1k
3 votes
Accepted

Is it possible to deploy a program from a key in a ledger?

The Solana CLI help information lists using a hardware wallet keypair file by setting the keypair file path as usb://ledger Specifically from the solana program deploy --help output: --program-id <...
nickfrosty's user avatar
  • 1,048
3 votes

Deploy regular solana (not anchor) on mainnet

You use cargo build-sbf or cargo build-bpf (depending on you used version) to build your program. That will build a .so file in your target/deploy directory. From there you can use the solana program ...
Buzzec's user avatar
  • 534
3 votes
Accepted

Checking deployed programs causes a timeout error. Sometimes works

This may be a rate limit on the public RPC. https://api.devnet.solana.com/ There are many other commercial RPC provider like for example: Triton, Helius, Quicknode, Hellomoon and many more. Most of ...
Jonas H.'s user avatar
  • 5,727
3 votes
Accepted

How to properly start and shut down a local multi-node network´╝č

It looks like you've understood it correctly. The x passed to validator.sh defines the label on the ledger directory associated with that node, which contains their local view of the network along ...
Jon C's user avatar
  • 15.1k
3 votes
Accepted

Why is the size of my on-chain program almost doubled after deploying?

The solana CLI over allocates the account so you can upgrade your program without having to resize the account. Historically it has been useful since the possibility to resize program accounts is ...
dr497's user avatar
  • 216
3 votes
Accepted

Deploy a program from another program

Since Solana programs are stateless, it's best practice to create PDAs under one program. In your case, it should only require one program. However, if you're dealing with broad functionality (i.e a ...
Joey Meere's user avatar
  • 1,139
2 votes

Is there a way for the contract to test what cluster (mainnet, devnet, testnet) it is on?

You might be able to pre-load an account with configuration data on each of the clusters which just has the name of the cluster in the account data field. Then your program can check that address to ...
Nate's user avatar
  • 411
2 votes

anchor deploy: Invalid Blockhash

Devnet acts that way sometimes. Sometimes there's too many requests and if your network connection isn't fast enough it times out. I just use solana playground to deploy to devnet now. It's more ...
Ademola's user avatar
  • 3,833
2 votes
Accepted

Why can't I close a Solana program, and redeploy to the same program id?

Your understanding is correct, and this is under active discussion in this PR: https://github.com/solana-labs/solana/pull/27460 The implementation they are leaning towards would indeed let you recover ...
master-madman's user avatar
2 votes
Accepted

After deployment of a program can the program_id's private key be made public?

You'd never be able to re-use that keypair on-chain unless you deleted the program account entirely. The only thing I can think of at the moment is if there was some weird peripheral tool that needs ...
HelmetFace's user avatar
  • 1,747
2 votes
Accepted

Error deploying program in localhost network

This error usually comes when the wallet is not owned by System Program. Can you visit Solana Explorer, switch the cluster to the localnet and search for your address? It should look like this: Data ...
0xShuk's user avatar
  • 1,929
2 votes

Error deploying program in localhost network

you probably need to check the workspace configuration, in the Anchor.toml file in the project root, you should have something like: [provider] cluster = "localnet" wallet = "~/.config/...
vanderlinde's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible