Hello all I have been working on ERC20 token and everything was ok following the academy course.
However, I got stuck when trying to deploy to the mainnet.
here is my truffle config
const HDWalletProvider = require('@truffle/hdwallet-provider');
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
matic: {
provider: () => new HDWalletProvider(mnemonic, `https://speedy-nodes-nyc.moralis.io/02e18687589adb82ff079d51/polygon/mainnet`),
network_id: 137, //80001 for mumbai , 137 for mainnet
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
},
// Set default mocha options here, use special reporters etc.
mocha: {
// timeout: 100000
}
,
// Configure your compilers
compilers: {
solc: {
version : "0.8.13"
}
}
}
Steps to reproduce my error : -
truffle compile
truffle migrate --network matic
error message : -
null
C:\Users\HussainAlkhateeb\Desktop\Phantom Troupe Copy\node_modules\web3-provider-engine\index.js:160
cb(null, null)
^
Error: Could not find block
at C:\Users\HussainAlkhateeb\Desktop\Phantom Troupe Copy\node_modules\web3-provider-engine\index.js:59:28
sometimes i get another message (following the exact steps) :-
the “ETIMEDOUT” error
THANKS FOR YOUR HELP !