How to deploy Smart Contracts With Web3 Using Async/Await?

by pjonson2   Last Updated May 24, 2019 16:28 PM - source

This is my Javascript code. I keep getting an error that states

Error: No privateKey given to the TransactionSigner. at TransactionSigner._callee$ (/Users/payton/WebstormProjects/Esgro_DAPP/node_modules/web3-eth/dist/web3-eth.cjs.js:53:23) at tryCatch (/Users/payton/WebstormProjects/Esgro_DAPP/node_modules/regenerator-runtime/runtime.js:45:40) at Generator.invoke [as _invoke] (/Users/payton/WebstormProjects/Esgro_DAPP/node_modules/regenerator-runtime/runtime.js:271:22) at Generator.prototype. [as next] (/Users/payton/WebstormProjects/Esgro_DAPP/node_modules/regenerator-runtime/runtime.js:97:21)

I am using node 12.1.0 & web3^1.0.0-beta.55

 const contract = new web3.eth.Contract(_ABI);

   web3.eth.accounts.wallet.add({
        address:_publicKey,
        privateKey: _privateKey.toString()
    });
    const contract_Instance = await contract.deploy({
        data: _bytecode,
        arguments: _constructor_args})
        .send({
        from: _adminAddress,
        gas: 1500000,
        gasPrice: '20000000000'
    });

What am I doing wrong here?



Related Questions




Unable to print event without JSONstringify

Updated May 14, 2018 20:28 PM

Create Dapp with multiple web page

Updated September 19, 2018 15:28 PM