vechain / web3-gear

Proxy Thor's RESTful API to Eth JSON-RPC, to support Remix, Truffle and more.
MIT License
30 stars 17 forks source link

Method not found when sending token from an account to another #42

Open iliya-hajjar opened 2 years ago

iliya-hajjar commented 2 years ago

I managed to deploy my contract however I can not transfer eth from one account to another. I use command below to transfer eth:

wait web3.eth.sendTransaction({from: accounts[0],to: accounts[1], value: web3.utils.toWei('0.5')});

and then I get following errors in terminal:

--> {"jsonrpc":"2.0","id":10,"method":"eth_getBlockByNumber","params":["latest",false]}
--> {"jsonrpc":"2.0","id":11,"method":"eth_gasPrice","params":[]}
--> {"jsonrpc":"2.0","id":11,"method":"eth_gasPrice","params":[]}
<-- {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}, "id": 11}
<-- {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}, "id": 11}
<-- {"jsonrpc": "2.0", "result": {"number": "0x15a", "hash": "0x0000015a27915d05ac3f3aa462f29f6dfa4a6112377aa562b92474a92ec1cd55", "size": "0x165", "parentHash": "0x000001598ee2f30e9e85d14ce2fe444f2525052ca6a8a2a9cc27ea12506d9481", "timestamp": "0x630324e8", "gasLimit": "0x989680", "beneficiary": "0xf077b491b355e64048ce21e3a6fc4751eeea77fa", "gasUsed": "0x0", "totalDifficulty": "0x15a", "transactionsRoot": "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0", "txsFeatures": 1, "stateRoot": "0x93de0ffb1f33bc0af053abc2a87c4af44594f5dcb1cb879dd823686a15d68550", "receiptsRoot": "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0", "com": false, "miner": "0xf077b491b355e64048ce21e3a6fc4751eeea77fa", "isTrunk": true, "isFinalized": false, "transactions": []}, "id": 10}

There is something wrong with the eth_gasPrice. I also configured my truffle-config.js like below:

development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
      skipDryRun: true,
      production: true,
      gas: 8500000,
      gasPrice: 20000000000,
    },

The thing is I need to to send some coins to one of my created account and withdraw from the same account because of that I need to charge the new wallet somehow. Also running node like this:

bin/thor solo --api-cors "*"