Closed jonathanudd closed 9 months ago
I agree with you about the resource feature. I have never seen a good use-case for it. Would be interesting to see that. Maybe @erik78se knows what the benefits could be?
I think it's good to move the spec-file thing to config. The requirement for --chain
should also be removed then, if spec-file is set in config. It will be nice to get rid of the made-up names for the --chain
arg.
I agree with you about the resource feature. I have never seen a good use-case for it. Would be interesting to see that. Maybe @erik78se knows what the benefits could be? I think it's good to move the spec-file thing to config. The requirement for
--chain
should also be removed then, if spec-file is set in config. It will be nice to get rid of the made-up names for the--chain
arg.
Use-case for resources could of course be when it's not possible to get it or put it online somewhere. Offline deployments... But yeah, not really relevant in this case.
Do you guys want to have a workshop or meeting to discuss how we want to handle spec files in the Polkadot charm?
We could, or we could also just discuss it here.
I also agree with the resource commentary above, I think I wrote it in some other PR/thread also. Not seeing the benefits. I'm also for moving specfile URL:s to a config over having them hard coded. Though we should make sure we cover the case where a spec file is needed for both relay and para on the same node, because some have that requirement if I'm not mistaken?
Offline deployments...
What's beyond web3? The offline blockchain :D
I was also thinking that it should support chain spec for relay. It's not common but it exist.
Supporting that and remove the need for --chain
when using it, and let's merge!
Any other opinions about the code @Maharacha @jakobilobi ? If so I could fix any issues when adding support for relay chain spec files. I will probably do it tomorrow.
I made some additions. Not sure if it's optimal but it works. I will do some additional tests as well.
remove the need for --chain when using it
The chain argument is still needed in the cases of downloading binaries from docker. Should we remove the requirement anyway?
Leave it as it is for now. We can get rid of it when we get rid of the docker extract.
I have tested this with only parachain, only relaychain, only live network, parachain and local relay. Setting the configs during deploy, after deploy and un-setting the config for the scenarios above. Also tested for chains which have hard coded overrides where the config overrides the hardcoded value.
I noticed one thing that I wont address in this PR. The ServiceArgs class is used throughout the charm in almost all hooks and actions and since we download the chain spec files when this class is used the spec files will be downloaded every time it is used. This means that the spec files will be downloaded and replaced every time the status hook runs.
This is of course not optimal but seem to not cause any issues either most of the time.
I began implementing a resource for this but I still don't see how a resource is superior to a config in this case. To me it feels like unnecessary work to download spec files and upload them as resources to charmhub instead of just setting the url in the config. If we want to keep one spec file per chain we would also need one resource file entry in the metadata.yml file if I'm not missing something.
The main benefit I see with resources is that when you need to make changes in a spec file it would be more convenient to download it, make the change and attach it as a resource to the application in the model. I needed this for Subsocial so with the code in this PR I downloaded the file modified it and uploaded it on nextcloud to use as url to the config.
Do you guys want to have a workshop or meeting to discuss how we want to handle spec files in the Polkadot charm? I see three options
I will deploy a Subsocial node with a locally built charm based on this code for now to get a node running even if we don't merge this in the end.