npm install
npm run build
npm run compile
In order to run tasks, complete the following steps:
./start.sh
This will run the localhost hardhat node and deploy your contracts to it.- Open a new terminal,
npx hardhat --network localhost [your-task-here]
npx hardhat node
npm run test
In one terminal run npm
Then in another run npm run test -- --network localhost
Notes:
- When running with this
localhost
option, you get a gas report but may not get good callstacks - See here for how to configure the gas usage report.
npm run coverage
Notes:
- running a coverage report currently deletes artifacts, so after each coverage run you will then need to run
npx hardhat clean
followed bynpm run build
before re-running tests
Create/modify network config in hardhat.config.ts
and add API key and private key, then run:
npx hardhat run --network rinkeby scripts/deploy.ts
Right click on the dockerfile and click "build image", tag the image (ex) - "zaphardhatdevelop:latest"
Run docker run -td zaphardhatdevelop
, the command npx hardhat node
will run automatically
To Deploy to localhost,
Run docker build -t zaphardhat:branchname .
-Open Docker Desktop, click the cli button marked with ">-"
Run npx hardhat run --network localhost scripts/deploy.ts