This question is somewhat similar to this question about configuring for testing but it is for an already live chain.
In this scenario a new pallet will be added to an existing chain's runtime. The storage would need to be pre-filled with values - for example a list of AccountId
s so that when the chain is upgraded the storage will already be populated.
Prior to genesis, this would be carried out by setting the storage:
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub some_accounts: Vec<T::AccountId>,
}
This would then in turn allow you to configure the chain-spec.json
to include a list of those accounts and when the chain launches for the first time it includes this information.
"pallet": {
"someAccounts": [
"5DscB8vToteyG9w3KPpmVti6SrsDttd9MjDFqWA8kGoicPpi",
"5CAmNGhvuFcyL2fUpewQR8PJ3LSmhcarkPntyR77zCGTQoMN",
"5GZ9KwDiFGgnVAVThYpHwtttzKZefxb74TMsc19qrAATU55A",
]
}
However, once the chain has already launched, the chain spec file can no longer be updated without in effect creating a new chain, I think.
If this is the case what is the method for creating a new pallet with pre-filled storage, without changing the original spec file?
Perhaps this is a misunderstand about the spec file, but it would be helpful to clarify this case.