3

Can I start a local test-validator using data from mainnet like downloading FSS and ISS from mainnet node.

2
  • If you know what you need, you can dump them from the mainnet and load them in. Here is how you do it for a program, for example: solana.stackexchange.com/a/626/153
    – sohrab
    Commented Dec 8, 2022 at 13:11
  • what is FSS and ISS? also, do you NEED the entire snapshot? or do you just need a few programs and accounts?
    – nickfrosty
    Commented Jul 19, 2023 at 13:00

1 Answer 1

4

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 accounts from the test network into your localnet. Your localnet programs can then access these accounts.

This is super useful when integrating with other programs like Openbook or Solend because you can avoid having to compile those programs from scratch and deploy them to localnet manually.

[[test.validator.clone]]
address = "SMBH3wF6baUj6JWtzYvqcKuj2XCKWDqQxzspY12xPND"
[[test.validator.clone]]
address = "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"
[[test.validator.clone]]
address = "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"

[test.validator]
url = "https://api.mainnet-beta.solana.com"
1
  • What if I need whole mainnet.
    – d4rkshad0w
    Commented Dec 22, 2022 at 11:42

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.