This document details the required environment variables and API keys for BlockDAG development.
The BlockDAG environment requires specific environment variables for deployment and testing. The setup is straightforward and can be done by copying the Environment template and updating the required values.
Copy the environment template file and update only the required values:
# Copy the example file
cp .env.example .env
# Edit the .env file and update your private key
# Change ETH_PK=your_private_key_here to your actual private key
ETH_PK=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdefThese next API key variables are required for contract verification and mainnet contract cloning and hardhat expects to be set, if you are not using some of them, you can set them to placeholder values. Check the Environment example for more information.
- ETHERSCAN_KEY
- SNOWTRACE_KEY
- INFURA_KEY
- ANKR_KEY
- POLYGONSCAN_KEY
- ARBISCAN_KEY
- LINEASCAN_KEY
- OPTIMISMSCAN_KEY
- MANTLESCAN_KEY
- SCROLLSCAN_KEY
- UNICHAIN_QUICKNODE_KEY
If running locally, you can use LOCAL_CHAIN_ID=1337 for hardhat or LOCAL_CHAIN_ID=31337 for anvil
- Local Development - Complete deployment workflow
- Network Configuration - Network-specific settings