RPC error when using Ganache GUI but not Ganache CLI.
See original GitHub issueTruffle v5.0.43 Ganache GUI 2.1.2 Metamask 7.6.1 Mac OSX 10.15 Chrome 78.0.3904.108
Using the default truffle react box, if I migrate it onto ganache-cli and then interact with it (via Metamask) it works great. But if I try and do the exact same thing using ganahe-gui the contract deploys fine, but interacting with it fails.
This is the error when I try and interact with the ‘set’ function which happens automatically upon page load:
transact to SimpleStorage.set errored: Error: [ethjs-rpc] rpc error with payload {"id":4054640964707,"jsonrpc":"2.0","params":["0xf88906843b9aca0082a2d494f2b3d44f40c5d9082bfc6855063ca5eae508db6e80a460fe47b10000000000000000000000000000000000000000000000000000000000000003822d46a09924fdd8d1d1e81bc486ade4f28a7c0e62d1d7870fe0d82211e6f3971352fc1ea07fddeb019bb65318edac2dd619ae6df1970f175ffc8465cf41d24109c81841ad"],"method":"eth_sendRawTransaction"} [object Object]
I am using the same ‘chain’ on Metmask for both gui and cli- localhost:8545. Metamask is detecting the chain properly because I can see that I have 100 ether (99.9 after contract deployment). Metmask does not give any errors prior to submitting the tx, it is only when I press Send that it gives me the error. If it wasn’t detecting the chain, I wouldn’t be able to send as I’d have a 0 balance.
Please note that the above error is from remix IDE because metamask doesn’t store the error anywhere, it only appears as a notification.
Steps to reproduce
- launch truffle gui, quickstart
- truffle unbox react
- truffle migrate
- cd client
- npm run start
- Browser opens- asks for metamask password and then permission to connect, I put in password and connect. Then I am asked to sign a tx, which I do, and the above error is seen.
To get the error message within remix:
- copy the code of SimpleStorage.sol
- change environment to ‘injected web3’
- deploy at contract address (taken from ganache gui)
- call ‘set’ function with any integer
My truffle-config is as below:
const path = require("path");
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
gasPrice: 1000000000, // 1 gwei
}
}
};
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
👍 Anytime!
Thanks for your help 😃