Prerequisites
Before installing the Mega CLI, ensure you have:- Node.js (v16 or higher)
- npm, yarn, or pnpm package manager
- Git (required for project initialization)
Installing the CLI
You can install the Mega CLI globally using your preferred package manager:
Setting Up Foundry
Mega CLI necessarily requires Foundry for 3 of its 10 commands. The remaining 7 will work just fine without it. Foundry is a blazing fast, portable and modular toolkit for Ethereum application development. You can easily install it using the built-in setup command:- Check if Foundry is already installed
- On Linux/macOS: Automatically install Foundry
- On Windows: Guide you through the manual installation process
Manual Foundry Installation
If you prefer to install Foundry manually:Recommended: Setting Up a Local Account
For the optimal experience with MegaETH CLI, it’s recommended to set up a local account:- You’ll be prompted to enter a name for your wallet (e.g., “dev”)
- You’ll need to set a password to encrypt your wallet
- The account will be stored in your local keystore
--account
flag.