diff --git a/Readme.md b/Readme.md index afcdce9..464222b 100644 --- a/Readme.md +++ b/Readme.md @@ -43,6 +43,43 @@ To reuse a previously deployed `Token` contract, define the environment variable The deployment script will use `contractAt` from Hardhat Ignition to retrieve the existing contract instead of deploying a new one. +Deployment +---------- + +To deploy the marketplace you need to define `HARDHAT_NETWORK`: + +```bash +HARDHAT_NETWORK=localhost npm run deploy +``` + +Or you can you `npx` directly: + +```bash +npx hardhat ignition deploy ignition/modules/marketplace.js --network localhost +``` + +Hardhat uses [reconciliation](https://hardhat.org/ignition/docs/advanced/reconciliation) to recover +from errors or resume a previous deployment. +In our case, we will likely redeploy a new contract every time, so we will need to +[clear the previous deployment](https://hardhat.org/ignition/docs/guides/modifications#clearing-an-existing-deployment-with-reset): + +```bash +HARDHAT_NETWORK=localhost npm run deploy-reset +``` + +Or you can you `npx` directly: + +```bash +npx hardhat ignition deploy ignition/modules/marketplace.js --network localhost --reset +``` + +To reuse a previously deployed `Token` contract, define the environment variable `TOKEN_ADDRESS`. +The deployment script will use `contractAt` from Hardhat Ignition to retrieve the existing contract +instead of deploying a new one. + +The deployment files are kept under version control [as recommended by Hardhat](https://hardhat.org/ignition/docs/advanced/versioning), +except the build files, which are 18 MB. + Running the prover ------------------