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 ?
2 Answers
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 useoverride
command of subalfred.
-
I will look into subalfred and fork-off. I don't think the relay chain will accept a parachain starting from block N >> 0 anyways, but it's still interesting to start from a different state. With the other approach i.e. starting with a genesis state, I am still trying to figure out how exactly to filter the keys in storage as we must remember that a solochain comes with pallets like aura/babe/grandpa which are not needed in a parachain so these keys must be eliminated. That's my theoretical understanding so far. Commented Jul 20, 2023 at 12:25
-
@Purple_Turtle if you are starting from
block 0
than there is no need to care about keys as you can override it withsubalfred
and need to insert them again. Commented Jul 20, 2023 at 13:04