Connecting using a Web3 Provider actually establishes a connection to a software outside of the browser. Like you'd connect to a database. Or to any other API. It's either a RESTful interface or a WebSocket interface. And behind that interface sits a blockchain. This can be Go-Ethereum, Hyperledger Besu, Nethereum - or - Ganache for Development.
Let's start with Ganache!
Download and Install Ganache¶
Go to https://www.trufflesuite.com/ganache and download Ganache for your Operating System. I am downloading it for Windows for this Lab. But there are also versions for MacOS and Linux. There's a UI Version and also a CLI (Command Line Interface) Version.
Run through the Setup Wizard and install it for your operating system.
If you start ganache, it will ask you if you want to do a quickstart or actually start with a workspace. For now it's safe to say: We do a quickstart.
This will create 10 accounts and assign each 100 ether. The accounts are unlocked. All is ready! 🧑🚀
Ganache is now a Blockchain and a Wallet. Two in one. Anyone can connect to it using a Web3 Provider Method either via http RPC or WebSockets.
Pay attention to the RPC Endpoint:
From the Environment Dropdown select now "Web3 Provider":
A new Popup will appear, and enter the RPC Server URL from Ganache. Pay attention to the Port number:
Your Accounts from Ganache should popup in the Accounts-Dropdown:
Deploy to Ganache¶
Now let's see what happens if we hit the Deploy Button:
Have you seen how fast that was? 🏎️
Now you have the benefit of two things: An actual blockchain node, but fast like a development network.