10

I'm using Remix and connecting to Testrpc via Metamask.

I can successfully launch contracts to testrpc, but then it hangs on the subsequent calls that Remix makes to the public methods (Remix says "9 pending transactions" which never go through).

The contract deploys fine on Rinkeby. I've tried this setup with multiple working contracts but Remix always leaves me with "x pending transactions" (not always the same number for each contract).

Here is my testrpc output:

  Transaction: 0xbf367579e3cb1b414343a4f333bd79388e4fbfe668a57ea59b830934e41512bf
  Contract created: 0x81d49759138f933491a4125ce22c7173e782af4d
  Gas usage: 3347223
  Block Number: 1

eth_getTransactionReceipt
eth_getTransactionByHash
eth_call
eth_call
eth_call
...(more eth_calls)
eth_call
eth_call
eth_call
eth_getBlockByNumber
eth_getBlockByNumber
eth_getBalance
eth_getTransactionCount
eth_getBalance
eth_getTransactionCount
eth_getBalance
eth_getTransactionCount
eth_getBalance
eth_getTransactionCount
eth_getBalance
eth_getTransactionCount
eth_getBalance
eth_getTransactionCount
eth_getBlockByNumber
eth_getBlockByNumber
...(more eth_getBlockByNumber)

What could the problem be?

2
  • You testrpc is running private net or testnet?
    – Aniket
    Nov 20, 2017 at 12:29
  • @A.K. I thought it was only a testnet- how would I check? Nov 21, 2017 at 22:10

3 Answers 3

0

I use this 2 commands line with testrpc :

  1. Read pending transactions
web3.eth.getBlock("pending")
  1. Mining transactions
web3.currentProvider.sendAsync(
   { jsonrpc:"2.0", method: "evm_mine" },
   function(err, result) { console.log(result); }
)

TestRPC allows you to auto-mine your block with command parameter -b or --blocktime. But this feature bugs (after few minutes of service, I get errors)

0

This means that your TestRPC node does not transmit your transactions to the network property.

Transactions can sometimes get stuck in a geth (or forks) node, usually happens when there's connectivity issues with other peers.

You can verify that by looking for the transaction hash in blockchain explorer, you'll see it's not there.

What sometimes helps fixing this is either -

  • Restart your node, when starting up it can connect to new peers and propagate pending transactions it has.
  • Connect to a different RPC node, then you'll see that you don't have pending transactions, just submit them again.
-1

Can you call the public methods from a console attached to your testRPC net? That would be a step toward debugging the issue.

I have had problems with both the remix VM and testRPC. Thus, I recommend using a private network. I could not get the geth --dev flag working correctly, so I also recommend creating your own private blockchain with geth init. Follow this tutorial. http://www.ethdocs.org/en/latest/network/test-networks.html#id3
You will also need to unlock your accounts and mine transactions. This is not like main net mining, so you can do it on a laptop CPU. Feel free to ask me any questions. I recently struggled through similar hurdles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.