Add section in README for deployments

This commit is contained in:
Arnaud 2025-05-23 11:20:54 +02:00
parent 442340a0e5
commit 02a5e032b0
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F

View File

@ -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
------------------