Time to read: 1 min
Configure Hardhat for Rootstock
Prerequisites
- Rootstock-compatible accounts/address.
- You can use existing accounts or create new ones. See Account Based Addresses.
- Wallet
- Set up a Metamask wallet and get a private key.
Getting Started
Step 1: Set up Your Hardhat Environment
- Install dotenv
To manage environment variables, install
dotenvusing the following command:
npm install dotenv
- Create a
.envfile- In the
rootstock-quick-start-guideproject root, create a.envfile and add your private keys (do not share this file):
- In the
ROOTSTOCK_MAINNET_PRIVATE_KEY="your_mainnet_private_key"
ROOTSTOCK_TESTNET_PRIVATE_KEY="your_testnet_private_key"
Note
Depending on your desired network, using a Testnet and Mainnet private key is optional, as you're not required to have separate private keys in your environment variable.