Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 11, 2022 11:08 pm GMT

Setup your env to start working w/ the blockchain

  1. First you'll need to get node/npm. If you don't have it click here.
    Warning: Recommend you install at least node v15.

  2. Now go to the terminal and type the following commands:
    Warning: Do not use the GitBash terminal
    mkdir my-first-smart-contract
    cd my-first-smart-contract
    npm init -y
    npm install --save-dev hardhat

  3. Now let's install the Hardhat with the command:
    npx hardhat
    Warning: In case od error, use this command: yarn add hardhat

  4. Choose the option create a sample project and agree with all the questions.

  5. The sample project will ask you to install hardhat-waffle and hardhat-ethers. Install the dependencies with the command:
    npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers

  6. After that, you will run the command: npx hardhat accounts and it should print a lot of addresses like this:
    0xa0Ee7A142d267C1f36714E4a8F75612F20a79720
    These are addresses that Hardhat generates to simulate users on the Blockchain.

  7. After that we will see if everything is working, run the command:
    npx hardhat compile
    Then this command:
    npx hardhat test

  8. Once this is done, you will see something like this:
    Image description

That's it, your project is configured to create Smart Contracts with Ethereum!


Original Link: https://dev.to/gj_developer/configuring-your-machine-to-work-with-ethereum-smart-contracts-1h04

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To