Initialising the Project
Setting Up Foundry
Welcome to the world of Ethereum application development with Foundry! Foundry is a powerful, lightning-fast EVM Development toolkit written in Rust. Follow these steps to get started:
Open your terminal and execute the following command:
curl -L https://foundry.paradigm.xyz | bash
Run
forge --help
in the terminal to verify the installation and you’ll get an output similar to this:
Installing Ganache
Ganache is your go-to tool for launching a personal EVM-powered blockchain on your local system. It’s designed for testing purposes to simulate the Ethereum network environment. Let’s get Ganache up and running:
- Visit the Official Ganache Website and get the installer file.
- Simply run the downloaded file and follow the installation wizard to complete the installation process.
- Just spin up a new Ethereum workspace on your local system using the Quickstart option. This will be used to deploy and test the contracts.
- Ganache will provide you with a set of testing wallets and private keys, running locally on http://127.0.0.1:7545.
Now that your development environment is all set, let’s dive into writing smart contracts and making it go cross-chain.
Now, get the Private Key of any of the accounts from Ganache and save it as a PATH variable. This will help make our lives easier while deploying the contract.
Into the terminal of the x-mail directory, type
export PRIVATE_KEY='Your Private Key'
Now, you can access your private key from the terminal using the echo command. Just type in
echo $PRIVATE_KEY
and it will display the same key we had copied.