I am creating a contract on my local blockchain network using web3. On my node , contact is created and address is generated. But on node application, response is struck.
Here is my node code:
const Web3 = require('web3')
const web3 = new Web3(new Web3.providers.HttpProvider("http://192.168.56.103:8000"))
//const web3 = new Web3(ganache.provider());
const compiledFactory = require('./ethereum/build/CampaignFactory.json')
const deploy = async () => {
accounts = await web3.eth.getAccounts()
console.log(accounts)
addr = await web3.eth.personal.newAccount('123456');
console.log(addr)
factory = await new web3.eth.Contract(JSON.parse(compiledFactory.interface))
.deploy({ data: '0x' + compiledFactory.bytecode })
.send({ from: accounts[0], gas: '1000000' });
console.log(factory)
}
deploy();
Here is console from node app that is stuck after
[ '0xDa8512CBD5c5eaa1213e5A7bEefAf35e9bA2c9EA',
'0x3F5dD664F0A803d546E087Ee03B69aEb97D428DB',
'0x7Eb0390DbF70147f37459F5d982456527FdBdb98',
'0xD9FcDA95002A09d7be394F085fAEC2a1f3d28476' ]
0x2Cc72882b17960e07FCeF04E54A397628075654D
and here is the logs from node:
INFO [08-09|03:28:10.027] Submitted contract creation fullhash=0x63ac15fcc23f19aa44cd225dbacf7ea30069d3e106987daf63a4238caab4b73c contract=0x31F82590e051A224e7d8d63eB54f434d6073aB06
Can anybody help? Why I am not getting address on nodejs application?