Skip to main content
26 votes
Accepted

'blockstore error' when starting solana-test-validator on MacOS 13.0.1

it seems like something is not right with the tar version in Mac OS 13. I could fix the issue by replacing tar with a homebrew gnu version: brew install gnu-tar # Put this in ~/.zshrc export PATH=&...
rado0x54's user avatar
  • 286
7 votes

How can I tell securely which cluster I am connected to?

You can request the genesis hash with getGenesisHash method from the rpc endpoint and compare it to the ones below to get the cluster. Devnet: EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG Testnet: ...
acheron's user avatar
  • 2,571
5 votes
Accepted

Transactions disappearing from local validator rpc

I'm not sure about anchor test specfically, but solana-test-validator (which it probably wraps?) has a very low default --limit-ledger-size value to prevent consuming excess disk space. Assuming ...
trent.sol's user avatar
  • 4,415
5 votes

How to fix solana-test-validator Illegal instruction (core dumped) error even after building from source?

If you already tried all this and still getting Illegal instruction error, you probably need to change some compilation variables. In my case, the problem was the old CPU (older than 2013) and fixed ...
nicoeft's user avatar
  • 141
4 votes

How can I start local validator using mainnet snapshot

Yes! If you're using Anchor, you add pubkeys to your Anchor.toml file as shown in the example below. When running anchor localnet, Anchor will automatically copy the byte arrays of the specified ...
Nick Garfield's user avatar
4 votes
Accepted

How to read the contents of Anchor's test-ledger directory

Before exiting, anchor test will write log files out to .anchor/program-logs. These log files will contain the transaction logs for every transaction executed during the previous test run, but only ...
HelmetFace's user avatar
  • 1,747
4 votes
Accepted

What is the recommended way to provision an instance of solana-test-validator with a set of accounts and mints?

You can load program and account fixtures into the validator using these command line arguments. --bpf-program Use this to load a .so file as the validator starts up. solana-test-validator --bpf-...
steveluscher's user avatar
  • 2,415
3 votes

solana-test-validator: illegal hardware instruction

You'll need to build the whole thing yourself if you don't want to use Rosetta. Thankfully, this is pretty easy! With Rust installed, just run: git clone --depth 1 --branch v1.14.3 https://github....
Jon C's user avatar
  • 15.1k
3 votes

Error: Your configured rpc port: 8899 is already in use

If you're running anchor test and you have a local validator already running, you can use the following command to skip the validator startup: anchor test --skip-local-validator Otherwise you can kill ...
Jacob Creech's user avatar
  • 3,854
3 votes
Accepted

Does testing through ProgramTestContext have any disadvantage over `solana-test-validator`?

solana-program-test uses the same runtime as solana-test-validator, with a few differences: solana-program-test gives you a BanksClient rather than an RpcClient, which has a bit less functionality ...
Jon C's user avatar
  • 15.1k
3 votes

How can I tell securely which cluster I am connected to?

In general, I'd agree with the other poster that getGenesisHash is the way to go as those hashes do not / will not change for each cluster. From a first sight, shredVersion seems to provide unique ...
steviez's user avatar
  • 576
3 votes

How can an account ever allocate 10mb if the heap size is only 32kb?

Simple answer: accounts are not allocated on the heap, but rather passed in as bytes directly to the instruction, in a separate area of memory. If you use borsh to deserialize your type from the ...
Jon C's user avatar
  • 15.1k
3 votes
Accepted

test validator failed to start: blockstore error (on ubuntu)

I solved it! The thing that did it was to install the bzip2 package in ubuntu. The solana validator uses it for compression some of the ledger data. sudo apt install bzip2 Note: Many other people ...
nickfrosty's user avatar
  • 1,048
3 votes
Accepted

Automatically include my Solana program in local validator?

Example scenario: Say you wanted to load the spl stake-pool program and you had its shared-object file saved at fixtures/spl-stake-pool.so. If you're running tests with anchor then adding: [[test....
Ademola's user avatar
  • 3,833
3 votes
Accepted

How do I get a local debugger in a running `solana-test-validator`

