New answers tagged infura
0
Try this:
web3.eth.getTransactionCount(addressFrom).then(txCount => {
const newNonce = web3.utils.toHex(txCount)
const transaction = new Tx({ ...txData, nonce: newNonce }, { chain: 'mainnet' })
transaction.sign(privateKey)
const serializedTx = transaction.serialize().toString('hex')
web3.eth.sendSignedTransaction('0x' + serializedTx) ...
0
The issue is that Infura only exposes the eth_newFilter endpoint via websockets, but you are connecting via https.
Try using a WebsocketProvider when declaring your web3 instance, as shown in the following example:
from web3 import Web3
PROVIDER = "wss://ropsten.infura.io/ws/v3/YOUR-PROJECT-ID"
web3 = Web3(Web3.WebsocketProvider(PROVIDER))
0
Ok. With this code the parts were errors might occur are very limited.
Make sure providerUrl has the correct value.
I hope you filled contractAddress correctly.
Abi is the bigger problem. Do a console.log of it. I would suggest a JSON.parse on the abi. This might fix the problem.
EDIT: What is your web3 version? Make sure not to use an outdated one.
1
To connect to a blockchain you need a node which implements the blockchain functionality. Basically it's a client software. There are currently two major client platforms: Geth and Parity. It can be a bit cumbersome to run your own node but in theory anyone can do it.
Infura is a service provider. They basically just provide you with access to one of the ...
1
You are getting the error The method eth_newFilter does not exist/is not available because you are not using the websocket endpoint from Infura. the eth_newFilter call only exists on websockets.
Change your Infura provider from:
https://mainnet.infura.io/v3/YOUR-PROJECT-ID
to:
wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
Top 50 recent answers are included
Related Tags
infura × 276web3js × 128
go-ethereum × 39
truffle × 36
solidity × 28
ropsten × 28
web3.py × 25
metamask × 22
nodejs × 20
contract-deployment × 17
web3-providers × 17
rinkeby × 16
events × 13
transactions × 12
truffle-migration × 11
web3j × 11
websocket × 11
json-rpc × 10
ethereumjs × 9
blockchain × 8
ether × 7
ipfs × 7
javascript × 6
etherscan × 6
nodes × 6