- Go to https://infura.io/ and make an account
- Paste the kovan project ID into your .env as the value for
INFURA_PROJECT_IDkey - Generate a 12 word mnemonic seed phrase (can use ganache to get one or ask project admin for current seed used for remote envs)
- Paste 12 word mnemonic seed phrase as value for
MNEMONIC_SEEDkey - Go to https://alchemyapi.io/ and setup an account then take the api key for the relevant network (like mainnet, kovan or ropsten) or ask the team for an existing API key and paste under
ALCHEMY_KEY
- Be sure to have metamask plugin installed in your browser (recommended browser is Chrome)
- Login to Metamask and point the network to localhost and port 8545 before starting the frontend app
- Run
git clone https://bitbucket.org/bigmochi/dapp-boilerplate && cd dapp-boilerplate - run
npm ito install backend dependencies (or just runnpm startto skip steps 3,4,5 and 8) - Run
npm run compileto generate typchain typings (skip if you rannpm startat #2) - run
npm testto run contract test suite to run smart contract test cases (skip if you rannpm startat #2) - run
npm run nodeto start the hardhat evm chain (skip if you rannpm startat #2) - on another terminal, run
npm run deploy:localto compile and deploy locally (deploy script copies the contract artifact & typechain to frontend) - cd to frontend
cd frontend - run
npm ito install frontend dependencies (skip if you rannpm startat #2) - run
npm startto serve the app locally - React app should print the token contract name, total supply, current network (unknown if local) and contract address.
- Install all dependencies
- Deployed a local ethereum network with HardHat Nework
- Compliled and deployed smart contract to the blockchain
- Contract artifact and typechain is auto generated in the front end folder
- Terminal 1 - React Front End for the dapp

- Terminal 2 - For local development: Hardhat network / Ganache depoloyed in port 8545, debugging in the blockchain
- Terminal 3 (Optional) - Use to deploy new version of the smart contract in the blockchain after configuring it

- Deploy a local ethereum network with hardhat network or ganache / determine test network to test
- Metamask set to the network you are developing to (localhost:8545 for local, testnet of choice)
- Run a local react server
- Contract and other dependencies are in the same folder
- Ensure you have added the following env variables: INFURA_PROJECT_ID and MNEMONIC SEED
- Make sure the account in your mnemonic seed has enough balance to deploy the contract
- Run
npm testto ensure all tests are passing - If tests are passing, deploy the code by running
npm run deploy:kovan - The token address should be shown in the console.
- Run your dApp:
cd frontend && npm run start - Change your metamask network to Kovan
- The token details, network name (Kovan in this case) and contract address should be displayed in the UI
- Do updates in the smart contract solidity code in the contracts folder located in root
- Add tests in the test folder when necessary
- Run
npm test - If tests are passing, deploy the code by running
npm run deploy:local - If successful, the front end dApp should reload and smart contract changes can be read/utilized by the dApp.
- Do updates in the smart contract solidity code in the contracts folder located in root
- Add tests in the test folder when necessary
- Run
npm test - If tests are passing, deploy the code by running
npm run deploy:kovan - If successful, the front end dApp should reload and smart contract changes can be read/utilized by the dApp.
HardHat Documentation - Hardhat tutorials, config, network, and plugin references scaffold-eth speeeeedrun - Similar workflow we can use in working with this boilerplate. Our boilerplate seemed to be an improved typescript version of this stack.
- Error: Cannot use JSX unless the '--jsx' flag is provided
- Follow: https://vscode.readthedocs.io/en/latest/languages/typescript/#using-the-workspace-version-of-typescript - "Using the workspace version of TypeScript" section
- Warning: Calling an account which is not a contract
- Compile and deploy your contract first. Run
npm run deploy:localfor local deployments.
- If you get
ProviderError: Must be authenticated!or https://hardhat.org/errors/#HH604 then make sure you've entered a key and value in.envforALCHEMY_KEY