- git
- npm
- docker
- node (version 18)
- contributing guide
- Hedera accounts
- prettier pluggin (recommended)
Notes: If your IDE does not support the Prettier plugin, please follow the code formatter guidelines to maintain the consistent code format.
npm install
At root, create a .env
file using the example.env
as the template and fill out the variables.
Variable | Description |
---|---|
OPERATOR_ID_A |
This is the Account ID which can be found in your account portal. |
OPERATOR_KEY_A |
This is the DER Encoded Private Key which can be found in your account portal. |
PRIVATE_KEYS |
This is the HEX Encoded Private Key list which can be found in your account portal. It supports up to six private keys. |
Notes: At least two accounts are required for the HEX_PRIVATE_KEY
fields. See Create Hedera Portal Profile on how to create accounts on Hedera networks. Six accounts will be needed if you want to run the solidity voting example. The local.env file uses ECDSA accounts listed when starting the local node.
Important: While Hedera supports both ECDSA and ED25519 accounts, please use ECDSA since Ethereum only supports ECDSA.
Adjust the defaultNetwork
field in the hardhat.config.js file based on the network your accounts (specified in the .env file) are associated with.
Available Networks:
- local for reference and how to setup a local besu node please follow the link
- testnet
- previewnet
- besu_local for reference and how to setup a local besu node please follow the link
Motivation: This step is necessary for the project as it utilizes the hardhat-foundry
plugin, enabling Hardhat to use dependencies from the ./lib
folder, which are installed using forge
. Consequently, the plugin attempts to execute forge install
to make these dependencies accessible to Hardhat. Therefore, it is crucial to install the forge
testing framework, which is a part of the foundry-rs
toolkit.
Notes: If you already have foundry-rs
and forge
correctly installed locally, you can skip this step.
curl -L https://foundry.paradigm.xyz | bash
foundryup
npx hardhat compile
-
Use the default env variables provided in local.env for your
.env
file. -
Ensure that the
defaultNetwork
in hardhat.config.js is set toNETWORKS.local.name
. -
From the root of your project directory, execute the following command to start up a
Hedera local node
:
npx hedera start -d
Important: Before running the hedera local node
, verify that there are no other instances of Hedera docker containers or json-rpc-relay running in the background, as they might interfere with the functionality of the hedera local node
.
Run below command to execute the tests
npx hardhat test
Note: For more information on testing, follow the instructions in the test guide.
Before committing your new changes, please run command below to format all files:
npx prettier . --write
Notes: This is applicable only in cases where you haven't configured prettier within your IDE.