title: Synchronous requests are not supported when deploying smart contract using web3
body: <p>I'm trying to deploy a smart contract locally using Web3, Truffle, and Testrpc. I used Truffle to compile a smart contract and have the following code to extract the ABI and bytecode. In the same script, I'm trying to deploy the contract using web3.eth.contract.deploy (given in this documentation: <a href="https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#deploy" rel="nofollow noreferrer">https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#deploy</a>) but have been getting this error:</p>
  <blockquote>
  <p>Error: Synchronous requests are not supported</p>
  </blockquote>
  <p>What should I do to get around this?</p>
  <p>Here is the script for reference:</p>
  <pre><code>let fs = require(&quot;fs&quot;);
  let Web3 = require('web3'); // https://www.npmjs.com/package/web3
  var TestRPC = require(&quot;ethereumjs-testrpc&quot;);
  
  let web3 = new Web3();
  web3.setProvider(TestRPC.provider());
  
  let source = fs.readFileSync(&quot;../SmartContracts/build/contracts/TheContract.json&quot;);
  let JSONObject = JSON.parse(source);
  
  // ABI and bytecode description as JSON structure
  let abi = JSONObject.abi
  let bytecode = JSONObject.unlinked_binary;
  
  // Create Contract proxy class
  let contractSettings = {
    from: addr, 
    gas: 1000000, 
    data: bytecode
  }
  let SampleContract = new web3.eth.Contract(abi, contractSettings);
  
  let deploySettings = {
    data: bytecode,
    from: addr
  }
  
  SampleContract.deploy(deploySettings)
    .send({
      from: addr,
      gas: 1500000,
      gasPrice: '30000000000000'
    })
    .on('error', function(error){ 
      console.log(&quot;error&quot;);
    })
    .on('transactionHash', function(transactionHash){ 
      console.log(&quot;transaction hash&quot;);
    })
    .on('receipt', function(receipt){
      console.log(&quot;receipt&quot;) // contains the new contract address
    })
    .on('confirmation', function(confirmationNumber, receipt){ 
      console.log(&quot;confirmation&quot;);
    })
    .then(function(newContractInstance){
      console.log(newContractInstance.options.address) // instance with the new contract address
    });
  
  console.log(&quot;finished&quot;);
  </code></pre>