Giter Club home page Giter Club logo

hedera-hardhat-example-project's Introduction

Hedera Hardhat Example Project

The Hedera Hardhat Example Project demonstrates how to test and deploy a Hedera smart contract using a community instance of the Hedera JSON RPC Relay. For more information about Hardhat projects check out their docs here.

๐Ÿ”ฅ Check out the step-by-step tutorial here.

Project Files and Folders

  • hardhat.config - The Hardhat project configuration file reqiured for the project. This includes the Hedera testnet account private key, community JSON-RPC relay URL, and defines the Hardhat tasks.

  • /contracts - The folder that contains the Greeter smart contract.

  • /test - The folder that contains the test file that tests the Greeter.sol smart contract.

  • /scripts - The folder that contains the Hardhat project scripts.

  • .env - The file that stores the environment variables like the testnet account private key and community JSON-RPC url

Setup

  1. Clone this repo to your local machine:
git clone https://github.com/hashgraph/hedera-hardhat-example-project.git
  1. Once you've cloned the repository, open your IDE terminal and navigate to the root directory of the project.
cd hedera-hardhat-example-project
  1. Once you've cloned the repository, open your IDE terminal and navigate to the root directory of the project. Run the following command to install all the necessary dependencies:
npm install
  1. Install the dotenv package used to manage environment variables in a separate .env file, which is loaded at runtime
npm install dotenv
  1. Get your Hedera testnet account hex encoded private key from the Hedera Developer Portal and update the .env.example TESTNET_OPERATOR_PRIVATE_KEY

  2. Rename .env.example to .env

  3. Run the test script from the root directory of the project. The default network is set to "testnet."

npx hardhat test
  1. Deploy the smart contract
npx hardhat deploy-contract

Contributing

Contributions are welcome. Please see the contributing guide to see how you can get involved.

Code of Conduct

This project is governed by the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

License

Apache License 2.0

hedera-hardhat-example-project's People

Contributors

simihunjan avatar theekrystallee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.