I'm trying to load account using solana-test-validator --account mock.json --ledger test-ledger but the error was

error: Found argument 'test-ledger' which wasn't expected, or isn't valid in this context

What is the required argument for --ledger I was trying to use my local test-validator directory?

Also how can I load a set of accounts?

  • solana-test-validator -h
    – Frank C.
    Nov 27, 2022 at 10:39

1 Answer 1


Indeed, solana-test-validator -h will be the most useful command to figure out why it's not working. Here's the relevant info:

        --account <ADDRESS> <DUMP.JSON>
            Load an account from the provided JSON file (see `solana account --help` on how to dump an account to file).
            Files are searched for relatively to CWD and tests/fixtures. If ADDRESS is omitted via the `-` placeholder,
            the one in the file will be used. If the ledger already exists then this parameter is silently ignored

So you need to do --account <ADDRESS> mock.json or --account - mock.json.

Also, as the help text says: "If the ledger already exists then this parameter is silently ignored", so you may need to reset the ledger with --reset.

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.