# Development Cycle

Here's what you have to do when you make code changes in various parts of the system, including your contract code, so that the Agoric system reflects your changes.

Different changes have different impacts. The table below is ordered so that your changes with the most impact are at the top in the first row. To use the table, go down the first column until you see a type of change you made.

Then go to that row's second column and do the action specified there. You then need to go down the second column and do every action specified in the second column down to and including the last row's second column. In other words, if you do the action in row 3's second column, you must also do the action in row 4's second column, then row 5's second column, and so on until the bottom row.

You don’t have to do any of the second column actions in rows above where you started.

How to use this table:

  1. Go down the first column until you encounter the type of change you made.
  2. Go to that row’s second column and do the action specified there (if you want to know more about what and why you’re doing, see the row’s third column).
  3. Go down to the next row and do the action in its second column.
  4. Repeat 3. until you reach the bottom of the table and do the action in the bottom row’s second column.
For example, let’s say you changed code in agoric-sdk. Going down the first column, you find it and look at the action in the second column of that row. It says you need to run agoric start --reset. Then go to the next row and its second column to find out you need to run agoric deploy contract/deploy.js Continue doing the action specified in each following row’s second column until the “refresh your browser” instruction in the bottom row.
If you... Then you must... Notes
Change which npm packages are used in agoric-sdk In your agoric-sdk directory, run yarn install Updates the node_modules to match the current package declarations.
Change packages in the packages/ directory. For example, SwingSet, eventual-send, default-evaluate-options, captp, or evaluate In your agoric-sdk directory, run yarn build Rebuilds the SDK generated files.
This second column action needs to be done for any changes listed above this row, but doesn’t need to be done for changes listed below this row. Run agoric install Copies the new agoric-sdk/node_modules into the Dapp.
Change code in agoric-sdk 1. Kill the current agoric instance.

2. Run agoric start --reset
When you change Agoric SDK code, you must restart your Agoric instance to use the revised version.
Change your contract definition. Run agoric deploy contract/deploy.js Pushes the new contract to the chain.
Change the code in your contract’s `api` directory. It contains the cloud service part of your app, which talks to the contract on chain. Run agoric deploy api/deploy.js Pushes the API handler to your local Agoric VM, ag-solo
Change your UI code Code changes may be automatically picked up and reflected in the display. If not, refresh the browser. When you save your changes, the ReactJS dev proxy automatically updates, but sometimes it gets confused.