Skip to main content

Questions tagged [rpc]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
12 votes
16 answers
28k views

TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')

const ethers = require("ethers"); const provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/v3/MYKEYISHERE') web3.eth.getBlockNumber().then(console.log) Error: ...
dertobiaszwei's user avatar
9 votes
5 answers
28k views

Metamask - "Params specify an EIP-1559 transaction but the current network does not support EIP-1559"

I'm working on a little erc 721 project. We have a frontend that allows users to mint a couple of our nfts with a button. contract.methods.mint(tokensNumber).send({from: accounts[0], value: ...
Pepe Silvia's user avatar
8 votes
3 answers
16k views

Single Call vs MultiCall

What exactly is multicall and the benefits of it, compared to Single call? What is multicall contract and the purpose of it, I can't find any proper definition of it. Some source said that multicall ...
theo's user avatar
  • 103
7 votes
1 answer
2k views

Failed to get EIP-1559 fees error when deploying to ZkEVM polygon using Foundry

I have this error Failed to get EIP-1559 fees after running this command forge script script/BricksCore.s.sol:BricksCoreScript --rpc-url $POLYGON_ZKEVM_RPC_URL --broadcast My script : contract ...
noro meb's user avatar
  • 368
5 votes
1 answer
3k views

Geth --rpcaddr doubt

Can you tell me the differences between --rpcaddr 127.0.0.1 --rpcaddr 0.0.0.0 --rpcaddr my_public_ip --rpcaddr my_private_ip during a private network config? Thank you
Bruce Wayne's user avatar
5 votes
2 answers
4k views

Difference between web3.eth.getCoinbase() and web3.eth.getAccounts()[0]

What is the difference between web3.eth.getCoinbase() and web3.eth.getAccounts()[0]. In both cases, I always get the value, which is the currently selected account in Metamask. Note: The question ...
Vishal's user avatar
  • 163
5 votes
1 answer
556 views

Accessing custom JavaScript functions via RPC API on Geth

Geth allows me to define & load my own custom JavaScript functions with --preload flag or require() on Geth console. But is there way to access my functions via RPC interface? Like : curl -H "...
Kerem atam's user avatar
4 votes
2 answers
15k views

How to check Ethereum smart contract info?

I want to know 3 things: Is an address a smart contract? Is this smart contract an ERC20 or ERC721 token? Is the Solidity code public?
R Sun's user avatar
  • 141
4 votes
1 answer
2k views

Retrieve event args from getPastLogs

When we use web3.eth.getPastLogs it returns topic and data properties together with rest data. Does it possible to retrieve event args parsing just data and topic as filter? Without to make additional ...
Arsenius's user avatar
  • 141
4 votes
1 answer
477 views

Question about suicide traces in Parity

I use Parity's trace facility extensively to help me account for all transactions on individual accounts. I've been able to get almost complete accuracy (off-chain) of account balances for each block, ...
Thomas Jay Rush's user avatar
3 votes
1 answer
5k views

What do these geth --rpcapi parameters mean: db and net?

Many times in different guides I met the following string to start geth: geth --rpc --rpcapi="db,eth,net,web3,personal" Here we can find commands provided by admin, personal, eth options. But what ...
Sovan's user avatar
  • 133
3 votes
3 answers
86 views

Is it 100% guaranteed to check an address that it is a smart contract using eth_getCode?

I'm getting a transaction from an Ethereum node using RPC. I need to understand if this transaction to an Externally Owned Account or to smart contract address. I was advised to use eth_getCode for ...
Sergei's user avatar
  • 31
3 votes
1 answer
3k views

How Can I Connect Alchemy as a Custom RPC Node Provider in MetaMask?

I saw this doc on adding a custom RPC endpoint to MetaMask. I'm wondering what are the steps to fill out the information specifically if I have an Alchemy endpoint available? I would like to use the ...
Patrick Collins's user avatar
3 votes
1 answer
3k views

How to gather historical events emitted by any contract

I am trying to gather all events of a specific type on the entire chain, regardless of what contract emitted them. When trying to find solutions online, I came across code like the following (source): ...
UTF-8's user avatar
  • 518
3 votes
1 answer
53 views

how can we control the logic behind ethersJs fallbackProvider's choices

I am trying to use ethersJs to handle multiple RPCs with a fallback mechanism, to ensure we always get a response. I tried the FallbackProvider . The probelm with it is that event if you set a quorum ...
Kaki Master Of Time's user avatar
3 votes
1 answer
201 views

How to connect to Ethereum Mainnet from a Mobile App?

I have tested with various private Ethereum chains and test ones using Web3 and RPC calls to a node from React. I am working on connecting to the mainnet for Ethereum with the same principle. If I ...
Trevor Lee Oakley's user avatar
3 votes
1 answer
1k views

