Deploying a smart contract to the Goerli testnet using Truffle
We have everything we need to support our deployment. But to deploy to the Goerli testnet, we still need to make a few changes to the truffle-config.js
file we have. The configurations we have in truffle-config.js
file are missing information such as a mnemonic phrase, the network endpoints we saved earlier in this chapter in the Creating an Infura account and getting the network endpoints section, and so on. Let’s add this information step by step:
- Open
truffle-config.js
, and you will see the following commented line:// const mnemonic = process.env["MNEMONIC"];
- Find the mnemonic phrase we noted down when we created the MetaMask wallet. Add this phrase into the following line:
const mnemonic = '<your mnemonic phrase>';
- Add a
const
for the Infura Goerli endpoint. We saved this information in the Creating an Infura account and getting network endpoints section of this chapter...