DEV Community

Cover image for Setup your env to start working w/ the blockchain
Gustavo Gomes
Gustavo Gomes

Posted on

3

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! πŸŽ‰πŸŽ‰

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (1)

Collapse
 
yanyoshino profile image
YanYoshino β€’

Muito bom, objetivo e simples, fera!

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE