This repository contains the Mount Carlo project.
Once installed, run Hardhat's testing network:
npx hardhat nodeThen, on a new terminal, go to the repository's root folder and run this to deploy your contract:
npx hardhat run scripts/deploy.js --network localhostFinally, we can run the frontend with:
cd client
npm install
npm startUse the faucet to send yourself some test eth:
npx hardhat --network localhost faucet <address here>You can also interact with the contract in the console (https://docs.openzeppelin.com/learn/deploying-and-interacting)
$ npx hardhat console --network localhost
> const MountC = await ethers.getContractFactory("MountCarlo")
> undefined
>
> const mc = await MountC.attach("<address>")
> undefined
>
> await box.retrieve()
> BigNumber { _hex: '0x2a', _isBigNumber: true }
Note: There's an issue in
ganache-corethat can make thenpm installstep fail.If you see
npm ERR! code ENOLOCAL, try runningnpm ciinstead ofnpm install.
Open http://localhost:3000/ to see the Dapp. You will
need to have Metamask installed and listening to localhost 8545.
Powered by Hardhat and React.
- Hardhat: An Ethereum development task runner and testing network.
- Mocha: A JavaScript test runner.
- Chai: A JavaScript assertion library.
- ethers.js: A JavaScript library for interacting with Ethereum.
- Waffle: To have Ethereum-specific Chai assertions/mathers.
Invalid nonceerrors: if you are seeing this error on thenpx hardhat nodeconsole, try resetting your Metamask account. This will reset the account's transaction history and also the nonce. Open Metamask, click on your account followed bySettings > Advanced > Reset Account.