title: Web3 web3.eth.sendSignedTransaction Invalid params
body: <p>Im very new to ethereum i have set up a private network using the pantheon client. i have successfully deployed a contract to the network and all interactions with the contract work when using through remix.</p>
  
  <p>I am trying to set up a relay where a transaction is signed client side, sent to a nodeJs server and then the server proxies the transaction to the contract. however when i pass the signed transaction to <code>sendSignedTransaction()</code> i get the error <code>Invalid params</code>, to me this is very vague and i am unsure what i'm doing wrong / what the invalid params are. (any advice on how to debug this?)</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>using web3 v1.2.0</p>
  
  <p>Error</p>
  
  <pre><code>Error: Returned error: Invalid params
      at Object.ErrorResponse (/Users/ghost/node_modules/web3-core-helpers/src/errors.js:29:16)
      at Object.&lt;anonymous&gt; (/Users/ghost/node_modules/web3-core-requestmanager/src/index.js:140:36)
      at /Users/ghost/node_modules/web3-providers-ws/src/index.js:121:44
      at Array.forEach (&lt;anonymous&gt;)
      at W3CWebSocket.WebsocketProvider.connection.onmessage (/Users/ghost/node_modules/web3-providers-ws/src/index.js:98:36)
      at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/ghost/node_modules/yaeti/lib/EventTarget.js:107:17)
      at W3CWebSocket.onMessage (/Users/ghost/node_modules/websocket/lib/W3CWebSocket.js:234:14)
      at WebSocketConnection.&lt;anonymous&gt; (/Users/ghost/node_modules/websocket/lib/W3CWebSocket.js:205:19)
      at WebSocketConnection.emit (events.js:188:13)
      at WebSocketConnection.processFrame (/Users/ghost/node_modules/websocket/lib/WebSocketConnection.js:552:26)
      at /Users/ghost/node_modules/websocket/lib/WebSocketConnection.js:321:40
      at process.internalTickCallback (internal/process/next_tick.js:70:11)
  </code></pre>
  
  <p>Contract</p>
  
  <pre><code>pragma solidity ^0.5.1;
  
  import "./Ownable.sol";
  
  contract Entry is Ownable { 
      mapping (address =&gt; string) hash;
  
  
      function addEntry(string memory _hash) public {
          hash[msg.sender] = _hash;
      }
  
      function getHash() public view returns(string memory){
          return hash[msg.sender];
      }
  
  }
  </code></pre>
  
  <p>Relay Server</p>
  
  <pre><code>const Web3 = require('web3');
  const express = require('express')
  const app = express()
  const port = 3003
  const bodyParser = require('body-parser');
  const cors = require('cors')
  
  app.use(bodyParser.urlencoded({extended: true}));
  app.use(bodyParser.json())
  app.use(cors())
  
  var web3 = new Web3(Web3.givenProvider || "ws://localhost:7002");
  
  app.post('/transaction/send', async (req, res) =&gt; {
      const {tx, data} = req.body;
  
      web3.eth.sendSignedTransaction(tx, function (err, transactionHash) {
        if(err) console.log(err);
        console.log(transactionHash);
      });
  })
  
  app.listen(port, () =&gt; console.log(`Example app listening on port ${port}!`))
  </code></pre>
  
  <p>Front end</p>
  
  <pre><code>import React from 'react';
  import './App.css';
  import Web3 from 'web3';
  import request from 'request-promise';
  
  const Tx = require('ethereumjs-tx').Transaction;
  const web3 = new Web3("http://localhost:8545");
  const privKey = '[My Priv key here]';
  const contractADDRESS = "0x4261d524bc701da4ac49339e5f8b299977045ea5";
  const addressFrom = '0x627306090abaB3A6e1400e9345bC60c78a8BEf57';
  const contractABI = [{"constant":false,"inputs":[{"name":"_hash","type":"string"}],"name":"addEntry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getHash","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}];
  
  
  function App() {
  
    async function sendTx(){ 
      const data = await extraData();
      web3.eth.getTransactionCount(addressFrom).then(txCount =&gt; {
        const txData = {
          nonce: web3.utils.toHex(txCount),
          gasLimit: web3.utils.toHex(25000),
          gasPrice: web3.utils.toHex(10e9),
          to: contractADDRESS,
          from: addressFrom,
          data: data
        }
  
        sendSigned(txData, function(err, result) {
          if (err) return console.log('error', err)
          console.log('sent', result)
        })
  
      })
    }
  
    async function sendSigned(txData, cb) {
      const privateKey = new Buffer(privKey, 'hex')
      const transaction = new Tx(txData)
      transaction.sign(privateKey)
      const serializedTx = transaction.serialize().toString('hex')
      const response = request({
        method: 'POST',
        uri: 'http://127.0.0.1:3003/transaction/send',
  
        body: {
            tx: serializedTx,
            data: 'somehashhh'
        },
        json: true,
      });
    }
  
    async function extraData() {
      const contractInstance = new web3.eth.Contract(contractABI, contractADDRESS);
      return await contractInstance.methods.addEntry('somehashhh').encodeABI();
    }
  
    return (
      &lt;div className="App"&gt;
        &lt;header className="App-header"&gt;
          &lt;div onClick={() =&gt; sendTx()}&gt;Submit transaction&lt;/div&gt;
        &lt;/header&gt;
      &lt;/div&gt;
    );
  }
  
  export default App;
  </code></pre>
  
  <p>This is the txData sent from front end</p>
  
  <pre><code>{
  data: "0x17ce42bd0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a736f6d6568617368686800000000000000000000000000000000000000000000"
  from: "0x627306090abaB3A6e1400e9345bC60c78a8BEf57"
  gasLimit: "0x61a8"
  gasPrice: "0x2540be400"
  nonce: "0x0"
  to: "0x4261d524bc701da4ac49339e5f8b299977045ea5"
  }
  </code></pre>