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

Convert Agoric dapp deploy scripts from RESM to NESM #3687

Open
10 tasks
kriskowal opened this issue Aug 14, 2021 · 0 comments
Open
10 tasks

Convert Agoric dapp deploy scripts from RESM to NESM #3687

kriskowal opened this issue Aug 14, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@kriskowal
Copy link
Member

What is the Problem Being Solved?

Currently, agoric deploy runs dapp deploy scripts using standardthings/esm. This is the only remaining vestige of #527, which migrated all Agoric code off of this legacy emulation of ESM. This leaves us in a working state, but with a complication that may perplex ecosystem developers as they encounter differences in how module imports work between normal code and deployment code.

Description of the Design

With #3686, it will be possible to deploy with Node.js ESM (NESM) instead of node -r esm (RESM).

With Agoric/dapp-fungible-faucet#26, it will be possible to use agoric init --dapp-branch nesm to create new dapps based on Node.js ESM. This may eventually become the default, though making it the default now would break deployments of agoric-cli that predate #3686. It may be more convenient in the short term to change the default branch of dapp-fungible-faucet to nesm.

Once #3686 lands though, there will be little reason to continue using RESM for Agoric’s own dapps. This issue tracks the conversion of our existing collection of dapps.

  • dapp-fungible-faucet
  • dapp-card-store
  • dapp-otc
  • dapp-oracle
  • dapp-pegasus
  • dapp-autoswap (errors on sendBroadcast)
  • dapp-simple-exchange (errors on sendBroadcast)
  • dapp-svelte-wallet (in agoric-sdk)
  • dapp-treasury
  • documentation

Security Considerations

Deploy scripts are run without containment and have all of the authority of the user running agoric deploy. This is currently expected and we have not made other designs.

Test Plan

yarn integration-test in agoric-sdk/packages/agoric-cli verifies that dapp-fungible-faucet is a viable template with a working deploy script. Manually changing the default branch to nesm verifies that the Node.js ESM branch is also suitable. Each dapp should have its own integration test that runs a similar workflow.

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

No branches or pull requests

2 participants