-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import and deploy contracts from remote sources #71
Comments
I think that both example you listed could be implemented as separate loaders.
The URL loader is far simpler than git and would still unblock us in the short term. We can even achieve simple versioning by just specifying the right GitHub URL (e.g. https://github.com/onflow/flow-ft/blob/v0.1.2/src/contracts/FlowToken.cdc). |
I agree. Loaders are a perfect fit. I think files should be loaded locally and then deployed, but if someone finds good reasons to not store them locally we can also avoid that and just deploy it without saving. The other problem I see currently is with resolving imports in cadence files. Of course, a possible solution is to have an URL directly stated at import like
But this solution then still leaves us with the problem of resolving imports in cadence files by the language processor. Another possible solution is to specify in config location for the contract after the download and the location of the remote file:
The above configuration would instruct CLI when running The last solution would also allow us to also add a new command similar to package manager install where you would add contract from a remote location in a separate step something like Tagging @joshuahannan since I believe you are currently most burdened by this problem. |
This would be very nice so that you do not have to have the source code for all contracts locally at all times. Especially when there will be more standard flow contracts available. What about pulling a contract down from testnet and deploying to emulator? |
Good idea. |
That would work really well @sideninja |
Issue To Be Solved
When deploying contracts we currently need to have a copy of that contract locally.
Suggest A Solution
Contract deployment functionality (
project deploy
) allows us to automatically resolve imports from contracts on the fly and replace them with addresses. These imports are currently relative file locations of the contract source code.Besides having a relative file location we should allow importing from remote locations (URLs, github repos...). This files should be pulled on the fly and deployed. Another option is that this would first pull the file and save it locally and then deploy it.
This change should also be supported by the language server so it resolves the files.
The text was updated successfully, but these errors were encountered: