Usually, We have three choose to run a chain on localhost.
Generally, we should have chosen anvil. It’s a part of Foundry.
Unfortunately, there were a lot of transitions pending when I used it. From my point of view anvil just is the 0.1.0 version. It will be need more time to develop.
And I want to keep pure in chain end’s project(Not more javascript or npm install
).
Finally, we used the ganahce to run chain on localhost.
The ganahce is very easy to install and setting up. It’s a GUI application.
Open ganahce official website Download it and install it.
We can modify it to any name we like.
Here, I used my ethereum
The PORT NUMBER is 8545
.
The NETWORK ID is 1337
.
There are import things. They will match the MetaMask Wallet’s setting.
We don’t like the account always to change.
SAVE WORKSPACE
buttonSettings > Advanced
Now we can see all test networks
Open ganache and copy the private key
Import private key to MetaMask wallet
Now we switch the network to Localhost 8545
and Account 2
We can see
We do it again to add one more account
Finally we already set up the localhost chain environment.
Let’s try one transition
Copy one wallet’s address
Switch other wallet’s account and send eth to the copy address
Wait a few seconds
Check ganache
Awesome, we have our own ethereum!
This article is very subjective. If you do not feel comfortable viewing it, please close it as soon as possible.
If you think my article can help you, you can subscribe to this site by using RSS.
Photo by GuerrillaBuzz Crypto PR on Unsplash