20 votes

To which remote ethereum nodes does Metamask plugin send signed transactions? and are they exposed to denial of service attacks?

1) INFURA (https://infura.io/) maintains those remote nodes. 2) You can trust those nodes for two reasons: Uptime and Relay of signed transactions (as opposed of keeping your private key in our ...
Herman Junge's user avatar
  • 2,381
15 votes

The best Web3 providers online

Over the past year, many teams have been busy building infrastructure services to better support the ecosystem. There are now a number of options available to developers - which is fantastic for the ...
lbrendanl's user avatar
  • 251
15 votes
Accepted

Is there an Infura equivalent for BSC?

If you are looking for a fully managed third party RPC provider for BSC, you can use: Quiknode Ankr If you want complete chain data, you can use their snapshots
hack3r-0m's user avatar
  • 1,919
14 votes
Accepted

Connecting to hosted web3 provider from NodeJS backend

I've replaced const web3 = new Web3(new Web3.providers.HttpProvider("http://rpc.ethapi.org:8545")); with: const web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/TOKEN")); ...
manidos's user avatar
  • 4,298
14 votes
Accepted

Infura web3 provider for Events (.get & .watch)

Infura currently doesn't support WebSockets (required for events using Web3 v1, otherwise you get the error "The current provider doesn't support subscriptions" when using infura as HttpProvider), so ...
Miguel Mota's user avatar
  • 5,163
14 votes
Accepted

How to connect to the Ropsten test-net using web3.js

You can either run a local node and specify your chain using --chain ropsten when starting geth/parity and connect to localhost once sync is completed or you can connect to infura.io: var web3 = new ...
d9ngle's user avatar
  • 436
13 votes
Accepted

Truffle + Infura on Mainnet: Nonce too low error

If you're using Truffle with Infura directly (which it sounds like you are, although it's unclear why you mention MetaMask), you need to be aware that Infura is running on a server farm. If you submit ...
James_pic's user avatar
  • 1,110
12 votes

Infura web3 provider for Events (.get & .watch)

I have been using Infura with web3 1.0 in mainnet. Here is my code, hope it helps var Web3 = require('web3') var request = require('request'); var contract = require('truffle-contract') var ...
maheshmurthy's user avatar
  • 1,237
12 votes
Accepted

Error: "The contract code couldn't be stored, please check your gas limit"

How did you get the bytecode? Does it have the '0x' at the beginning? Can you try adding the '0x' when submitting the transaction? .deploy({ data: '0x' + bytecode, arguments: ['Hi there!'] }) If ...
Ismael's user avatar
  • 30.6k
11 votes

Elegant way to detect current provider int web3.js