I was able to do this in VSCode by following the documentation here: https://code.visualstudio.com/docs/languages/rust#_installation You need the rust-analyzer extension installed in VSCode. You'll ...
Callum M's user avatar
  • 3,060
3 votes

'Archive error: extra entry found' on solana-test-validator

Sounds like you might just need to delete the ledger directory and try again, ie: rm -rf test-ledger solana-test-validator
Jon C's user avatar
  • 15.1k
2 votes

Private Node drops transactions while solana-test-validator does not

After some searching, I think I noticed what went wrong in my case. The problem was that the bootstrap-validator.sh script did not run the cli command solana-validator. Instead, it ran a cargo run -...
al96's user avatar
  • 41
2 votes

how did you resolve installing solana-test-validator on a Mac M1 Max?

Have you looked into these solutions? These might help: solana-test-validator: illegal hardware instruction https://github.com/solana-labs/solana/issues/17406
Abdullah Qureshi's user avatar
2 votes

My local solana test validator is running very slow after upgrading to 1.9.x or 1.10.x. Is there a way to make it fast?

It takes a long time to process, or stalls completely? I was running into errors with transactions stalling indefinitely on my M1. Running solana-test-validator with --no-bpf-jit fixed it.
dotpem's user avatar
  • 21
2 votes

How to measure test coverage for Anchor program?

I think this is the wrong way to think of testing in web3. Most of your important tests will be integration tests with the chain, not unit tests on the protocol side. That is, your Typescript tests ...
Whiteseal's user avatar
  • 3,155
2 votes
Accepted

How a new validator get last state in Solana?

All validators connect to the network through gossip. Each cluster (devnet, testnet, mainnet-beta) has known entrypoints that provide a gateway to participating in the network. New validators are able ...
steviez's user avatar
  • 576
2 votes
Accepted

How can I download a deployable program from mainnet?

You have a few options. If you want to dump the *.so for a particular program, you can do: solana config set -um # be sure you're on mainnet solana program dump ...
Jon C's user avatar
  • 15.1k
2 votes
Accepted

How can I print solana logs with rust?

For logs You can pass the program address as an argument like this solana logs [FLAGS] [OPTIONS] [ADDRESS] which is solana logs --url localhost PROGRAM_ADDRESS For more details, you can refer to this ...
Swaroop Maddu's user avatar
2 votes

Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL failed: incorrect program id for instruction

Update your validator. I wasn't able to reproduce the problem on a fresh test validator using version 1.14.10 of the Solana CLI. Here's the full script that I ran: from solana.keypair import Keypair ...
Jon C's user avatar
  • 15.1k
2 votes
Accepted

Where can I find ic_msg logs?

you can use solana logs --url localhost in another terminal. Or you can also set https://explorer.solana.com/ to http://localhost:8899 and look the the logs there. You can add skipPreflight: true in ...
Jonas H.'s user avatar
  • 5,727
2 votes
Accepted

Solana-Test-Validator not working

After re-downloading WSL, Solana, Rust and everything I found out that in WSL/Linux I need to go to the base root to have it executed. So I hit cd ~ and then solana-test-validatorjust worked. I hope ...
JMV's user avatar
  • 51
2 votes

How can an account ever allocate 10mb if the heap size is only 32kb?

If you use a fixed-length array of Pubkeys instead, and the rest of your struct is POD that supports zero-copy, then you will be able to allocate up to 10MB. AccountLoader can de-serialize these large ...
Whiteseal's user avatar
  • 3,155
2 votes

How to upgrade the solana version?

for for the Solana Labs client, there is new versions released constantly. You can see the current cluster versions like this: for mainnet solana cluster version -um and solana cluster version -ud ...
Jonas H.'s user avatar
  • 5,727
2 votes

Computational Units used by program are variable

Do you have any CPI's in the contract? these tend to contribute heavily to the compute unit. Compute units will change based on the heap/stack allocation of the runtime so if you have conditional ...
Cloakd's user avatar
  • 421
2 votes
Accepted

Computational Units used by program are variable

A big cause of non-deterministic variability in compute units is usually the find_program_address call. If you randomly generate a keypair in your tests, and then use that keypair as a seed in a PDA ...
kwelliott's user avatar
  • 514

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