Time to read: 1 min
Configure Foundry for Rootstock
Environment Configuration
Once you have an account with a private key, create a .env
file in the root of the foundry project and add the variables.
Foundry automatically loads a .env
file present in the project directory.
The .env
file should follow this format:
ROOTSTOCK_RPC_URL=https://rpc.testnet.rootstock.io/{YOUR_APIKEY}
PRIVATE_KEY=0x...
Info
- Your PRIVATE_KEY has to be formatted correctly, so it has to start with
0x
. - To obtain a Rootstock Rpc Url, visit the RPC API DASHBOARD, create an account and get your testnet or mainnet rpc url.
At the root of the project, run:
# To load the variables in the .env file
source .env