This my current implementation: getCurrentProvider() { if (!window.web3) return 'unknown'; if (window.web3.currentProvider.isMetaMask) return 'metamask'; if (window.web3....
Or Bachar's user avatar
  • 357
10 votes

To which remote ethereum nodes does Metamask plugin send signed transactions? and are they exposed to denial of service attacks?

more concretely metamask is connected to those infura's nodes : const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask' const ROPSTEN_RPC_URL = 'https://ropsten.infura.io/metamask' const ...
Badr Bellaj's user avatar
  • 18.8k
10 votes
Accepted

How to connect to infura and deploy contract use web3.pyïĵŸ

As of v4.2.1, deploying a contract with a local key is a lot more straightforward. From the question's example code, here is a new approach: w3 = Web3(HTTPProvider("https://ropsten.infura.io/v3/...
carver's user avatar
  • 6,381
10 votes

Why does sendSignedTransaction return a tx hash BUT does not post to the Rinkeby network (React, Metamask, web3, infura)

This line ... nonce: window.web3.utils.toHex(window.web3.eth.getTransactionCount(fromAccount)), ... relies on a reliable transaction count from Infura. The problem is it's not as reliable (or even ...
Rob Hitchens's user avatar
  • 55.2k
9 votes
Accepted

Running Mist with INFURA

To run Mist using INFURA, you need to start it from the command line If you are using OSX, this is the command you want /Applications/Mist.app/Contents/MacOS/Mist --rpc https://ropsten.infura.io ...
Herman Junge's user avatar
  • 2,381
9 votes
Accepted

How to properly set nonce in a web3 contract invocation?

Apparently there's a nuance with the nonce... my error was I was setting the nonce to web3.eth.getTransactionCount() + 1, which left a gap between prior transaction nonce and next transaction nonce (...
shaharsol's user avatar
  • 561
8 votes
Accepted

Can not send eth on Ropsten using Infura node

This looks mostly correct, but there are a couple optional tx parameters that might make the difference: // EIP 155 chainId - mainnet: 1, ropsten: 3 chainId: 3, gasPrice: "0x9184e72a000", // ...
DanF's user avatar
  • 2,626
8 votes

Issue in websocket connection with infura using web3

I don't want to get a "golden shovel" reward or something but that question doesn't seem to be very old. I managed to successfully implement automatic reconnect thus I wanted to share the code: First ...
pkoniu's user avatar
  • 91
8 votes

How to use infura API with web3 js?

First, import web3 as such: const Web3 = require('web3') Then instantiate a variable (in my case web3) and set a provider: const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet....
Demeterca IonuĊ£-Alexandru's user avatar
8 votes
Accepted

WebSocket connection dropped in Web3.js with Infura

I hope someone from Infura would comment the specifics when they terminate a connection. However, the latest Web3.js has autoreconnect feature: https://github.com/ethereum/web3.js/releases/tag/v1.2....
Mikko Ohtamaa's user avatar
8 votes

Single Call vs MultiCall

In some cases, you might need to gather synchronized data from the blockchain. A good example is querying token prices from Uniswap. You don't want to have the price for one token from block x and a ...
Ioana Roceanu's user avatar
7 votes

How to login with web3 without MetaMask?

What you should do in this case is use the web3-provider-engine. An example code snippet functioning with a custom private key and Infura API URL (Or even TestRPC) would be the following: //Provider ...
Alex Papageorgiou's user avatar
7 votes
Accepted

Best possible way to launch the ethereum mainnet node on AWS

Here's what I am using: AWS Instance Setup New EC2 instance Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-10547475 t2.large: 2 vCPUs, 8GB RAM 250 GB (currently about 60gb is being used) nginx ...
carlolm's user avatar
  • 2,326
7 votes
Accepted

Getting "replacement transaction underpriced" though not trying to replace a transaction

You can indeed change the nonce by hand; it is a transaction parameter and it goes alongside gas, gasPrice, value. So your script can simply increment it then fire and forget the transaction. Now, ...
Xavier Leprêtre B9lab's user avatar
7 votes
Accepted

Web3py. Error getting events using Infura: "The method eth_newFilter does not exist/is not available"

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 ...
iamdefinitelyahuman's user avatar
7 votes
Accepted

Advantages of Infura over Ganache?

Ganache and Infura are two very different things. Ganache is a tool for quickly creating a local network that can be used for development. It can be used to automatically run tests, etc. completely ...
Morten's user avatar
  • 6,017
6 votes

ethers.js Why aren't logs filtering? (query returned more than 10000 results)

Yes, I was filtering the logs very wrong. Let's look at this amazing oopsie from the code block above: const logs = await provider.getLogs({ fromBlock: process.env.DEPLOYMENT_BLOCK, ...
The Renaissance's user avatar
5 votes

Simplest way to integrate Infura with a Web3/Truffle app?

Here's a example of setting an infura provider using truffle-hdwallet-provider with a custom wallet: const HDWalletProvider = require('truffle-hdwallet-provider') const fs = require('fs') const ...
Miguel Mota's user avatar
  • 5,163
5 votes
Accepted

Retrieving logs using filter is not working?

You can find an open issue in the Infura Git We're working on finding a solution to this which can provide the functionality createFilter/getLogs was providing in a way which is scalable and secure....
niksmac's user avatar
  • 9,673
5 votes
Accepted

Truffle + INFURA for deployment

INFURA nodes are public and receive a lot of traffic, and that is the reason that some JSON-RPC methods need to be disallowed. However, we're working on a solution that will make all methods available....
Maurycy's user avatar
  • 476
5 votes

Can not send eth on Ropsten using Infura node

Can you try printing out the raw serialized transaction and sending it to ropsten directly with CURL? https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendrawtransaction Do you get a txid back?
Michael Wuehler's user avatar

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