web3.js: Error: The method shh_newSymKey does not exist/is not available on Web3.js

My main goal is to call web3.shh functions using RPC API , Web3.py or Web3.js. I can call web3.shh functions when I use geth attach; which is my last option to do. I am following this answer. geth ...
alper's user avatar
  • 8,394
3 votes
1 answer
1k views

Raw transaction nonce won't increment until confirmation

I am building transactions manually and have been able to successfully create raw transactions which can be broadcasted to the network. My problem is, that while I can get a nonce from the web3....
James's user avatar
  • 341
3 votes
1 answer
754 views

How to work with foundry anvil custom rpc methods?

I'm running an anvil fork node on localhost:8545, and I create a provider by ethers: const provider = new ethers.JsonRpcProvider('http://localhost:8545') I tried some common rpc methods like: ...
CT95's user avatar
  • 416
3 votes
2 answers
4k views

Fetch ERC20 Token Balance for given address using Web3 Python

I’m desperately looking for a method that allows me to retrieve all token owned by a wallet using python. I should insert the wallet address as I put and the code should return the list of the token ...
GKM__'s user avatar
  • 31
3 votes
0 answers
245 views

GETH gets out of sync from time to time

GETH tooks 6 days to sync, after that it will get out of sync from time to time. (PC is running with SSD, never shutdown, and network availability is 100% with 500mbps connection). May I know how ...
s k's user avatar
  • 886
3 votes
0 answers
339 views

Invalid JSON RPC response: {"id":6,"jsonrpc":"2.0"}

I'm following this tutorial https://medium.com/@ConsenSys/a-101-noob-intro-to-programming-smart-contracts-on-ethereum-695d15c1dab4 I have downloaded the code from github repo. I'm using ganache as ...
M. Dhaouadi's user avatar
3 votes
0 answers
80 views

What RPC APIs are safe to expose?

What RPC APIs are safe to expose (make public, so accessible by anyone), and what are the unsafe ones, and why? I've read: are there "public" ethereum nodes? or any recommendations on ...
Константин Ван's user avatar
3 votes
2 answers
495 views

Deploying to rinkeby doesn't work

