I am trying to deploy my contract to Rinkeby network via Infura. But it actually does not get deploy to network when i run node deploy.js
terminal does not spit out the address at which it is deployed. On screen i see it stuck. Please have a look at below screenshot. almost i kept it for a hour, but still same state.
Upon disconnecting the internet i get the below error, from this i can assume something was going on. there is no feedback system which shows the progress.
is there any way to know what is going wrong?
below is my deploy.js code
const HDWalletProvider = require('truffle-hdwallet-provider');
const Web3 = require('web3');
const compiledFactory = require('./build/CampaignFactory.json');
const provider = new HDWalletProvider(
secret_key,
'https://rinkeby.infura.io/v3/<infura_key>'
);
const web3 = new Web3(provider);
const deploy = async () => {
const accounts = await web3.eth.getAccounts();
console.log('Deploying from account', accounts[0]);
//console.log('Bytecode is 0x'+compiledFactory.bytecode);
const result = await new web3.eth.Contract(JSON.parse(compiledFactory.interface))
//.deploy({ data : '0x' + bytecode})
.deploy({ data : '0x' + compiledFactory.bytecode})
.send({gas : '1000000', from : accounts[0]});
// console.log(interface);
console.log('Contract deployed to ', result.options.address);
};
deploy();