Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: Add solana-test-validator control to Anchor.toml #834

Conversation

tomlinton
Copy link
Contributor

Attempts to allow configuration of solana-test-validator in Anchor.toml. Should support the full range of arguments for it, including the --clone option to clone accounts.

Example Anchor.toml:

[provider]
cluster = "localnet"
wallet = "~/.config/solana/id.json"

[programs.localnet]
basic_1 = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"

[scripts]
test = "mocha -t 1000000 tests"

[test.validator]
ledger = "test-two"
url = "https://api.mainnet-beta.solana.com"
warp_slot = "1"
slots_per_epoch = "33"
faucet_port = 9000

[[test.clone]]
address = "h4yj7esvkiip9tgeqjy9jkvshk98tsaud3lqtowh9tey"

Unfortunately just saw #833 but happy to pull the --clone out of this PR. I didn't intend to tackle that issue here but it ended up getting solved as its one of the solana-test-validator arguments.

Closes #533 and #534.

if Path::new(test_ledger_filename).exists() {
fs::remove_dir_all(test_ledger_filename)?;
}
if Path::new(test_ledger_log_filename).exists() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is removed and not added back, but that's ok since stream_logs removes the directory if it exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable The Ability To Create Mock Localnet Environments Which Mirror Production Deployments
2 participants