It seems I have a bit of trouble deploying a contract to testnet through infura this is my code: var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider('https://rinkeby....
Narcis Ciobotariu's user avatar
2 votes
4 answers
2k views

Is there a way to read hardhat config inside a script at runtime and console.log certain attributes?

I want to add some nice output in my hardhat scripts for showing what my configurations are during a test run. I run the script locally while changing configuration variables and I want the console ...
thatguyintech's user avatar
2 votes
2 answers
5k views

GETH command --rpc

I want to learn how to use the GETH console. What does command "geth --rpc" do? Why are so many entries generated? What is it syncing? If it is a syncing process, when or what message means the ...
CounterSpell's user avatar
2 votes
6 answers
10k views

TypeError: Web3.providers.WebsocketProvider is not a constructor?

Trying to connect to a geth machine over websocket? JS code. var Web3=require('web3'); var web3 = new Web3(new Web3.providers.WebsocketProvider('ws://10.244.5.43:8546')); console.log(web3....
Subhod I's user avatar
  • 927
2 votes
3 answers
3k views

How to get token holders via json RPC

So I want to get the token holders of a token like this: https://ropsten.etherscan.io/token/0xfa68d281e7ff1a8e9393428ba0abe8961cf342cb#balances Via my Ethereum node. I tried: https://github.com/...
Marc Alexander's user avatar
2 votes
2 answers
81 views

Looking for some good RPCs [closed]

Where can I find good Ethereum RPCs for free? I know there are some public RPCs but I am looking for one without any/less rate limiting.
Tien's user avatar
  • 193
2 votes
2 answers
2k views

MetaMask displaying wrong value when making RPC sendTransaction call

I have been trying to send a transaction using an RPC call with MetaMask's window.ethereum.request injected method. I have successfully sent a transaction before, by using the web3js method web3.eth....
FrozoWeb's user avatar
2 votes
2 answers
100 views

Need an advice about a stable RPC Provider (doesn't have to be free) [duplicate]

Need a full ETh Node, please share a good RPC provider with stable connection and not enou
Joan Williams 's user avatar
2 votes
1 answer
266 views

How to get block and receipts data?

Is there a way to get the entire block information and transaction receipts within the block all in one function/method? Irwing Tello
Irwing Tello's user avatar
2 votes
1 answer
2k views

HardHat deploy script works on testnet but not on forked hardhat network

The error that I am getting when running this is: Error: Invalid RpcBlockWithTransactions or null I have a contract called PriceConsumerV3 and it makes a view function call on a contract. I am ...
Patrick Collins's user avatar
2 votes
1 answer
784 views

Is it possible to filter pendingTransactions?

To get a list of the pending transactions that my node is aware of I can easily call the eth_pendingTransactions jRPC call. This will give a big list of pending transactions, which all need parsing to ...
Samuel Hawksby-Robinson's user avatar
2 votes
1 answer
384 views

Private Ethereum Node connection with Metamask

I am able to connect using metamask localhost 8545 option, as well as computer within the intranet. geth --identity "SK" --datadir data --networkid 18 console --rpc --rpcport 8545 --rpcaddr "0.0.0.0" ...
s k's user avatar
  • 886
2 votes
1 answer
335 views

Parity web3 access for another user account on same server?

I am following the instructions from the Parity github page: https://github.com/paritytech/parity/wiki/Basic-Usage Specifically: $ npm install web3 $ node > Web3 = require("web3") > web3 = ...
stone.212's user avatar
  • 2,004
2 votes
2 answers
191 views

Ethereum RPC API

I am building an analytics dash for wallets, which constantly tracks balance changes for wallets. I am using this small snippet to get the balance (async () => { const provider = new ethers....
renatghoste's user avatar
2 votes
1 answer
90 views

How to add a NFT to metamask wallet with a RPC method

We have a way to add an ERC20 token to the metamask wallet from our dapps with a RPC method: const addTokenToMetamask = async () => { if (typeof window.ethereum !== "undefined") ...
Fernando López's user avatar
2 votes
2 answers
2k views

starting geth node with db facility

I'm trying to start geth node to perform queries about blockchain state. The command that worked for me year ago as follows: geth --rpc --rpcapi="db,eth,net,web3,personal,web3" --rpcaddr &...
im_infamous's user avatar
2 votes
1 answer
1k views

Ethereum wallets that support "Custom RPC URL" like Metamask

I'm running a private blockchain and I've been using Metamask connected to my custom RPC URL with no issues.. I'm curious if there's any other Ethereum wallet that let's you add and connect to a ...
user avatar
2 votes
1 answer
883 views

How does one retrieve revert/require error messages from RPC

In both of these questions, the user is asking if it's possible to get the error string from a revert or require. The answers say, basically, "Yes" and point to Truffle or other methods. VM Exception ...
Thomas Jay Rush's user avatar
2 votes
1 answer
181 views

Using json RPC without any libraries besides js

I am currently trying to call a function on my smart contract function adopt(uint petId) public returns (uint) that has already been deployed to the ropsten network... but here's the catch. I'm ...
Cameron Akhavan's user avatar
2 votes
2 answers
641 views

Exposing RPC port: how to expose rpc on [::]:8545 and not only on localhost

I have a simple question but I cannot find the problem. I want to expose the RPC port of my node in my local network (so that I can access it from another computer). I run the node with : geth --http ...
Makubu's user avatar
  • 65
2 votes
0 answers
83 views

Creating new accounts using `web3`

In the new version of web3.py, the personal.newAccount functionality has been retained only for the geth client. What is the right cross-client approach to creating new accounts? See v5 migration ...
Peteris's user avatar
  • 1,005
2 votes
2 answers
260 views

Is it possible to connect to public Ethereum like blockchain with Remix to deploy and view contracts?

I've tried to do so by specifying the web3 provider and the 8584 port but it gets stuck on every try. Is this possible? if so, is there another solution for that need?
user3652172's user avatar
2 votes
1 answer
211 views

How do i create account remotely?

I have two servers, one for eth-node, one for web api and user db. I want to send request to create account from web server to eth server, but i see it can be created by running command like geth ...
TomSawyer's user avatar
  • 123
2 votes
0 answers
452 views

"RPC error, your account is locked" when I try to deploy the last version of parity-bridge

I have already success to deploy the last version of parity-bridge (last month), but today i have pull the last version of parity-bridge. I have that on my terminal : env RUST_LOG=info parity-bridge-...
yohan's user avatar
  • 65
2 votes
1 answer
7k views

How can I retrieve the number of decimals of a token with RPC?

There doesn't seem any obligation in the ERC20 standard to provide the number of decimals anywhere, yet etherscan and all other services can automatically determine the number of decimals of a token. ...
The Quantum Physicist's user avatar
2 votes
0 answers
224 views

What does "RlpInvalidIndirection" error mean?

I run my own Parity node for Ropsten network. I am sending raw transactions to the node with "eth_sendRawTransaction" api, and sometimes it returns {-32602, "Invalid RLP.", "RlpInvalidIndirection"} ...
santony's user avatar
  • 135
2 votes
0 answers
587 views

Geth connection rpc vs ws

where I can find same articles or materials to understand differences between rpc and ws connection over geth. From my point of view rpc is part of a websocket connection, so why I have to use ws ...
underdog's user avatar
  • 1,190