Building decentralized applications on Ethereum requires a properly configured development environment. This comprehensive guide walks you through setting up all the essential tools, frameworks, and best practices for Ethereum development.
Prerequisites
Required Knowledge
Before setting up your environment, ensure you have:
Technical Background:
- JavaScript/TypeScript proficiency
- Command line familiarity
- Basic understanding of blockchain concepts
- Programming fundamentals
- Git version control
System Requirements
Hardware and software requirements.
Minimum Specifications:
| Component | Requirement |
|---|---|
| OS | Windows 10+, macOS 10.15+, Linux |
| RAM | 8GB (16GB recommended) |
| Storage | 50GB+ free space |
| Node.js | v16 or higher |
| npm/yarn | Latest stable version |
Installing Core Tools
Node.js and npm
JavaScript runtime for Ethereum development.
Installation:
# Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Restart terminal, then install Node.js
nvm install 18
nvm use 18
# Verify installation
node --version
npm --version
Alternative Package Manager:
# Install Yarn (optional)
npm install -g yarn
# Verify Yarn installation
yarn --version
Git Version Control
Essential for source code management.
Configuration:
# Configure Git
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# Verify configuration
git config --list
Development Frameworks
Hardhat
Modern Ethereum development environment.
Installation:
# Create project directory
mkdir my-ethereum-project
cd my-ethereum-project
# Initialize npm project
npm init -y
# Install Hardhat
npm install --save-dev hardhat
# Initialize Hardhat project
npx hardhat init
Project Structure:
my-ethereum-project/
├── contracts/ # Solidity contracts
│ └── Lock.sol
├── scripts/ # Deployment scripts
│ └── deploy.js
├── test/ # Test files
│ └── Lock.js
├── hardhat.config.js # Hardhat configuration
├── package.json
└── README.md
Configuration:
// hardhat.config.js
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
module.exports = {
solidity: {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
networks: {
hardhat: {
chainId: 31337
},
sepolia: {
url: process.env.SEPOLIA_RPC_URL,
accounts: [process.env.PRIVATE_KEY]
},
mainnet: {
url: process.env.MAINNET_RPC_URL,
accounts: [process.env.PRIVATE_KEY]
}
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY
}
};
Foundry
Fast, portable toolkit for Ethereum development.
Installation:
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
# Restart terminal, then run
foundryup
# Verify installation
forge --version
cast --version
anvil --version
Project Setup:
# Initialize Foundry project
forge init my-foundry-project
cd my-foundry-project
# Project structure
├── src/ # Contract source files
│ └── Counter.sol
├── test/ # Test files
│ └── Counter.t.sol
├── script/ # Scripts
├── lib/ # Dependencies
└── foundry.toml # Configuration
Foundry Configuration:
# foundry.toml
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.20"
optimizer = true
optimizer_runs = 200
[profile.default.rpc_endpoints]
sepolia = "${SEPOLIA_RPC_URL}"
mainnet = "${MAINNET_RPC_URL}"
[etherscan]
sepolia = { key = "${ETHERSCAN_API_KEY}" }
IDE Setup
Visual Studio Code
Recommended editor for Ethereum development.
Essential Extensions:
Recommended Extensions:
├── Solidity (Juan Blanco)
│ └── Syntax highlighting, compilation
├── Hardhat for Visual Studio Code
│ └── Hardhat integration
├── Solidity Visual Developer
│ └── Security insights, diagrams
├── ESLint
│ └── JavaScript linting
├── Prettier
│ └── Code formatting
└── GitLens
└── Git visualization
Workspace Settings:
// .vscode/settings.json
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[solidity]": {
"editor.defaultFormatter": "JuanBlanco.solidity"
},
"solidity.compileUsingRemoteVersion": "v0.8.20",
"solidity.defaultCompiler": "localNodeModule",
"solidity.formatter": "prettier",
"solidity.linter": "solhint"
}
Remix IDE
Browser-based Solidity IDE.
Access:
- Web: https://remix.ethereum.org
- Desktop: Download Remix IDE application
Features:
- No setup required
- Built-in compiler
- Debugger
- Deploy to testnets
- Plugin ecosystem
Local Blockchain
Hardhat Network
Built-in local Ethereum network.
Running Local Node:
# Start Hardhat node
npx hardhat node
# Output shows test accounts with 10000 ETH each
# Network runs on http://127.0.0.1:8545
Using in Scripts:
// Deploy to local network
npx hardhat run scripts/deploy.js --network localhost
Anvil (Foundry)
Fast local Ethereum node.
Running Anvil:
# Start Anvil with default settings
anvil
# Start with specific configuration
anvil --fork-url $MAINNET_RPC_URL --fork-block-number 18000000
# Custom chain ID
anvil --chain-id 1337
Ganache
GUI and CLI for local blockchain.
Installation:
# Install Ganache CLI
npm install -g ganache
# Run Ganache
ganache
# With specific options
ganache --wallet.accounts "0x...private_key,1000000000000000000000"
Wallet Configuration
MetaMask Setup
Browser wallet for development.
Development Configuration:
- Install MetaMask browser extension
- Create or import wallet
- Add custom networks for testing
Adding Local Network:
Network Name: Hardhat Local
RPC URL: http://127.0.0.1:8545
Chain ID: 31337
Currency Symbol: ETH
Import Test Account:
# Hardhat default account (never use in production!)
# Private Key from npx hardhat node output
# Import into MetaMask for testing
Programmatic Wallet
Using ethers.js for wallet operations.
const { ethers } = require("ethers");
// Connect to provider
const provider = new ethers.JsonRpcProvider("http://127.0.0.1:8545");
// Create random wallet
const wallet = ethers.Wallet.createRandom();
console.log("Address:", wallet.address);
console.log("Private Key:", wallet.privateKey);
// Connect wallet to provider
const connectedWallet = wallet.connect(provider);
Test Networks
Sepolia Testnet
Recommended Ethereum testnet.
Configuration:
# Get Sepolia ETH from faucet
# https://sepoliafaucet.com
# https://faucet.sepolia.dev
# Add to hardhat.config.js networks
sepolia: {
url: process.env.SEPOLIA_RPC_URL,
accounts: [process.env.PRIVATE_KEY],
chainId: 11155111
}
RPC Providers
Obtain network access.
Provider Options:
| Provider | Free Tier | Features |
|---|---|---|
| Alchemy | Yes | Analytics, webhooks |
| Infura | Yes | Stable, reliable |
| QuickNode | Yes | Fast, multi-chain |
| Ankr | Yes | Decentralized |
Environment Setup:
# .env file
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY
PRIVATE_KEY=your_private_key_here
ETHERSCAN_API_KEY=your_etherscan_api_key
Smart Contract Development
Writing Contracts
Solidity development workflow.
Example Contract:
// contracts/SimpleStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract SimpleStorage {
uint256 private storedValue;
event ValueChanged(uint256 oldValue, uint256 newValue);
function store(uint256 value) public {
uint256 oldValue = storedValue;
storedValue = value;
emit ValueChanged(oldValue, value);
}
function retrieve() public view returns (uint256) {
return storedValue;
}
}
Compiling Contracts
Build your smart contracts.
Hardhat:
# Compile all contracts
npx hardhat compile
# Clean and compile
npx hardhat clean
npx hardhat compile
Foundry:
# Compile contracts
forge build
# Build with verbose output
forge build --verbose
Testing Contracts
Write comprehensive tests.
Hardhat Tests (JavaScript):
// test/SimpleStorage.test.js
const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("SimpleStorage", function () {
let simpleStorage;
let owner;
beforeEach(async function () {
[owner] = await ethers.getSigners();
const SimpleStorage = await ethers.getContractFactory("SimpleStorage");
simpleStorage = await SimpleStorage.deploy();
});
describe("Deployment", function () {
it("Should start with zero value", async function () {
expect(await simpleStorage.retrieve()).to.equal(0);
});
});
describe("Storage", function () {
it("Should store value correctly", async function () {
await simpleStorage.store(42);
expect(await simpleStorage.retrieve()).to.equal(42);
});
it("Should emit ValueChanged event", async function () {
await expect(simpleStorage.store(100))
.to.emit(simpleStorage, "ValueChanged")
.withArgs(0, 100);
});
});
});
Foundry Tests (Solidity):
// test/SimpleStorage.t.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "forge-std/Test.sol";
import "../src/SimpleStorage.sol";
contract SimpleStorageTest is Test {
SimpleStorage public simpleStorage;
function setUp() public {
simpleStorage = new SimpleStorage();
}
function testInitialValue() public {
assertEq(simpleStorage.retrieve(), 0);
}
function testStore() public {
simpleStorage.store(42);
assertEq(simpleStorage.retrieve(), 42);
}
function testFuzzStore(uint256 value) public {
simpleStorage.store(value);
assertEq(simpleStorage.retrieve(), value);
}
}
Running Tests:
# Hardhat
npx hardhat test
npx hardhat test --grep "Storage"
# Foundry
forge test
forge test -vvv # Verbose output
forge test --match-test testStore
Deployment
Deployment Scripts
Deploy contracts to networks.
Hardhat Deployment:
// scripts/deploy.js
const { ethers } = require("hardhat");
async function main() {
console.log("Deploying SimpleStorage...");
const SimpleStorage = await ethers.getContractFactory("SimpleStorage");
const simpleStorage = await SimpleStorage.deploy();
await simpleStorage.waitForDeployment();
const address = await simpleStorage.getAddress();
console.log("SimpleStorage deployed to:", address);
// Verify on Etherscan (for testnets/mainnet)
if (network.name !== "hardhat") {
console.log("Waiting for block confirmations...");
await simpleStorage.deploymentTransaction().wait(5);
await hre.run("verify:verify", {
address: address,
constructorArguments: [],
});
}
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
Foundry Deployment:
// script/Deploy.s.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "forge-std/Script.sol";
import "../src/SimpleStorage.sol";
contract DeployScript is Script {
function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
SimpleStorage simpleStorage = new SimpleStorage();
console.log("Deployed to:", address(simpleStorage));
vm.stopBroadcast();
}
}
Deploy Commands:
# Hardhat - Deploy to Sepolia
npx hardhat run scripts/deploy.js --network sepolia
# Foundry - Deploy to Sepolia
forge script script/Deploy.s.sol --rpc-url $SEPOLIA_RPC_URL --broadcast --verify
Security Tools
Static Analysis
Analyze code for vulnerabilities.
Slither:
# Install Slither
pip install slither-analyzer
# Run analysis
slither .
# Run with specific detectors
slither . --detect reentrancy-eth
Mythril:
# Install Mythril
pip install mythril
# Analyze contract
myth analyze contracts/SimpleStorage.sol
Linting
Enforce code quality.
Solhint:
# Install Solhint
npm install --save-dev solhint
# Initialize configuration
npx solhint --init
# Run linter
npx solhint 'contracts/**/*.sol'
Best Practices
Environment Security
Protect sensitive information.
Guidelines:
- Never commit private keys
- Use environment variables
- Add .env to .gitignore
- Use different keys for testnet/mainnet
- Rotate keys regularly
.gitignore:
# Environment
.env
.env.local
# Build artifacts
artifacts/
cache/
out/
# Dependencies
node_modules/
# Coverage
coverage/
coverage.json
Development Workflow
Recommended practices.
Development Workflow:
├── Write contract code
├── Compile and fix errors
├── Write comprehensive tests
├── Run security analysis
├── Deploy to local network
├── Test thoroughly
├── Deploy to testnet
├── Verify on block explorer
├── Conduct audit
└── Deploy to mainnet
Working with Innoworks
At Innoworks Software Solutions, we specialize in Ethereum and blockchain development.
Our Blockchain Services
Development:
- Smart contract development
- DApp development
- Blockchain integration
- Security audits
Consulting:
- Architecture design
- Technology selection
- Best practices guidance
- Training
Conclusion
A well-configured Ethereum development environment is essential for building secure, efficient decentralized applications. This guide provides the foundation for professional Ethereum development, from basic tool installation to advanced testing and deployment workflows.
Whether you're building DeFi protocols, NFT platforms, or enterprise blockchain solutions, these tools and practices will help you develop with confidence. Partner with experienced blockchain developers like Innoworks to accelerate your Ethereum development journey.
Ready to start building on Ethereum? Contact Innoworks to discuss how we can help you develop innovative blockchain solutions.



