Can I start a local test-validator using data from mainnet like downloading FSS and ISS from mainnet node.
-
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– sohrabCommented 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?– nickfrostyCommented Jul 19, 2023 at 13:00
1 Answer
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"