-
Notifications
You must be signed in to change notification settings - Fork 695
JSON-RPC call to miner_start is returning an error message #383
Comments
I have the same problem using ganache-cli 6.0.3. I setup Ganache CLI with:
Then I try to use RPC with cURL to start mining with:
This gives error:
I then tried to attach to Ganache TestRPC with Geth:
When I run |
The error/crash is almost certainly due to trufflesuite/ganache#255. You can work around this issue by doing the following: The fix will be to 1) fix trufflesuite/ganache#51, and 2) edit |
After a successfull miner_start
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start","params":[]}' localhost:8545
I tried to do a miner stop:
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_stop","params":[]}' localhost:8545
Expected Behavior
In the callback , response result should be true:
{"jsonrpc":"2.0","result":true}
Current Behavior
An error is returned in the CURL:
{"jsonrpc":"2.0","error":{"message":"TypeError: callback is not a function\n at /Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:82710:5\n at /Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:83302:5\n at Object.async.whilst (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:13850:13)\n at StateManager.processBlocks (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:83259:9)\n at StateManager.startMining (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:83488:10)\n at GethApiDouble.miner_start (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:82709:14)\n at GethApiDouble.handleRequest (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:82434:10)\n at next (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:52153:18)\n at VmSubprovider.handleRequest (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59291:12)\n at next (/Users/Javi/.nvm/versions/node/v8.1.2/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:52153:18)","code":-32000}}Javiers-MacBook-Pro:virtue-poker-auction Javi$ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_stop","params":[]}' localhost:8545
Possible Solution
Steps to Reproduce (for bugs)
Context
This is broken a promise during a test, as I expect result.true to resolve the promise.
Your Environment
The text was updated successfully, but these errors were encountered: