This repository was archived by the owner on Sep 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
Improve smart contract dev experience #639
Copy link
Copy link
Open
Labels
Description
I'll describe my experience just now:
- I checked out the ag-redux-storage branch in order to test Alex' local-storage work
- It required that I run
yarn install - Then, I needed to re-start the server.
- The
yarn startscript removes the built artifacts. It then compiles the contracts, creating new artifacts, and deploys these artifacts to the ganache network. Compiling the contracts takes about 20-30s for me. - Once I did this, the server and the client are no longer using the same deployed nitro adjudicator. Therefore, I have to remember copy the compiled artifacts from the
walletpackage to theserverpackage. - I then have to re-start the
server
This experience is quite bad! I think that steps 4-6 can be completely removed with something like the following approach:
A1: Create a package in the apps repository. For the sake of this discussion, call it the contracts package.
A2: In the contracts package, create a yarn script called, for the sake of this discussion, nitro:build:dev
cd ${CONTRACTS_DIR}; yarn nitro:build:dev should
- deploy artifacts to ganache according to environment variables defined in
${APPS_ROOT}/.env.development.local. - Add the deployed address to the
networksproperty of the artifact that's stored inbuild/artifacts
A3: Thecontractspackage is responsible for managing pre-built contracts and their deployed addresses on various networks
A4: During development, packages that use a nitro adjudicator do not build the contract, but instead, refer to thecontractspackage to get the built artifacts.
A5: When being built, packages that use the nitro adjudicator use the pre-built contracts from thecontractspackage
This type of approach would eliminate steps 4-6 above.
Reactions are currently unavailable