👷React/Hardhat env Set-up

How to quickly launch React/hardhat Config

#React #hardhat #waffle #ethers.js #Yarn

Tools

Waffle - is a library for writing and testing smart contracts. Sweeter, simpler and faster than Truffle. Works with ethers-js.

Chai - Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.

ethers.js - The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. It was originally designed for use with ethers.io and has since expanded into a more general-purpose library.

Hardhat - Hardhat is an Ethereum development environment for professionals. It facilitates performing frequent tasks, such as running tests, automatically checking code for mistakes or interacting with a smart contract. ... Developed by Nomic Labs and funded by an Ethereum Foundation grant.

Yarn - Yarn is a new package manager that replaces the existing workflow for the npm client or other package managers while remaining compatible with the npm registry. It has the same feature set as existing workflows while operating faster, more securely, and more reliably


⚠️ WARNING : DO NOT INSTALL DEPENDENCIES ON GLOBAL TERMINAL OR COMMAND LINE, install dependencies on a local environment. mkdir _namecd _name → run the rest of the test's.

Troubleshoot pictures

Begin project

0. in order to make this work, you will need to download yarn globally to run your dependencies. Download and install node package manager to get yarn: npm install --global yarn,

  1. Once installed, you will want to start your new react project. RUn the following command, and lowercase the _name of your project ; npx create-react-app _name and then confirm with (y).

2. then jump into your newly created directory using the list of functions react provides for you above. cd react-dapp and grab the ls of the packages inside.

3. Then you will need to install your all of your dependencies. This includes Hardhat, which will quickly create your dependencies. to do so, run this command locally in your projects directory → yarn add ethers hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers : this will add the latest testing packages into your project like waffle, chai and ethers to work with hardhat.

4. Start Hardhat

  • Run npm init and fill in any of the details you believe to be nessesary. Then, install hardhat npm install --save-dev hardhat.

  • now that har hat is initiated, run to create your contract samples and configuration files.npx hardhat

💡 In my experience.. Going from the terminal / command line → over to the Code editor and using random virtual packages like hardhat or any of these technologies, will help build your projects. You can always make code that will run a few packages, but the hardest part about coding is making sure that all the different packages and downloads and languages you use work together. Once you know what you're using and development does seem so scary anymore.. you will start to realize that the person who built it already made a best attempt to make it easier for you to develop. Once you get over the hurdle of deploying your environment, you have to know a little code as you already do, and you need the patients to solve problems on your own. How? You ask people, you team up with others to solve problems. You ask for help!!

Last updated