AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
133 stars 80 forks source link

rpc/subcommand to download and cache values for specified key ranges #759

Closed xlc closed 3 months ago

xlc commented 4 months ago

useful to test a big migration touching a lot of keys

in config file, support prefetch-storages

prefetch-stroages:
  - 0x123456 # fetch all storages with this prefix
  - Balances # fetch all storages under Balances pallet
  - System: Account # fetch all storages under System.Account stroage
  - Tokens:
      Accounts: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY] # fetch all storages for Tokens.Accounts(Alice)
  - Tokens.Accounts: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY, { token: DOT }] # fetch this particular storage

It should start the chopsticks instance and fetch the storages at the same time

a new subcommand fetch-storages to only fetch and cache the storages it should accept a list of string arguments, which could be