Configuring Truffle to use the Goerli testnet
INFURA recently announced it implemented supports for the new and awesome Ethereum Görli testnet. Let’s see how to configure the Truffle framework to support it too.
First you will have to create a project on infura.io in order to get an API KEY, here is my configuration:
We then init a new NPM project for tracking dependencies:
We can install truffle locally via npm install — save-dev truffle.
Then, we init our project:
We can add some dependency (truffle-hdwallet-provider)to handle mnemonic seeds:
Awesome! Now all we have to do is to had the following to the truffle-config.js file in the networks section.
And then we are good to go! If you need to deploy to the Görli testnet, just use something like MNEMONIC=”your seed” INFURA_API_KEY=”infura key” npx truffle migrate — network goerli.
And now for the easiest way: I made a truffle box to help you bootstrap any solidity project, it supports all the existing main and test networks with some nice additions! Check it out at https://github.com/ETeissonniere/TruffleStarter.