Let's imagine a scenario where a team is running a substrate private network and have all their chainstate that they want to move to a parachain after acquiring a slot. My question is, when the team moves all their runtime logic into a cumulus template and starts the process for becoming a parachain, is it possible to bring this solo chainstate from the old chain to the parachain? In other words, is it possible to start a parachain with block N >> 0 ?
Yes, it is possible.
Have a look at this previous question: how we can migrate the solochain data to the parachain?
Also, have a look at this video: Sub0 Online: Storage Migration - Standalone chain to Parachain
I have also asked a similar question How to get all the blocks when forking the chain?, where
block N >> 0 still waiting for an answer. In the meantime I can share my findings, there are different ways to persist the current state of the chain while converting solochain to a parachain but all of them start from
block 0, one way is already mentioned by Rodrigo that is storage migration and other are as follows:
- You can use fork-off-substrate to persist the current state of your chain but I am not sure if it can convert solochain to parachain.
- Other is subalfred, this I have tried and was able to convert solochian to relay-chain and vice versa with its old state being persist and I hope it will work for solochain to parachain also but it will start from
block 0. To convert the chain you need to use
overridecommand of subalfred.