3

I just created an Anchor project with anchor init and tried to run anchor test but it didn't work. I always get the error:

Unable to get latest blockhash. Test validator does not look started. Check .anchor/test-ledger/test-ledger-log.txt for errors. Consider increasing [test.startup_wait] in Anchor.toml.

If I try using solana-test-validator I get the error Error: failed to start validator: Failed to create ledger at test-ledger: blockstore error

I increased the startup_wait value in Anchor.toml file but it didn't work as well:

[test]
startup_wait = 100000

My log file shows the following:

INFO [0m solana_test_validator[0m[38;5;8m][0m solana-validator 1.15.2 (src:94dd3726; feat:1211687720, client:SolanaLabs)
INFO [0m solana_test_validator[0m[38;5;8m][0m Starting validator with: ArgsOs {
        inner: [
            "solana-test-validator",
        ],
    }
WARN [0m solana_perf[0m[38;5;8m][0m CUDA is disabled
INFO [0m solana_perf[0m[38;5;8m][0m AVX detected
INFO [0m solana_perf[0m[38;5;8m][0m AVX2 detected
INFO [0m solana_faucet::faucet[0m[38;5;8m][0m Faucet started. Listening on: 0.0.0.0:9900
INFO [0m solana_faucet::faucet[0m[38;5;8m][0m Faucet account address: GbS4pJsmhizfuvYJhm8sMSQ3xRHDHbUWCTNkkXygVC1Q
INFO [0m solana_ledger::blockstore[0m[38;5;8m][0m Maximum open file descriptors: 1000000
INFO [0m solana_ledger::blockstore[0m[38;5;8m][0m Opening database at "test-ledger/rocksdb"
INFO [0m solana_ledger::blockstore[0m[38;5;8m][0m "test-ledger/rocksdb" open took 108ms
INFO [0m solana_metrics::metrics[0m[38;5;8m][0m metrics disabled: SOLANA_METRICS_CONFIG: environment variable not found
INFO [0m solana_metrics::metrics[0m[38;5;8m][0m datapoint: shred_insert_is_full total_time_ms=0i slot=0i last_index=3i num_repaired=0i num_recovered=0i
INFO [0m solana_runtime::hardened_unpack[0m[38;5;8m][0m Extracting "test-ledger/genesis.tar.bz2"...

The versions I'm using are:

anchor-cli 0.26.0
solana-test-validator 1.15.2
rustc 1.67.0

Any suggestion?

1 Answer 1

1

Try this combination:

rustc 1.65.0
solana-cli 1.14.12
anchor-cli 0.26.0

Solana 1.15 doesn't seem to currently work with Anchor 0.26. Was also getting errors when upgrading to Anchor 0.26 and found a working combo by referencing the versions used on Solpg.

2
  • Hi John, I tried, but unfortunately, it didn't work as well. Still stuck on this. :-(
    – Lano
    Feb 17, 2023 at 19:26
  • This is correct. There was an issue with the 1.15.2 release, so be sure to re-install the earlier versions until 1.15.3 is released using solana-install init 1.14.12 and also using the 1.14.12 crates
    – Jon C
    Feb 21, 2023 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.