Skip to content
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

Implement workspace feature to compile, build and deploy multiple contracts #157

Open
dhruvja opened this issue Mar 3, 2024 · 4 comments

Comments

@dhruvja
Copy link

dhruvja commented Mar 3, 2024

Description
For building multiple contracts, we need to write a script to build multiple programs and maintain a file to manually maintain contract address of each program.

Solution
We could have a config file for concordium in the root level with the workspace members and also storing the contract address of the deployed programs in the file. The config file can be thought as an extension of the workspace feature of cargo which can be utilized in building and deploying multiple contracts.

The config file and workspace is heavily inspired by the Anchor framework from solana.
Example:
https://github.com/coral-xyz/anchor/blob/2f552a17f5e4cb0f5b075240c2645b6485e59752/docs/src/pages/docs/manifest.md?plain=1#L4

@abizjak
Copy link
Contributor

abizjak commented Mar 3, 2024

Hi @dhruvja and thank you for the input.

I am not really sure what you are suggesting here. I don't think an SDK is the place for such configuration files, these would typically be for configuring a tool such as cargo-concordium.

At present cargo-concordium does not have any deployment features, but that has been discussed in the past and would make sense, but has never been a high priority.

With regards to building multiple contracts in a workspace automatically, or a subset of the workspace, that makes sense as well.

Maybe you can elaborate on what workflow you would ideally want, so we can best see which components and features best support it.

@dhruvja
Copy link
Author

dhruvja commented Mar 3, 2024

Yes sorry, i meant it for the cli app anyways. But i was wondering if we can have a manifest which can manage the programs in the workspace.
Ideally this is what i would like.

  • Build all the programs in the workspace
  • Deploy all the programs
  • Init the program and store the contract address in the manifest file. There can be an option to initialize a single program or multiple. Similar can be done while deploying or building.

@abizjak
Copy link
Contributor

abizjak commented Mar 4, 2024

I think this generally makes sense, however this is a major new addition to cargo-concordium that overlaps a bit in features with some things we already have solved with deploy scripts.

So we need some thinking about the best design for this, also taking into account the testing library and cargo concordium test which would ideally be aware of this.

I think it's good input.

FYI I'm transferring the issue to concordium-smart-contract-tools repository since that is more appropriate for it.

@abizjak abizjak transferred this issue from Concordium/concordium-rust-sdk Mar 4, 2024
@target-san
Copy link

Second on this issue. It's a bit annoying that verified contract must be completely isolated to build. You can't reference other contracts from workspace or even just put it into workspace for shared dependencies versioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants