I build deploy.js for deploy rinbkeby test network. But when I run command node deploy.js
didnt work. Here my code:
const HDWalletProvider = require('truffle-hdwallet-provider')
const Web3 = require('web3')
const {interface, bytecode} = require('./compile')
const provider = new HDWalletProvider(
'xxxxx xxxxx xxxxx xxxxx xx xxxxxx ...',
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
)
const web3 = new Web3(provider)
const deploy = async () =>{
console.log("geldm");
const accounts = await web3.eth.getAccounts()
console.log(accounts);
const result = await new web3.eth.Contract(JSON.parse(interface))
.deploy({data: bytecode, arguments: ['Hi there!']})
.send({gas: '1000000', from: accounts[0]})
console.log('Contract deployed to', result.options.address)
}
deploy()
When I run command I get this:
geldm (node:6184) V8:
C:UsersFeruzDesktopethereuminboxnode_modulessolcsoljson.js:3
Invalid asm.js: Invalid member of stdlib (Usenode --trace-warnings ...
to show where the warning was created)