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

creating-contract-agnostic-docker --WIP-- #58

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

amessbee
Copy link
Contributor

@amessbee amessbee commented Aug 27, 2024

This is a twin of a PR in dapp-offer-up repo.

Goal of this PR is to (maybe partially) close #92. Currently running of agoriclocal chain and deploying and starting contract are intertwined in this dapp. This is somewhat unnatural as chain should not depend on the files of any specific contract - apart from the ones that designated essential for its running.
Further, running a chain independent of a specific contract will allow testing of multiple dapp simultaneously running and interacting with each other which may unlock several scenarios that a developer may want to test for.

As per discussion with @toliaqat, here is a plan:

  • docker compose file should not mount the contract directory as a volume. Rather it should mount (ideally) a single script (run-chain.sh) that necessary tasks for running of chain independently.
  • run-chain.sh should do just that - run the chain and nothing else!

yarn start:contract should handle most of the heavy work including:

  • setup a dedicated workspace for the contract (dapp-offer-up here)
  • copy tools needed for building, i.e., Makefile
  • copy scripts and tools needed for required for making install-bundle, submit-proposal, vote etc. calls.
  • create contract bundles on host machine, and then copy them to the workspace in docker container.
  • make install-bundle, submit-proposal, vote etc. calls needed to deploy and run the contract using scripts as before.
  • update relevant docs. In particular, add guides to install agoric and agd CLI.

Link to IBIS document.

@amessbee
Copy link
Contributor Author

@mujahidkay @rabi-siddique @frazarshad @usmanmani1122 @Muneeb147 Need your help to review and test the following on your machines and get feedback. Testing two dapps in tandem can be done as below:

  • checkout both this PR and the twin in dapp-offer-up.
  • Do the usual in one of the repo ( yarn install, yarn start:docker, yarn start:contract, yarn start:ui ) make sure everything runs as expect. Do not quite UI.
  • In the second repo, do everything usual but do not run yarn start:docker (it should fail to run if you try it). Everything should run as expected.
  • Once you have both UI's up and running, you should be able to interact with both of them simultaneously and see the effect in the other. For example, you can buy map and scroll in offer-up dapp, and then exchange them for some BLD in SWAP of dapp-agoric-basics. Let me know if you run into any issues.

@amessbee amessbee marked this pull request as ready for review August 30, 2024 15:03
Comment on lines -10 to +11
"docker:bash": "docker compose exec agd bash",
"docker:make": "docker compose exec agd make -C /workspace/contract",
"docker:bash": "docker exec agd bash",
"docker:make": "docker exec agd make -C /ws-agoric-basics/contract",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting approach!

Copy link
Member

@dckc dckc Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea: to manage namespace collisions, use an env variable with a default ${AG_CONTAINER:-agd}

and maybe for ws-agoric-basics

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

Successfully merging this pull request may close these issues.

docker image should be independent of host contract
2 participants