Harmony
Support Forum
Github
Telegram
Discord
Search…
Welcome
🎶
General
Introduction
Technology
Bridges
DApps
Wallets
Ecosystem
DAOs
Community
🏗️ Developers
Getting Started
Network & Faucets
Deploying on Harmony
Harmony Stack and Projects
List of Deployed Contracts
List of RPC Providers
SDK
API
Wallets
Tools
Harmony VRF
Bridges
The Graph
Remix IDE
Ganache
Harmony Ganache
Harmony-React
Oracles
Covalent
Smart Contract Verification
DaVinci SDK
DApp Examples
Hackathon & Bounties
Tutorials
🌏
Network
Governance
Validators
Delegators
Powered By
GitBook
Ganache
This page describes how to use ganache-cli to connect to Harmony networks.
Install Ganache CLI
1
npm install -g ganache-cli
Copied!
Load Harmony networks (local, testnet, mainnet) to ganache-cli. The command below loads
1
ganache-cli -f http://localhost:9500 --networkId 1666700000
2
or for testnet
3
ganache-cli -f https://api.s0.b.hmny.io --networkId 1666700000
4
or for mainnet
5
ganache-cli -f https://api.s0.t.hmny.io --networkId 1666600000
Copied!
Use web3.js to interact with the ganache binded harmony network
1
const web3 = new Web3("http://127.0.0.1:8545");
2
web3.eth.getBlockNumber().then(console.log)
Copied!
Previous
Remix IDE
Next
Harmony Ganache
Last modified
8mo ago
Export as PDF
Copy link