4

A raw transaction is just all the transaction parameters encoded in the RLP format. A raw transaction consists of (in this order): Nonce; Gas price; Gas limit; To address; Value; Data. You don't need the private key of the sender: to get the raw transaction, you can simply encode it using RLP(Nonce, Gas Price, Gas limit, To, Value, Data). Here's an example ...


4

No, not all Ethereum networks return the revert reason in the message field. Kovan is an exception. As per the Infura documentation: On Mainnet, Rinkeby, Ropsten and Goerli, if this call causes the EVM to execute a REVERT operation, an error response of the following form is returned, with the revert reason pre-decoded as a string: { "jsonrpc": &...


3

JSON-RPC is not a behaviour of the Ethereum network - Ethereum clients don't talk to each other via JSON-RPC - it's just a notation to encode a remote procedure call that some Ethereum client can interpret as commands sent by the users, and they can respond to those requests in a standard manner. JSON-RPC is easy to implement, it's easy to read and to debug -...


3

My situation: I met the same error while I'm working on my project on localhost (reactjs) with local Ganache blockchain. Reading data from chain works fine but writing data causes Metamask to show the exact same error: Error: [ethjs-query] while formatting outputs from RPC '{ "value":{"code":-32603, ... } At the same time, Metamask ...


2

Unfortunately web3.js is not compatible with Eth2 APIs. Eth1 and Eth2 are quite different; they have very different data models for blocks and Eth2 is going to use RESTful HTTP instead of JSON-RPC. I don't expect to see web3.js compatibility anytime soon. At the present time (mid-April 2020) there is no standard API defined for Ethereum 2.0, however there ...


2

This question is two years old by now. But I wanted to answer, because the original answer is not the correct explanation. As the comment says, Geth does not require transactions be mined before making them available on the getTransaction() API. Rather, the issue is that Geth's txPool consistency model is not full read-after-write. When a tx hash is ...


2

Came to know that WSL-2 cannot connect to the localhost directly. See this and this. WSL-2 has its own port to listen to. Ganache gives you the option to select that port instead of localhost. Go to Settings > Server > Hostname > 172.23.160.1 - Ethernet (WSL) Can use the command provided by @Ismael above in the comments to check if the port is ...


2

The docs you're looking for can be found on the Metamask site: https://docs.metamask.io/guide/rpc-api.html#table-of-contents The RPC call you're looking for is indeed wallet_addEthereumChain(), which you've tried. The restriction you're hitting is by design: according to the docs the call won't work... "If the chain ID corresponds to any default ...


2

OK, the issue is that several guides on how to connect to websockets using Curl don't work on geth's websocket for whatever reason. Using a tool specifically for websockets allowed the requests to go through just fine. $ wscat -c wss://XXXXXXXXXX/ connected (press CTRL+C to quit) > {"jsonrpc":"2.0","method":"web3_sha3&...


1

The confirmation timestamp that you see on etherscan is the time when your transaction was mined, not received by the miner. Have a look at all the transactions within a block. You will notice that they all have the same timestamp. So, your transaction is most likely received by other nodes milliseconds after being broadcasted. However, it is mined only 5 ...


1

Ganache is as server node to ethereum chain and you can using standart ethereum rpc api (attention, look port , default,7545 , but bettet to check, see here more details about configuration ganache https://www.trufflesuite.com/docs/ganache/reference/workspace-default-configuration) For calling method to only getting data from smart you should using https://...


1

You should try command web3.geth.personal.new_account(self, passphrase) and added --http to command line.


1

There is an undocumented eth_getRawTransactionByHash method now in geth nodes. Get raw transaction from hash After getting the raw transaction, it can be directly replayed using eth_sendRawTransaction as long as all the parameters are the same according to EIP-155 (https://eips.ethereum.org/EIPS/eip-155) (nonce, gasprice, startgas, to, value, data, chainid, ...


1

I used the require function to import the JSON file. import Web3 from 'web3'; const web3 = new Web3(window.web3.currentProvider); const { abi } = require('./smart_contract_after_compilation_step.json'); var smart_contract_interface = new web3.eth.Contract(abi, '0x5E54780072f1998FB85c3203D9697ef9E3F82DF0')


1

May be it is a bit late to answer but for others if they need in future. I had a typo in --datadir and --networkid. Hope it helps!


1

The only way is to iterate over all the blocks in the chain using the eth_getBlockByNumber method, extracting transaction data from them


1

Maybe it is useful. For the mainnet you can follow the steps to install the geth client "Full Node on the Ethereum Mainnet" https://github.com/ethereum/go-ethereum. And on the command line, when starting the client geth, add txpool to the --http.api section (or the deprecated --rpcapi depending on the geth version). This will allow you to access ...


1

this solution is working for me: web3.currentProvider.sendAsync({ jsonrpc: '2.0', method: 'evm_unlockUnknownAccount', params: [address], id: new Date().getTime() }, console.log);`


1

Ok i figured this out. Had to upgrade to paid plan in firebase.


1

Maintaining unlocked accounts on the node that you're communicating with is typically useful for testing your contracts on a local network, for example, via ganache. When working on a remote network, it is generally risky because anyone hacking the node that you're communicating with can exploit those unlocked accounts at will. So you may want to consider ...


1

Maybe you could try to reset your account. In this case: MetaMask settings -> Advanced -> Reset Account.


1

In my case, I solved this by increasing the gas price. Please let me know if that works.


1

Your question assumptions are false, because there are other API protocols like graphQL for Ethereum. Why everyone is using JSON-RPC is because Satoshi chose JSON-RPC for Bitcoin back in 2009. Then everyone followed the suit. Not for a particular reason, but because of cargo culting and so on, though JSON-RPC has some good properties like being curlable and ...


1

Documentation can be is a bit misleading here, I think because it aims to simplicity. The following statement from the current RPC official documentation: data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation It should contains more details, maybe something like ...


1

When data is empty (and there is no receive ether function) the fallback function will be called. See: https://solidity.readthedocs.io/en/v0.6.8/contracts.html#fallback-function Prior to Solidity 0.4.0 this was used to send ETH to a contract.


1

This error sometimes appears when Metamask's nonce cache becomes invalid after ganache has been restarted. In that case the solution is to reset Metamask, Settings - Advanced - Reset Account.


1

Ok, I did a bit more digging and I've found my answers. eth_pendingTransactions can not be filtered. eth_newpendingtransactionfilter doesn't filter anything, it instead subscribes the client to receive events when a new pending transaction enters the transaction pool. However there is a JSON_RPC method in the OpenEthereum implementation of an Ethereum node ...


1

They are encoded using solidity abi The first 32 bytes is the offset where string is present within the response: 0000000000000000000000000000000000000000000000000000000000000020. So the string starts at position 20h = 32. At specified offset the first 32 bytes indicates the length of the string: ...


1

You can try running a trace cURL in your terminal to the node, like: curl --data '{"method":"trace_transaction","params":["0x99ac150336f74125702bb87598677c97474c5783a9258049d98377ab0773f73d"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST https://green-autumn-waterfall.quiknode.pro/2ab41411fc6296f2d7f82fa096304f21968913a8/ If it ...


Only top voted, non community-wiki answers of a minimum length are eligible