Hot answers tagged

19 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 ...
user avatar
  • 2,351
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 ...
user avatar
  • 251
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")); ...
user avatar
  • 4,138
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 ...
user avatar
  • 4,715
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 ...
user avatar
  • 366
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 ...
user avatar
  • 1,107
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 ...
user avatar
  • 29.2k
11 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 ...
user avatar
  • 990
11 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
user avatar
  • 1,492
10 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....
user avatar
  • 347
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 ...
user avatar
  • 17.5k
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 ...
user avatar
  • 51.4k
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 ...
user avatar
  • 2,351
9 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/...
user avatar
  • 6,101
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", // ...
user avatar
  • 2,602
8 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 (...
user avatar
  • 509
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....
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 ...
user avatar
7 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 ...
user avatar
  • 81
6 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 ...
user avatar
  • 2,276
6 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 ...
user avatar
  • 5,026
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 ...
user avatar
  • 4,715
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....
user avatar
  • 9,343
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....
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?
user avatar
5 votes

Cannot create filter on Infura via web3.py

Infura doesn't support filters. Per https://api.infura.io/v1/jsonrpc/ropsten/methods (from the documentation, these are the supported methods: { "get": [ "web3_clientVersion", "net_version"...
user avatar
  • 26.4k
5 votes
Accepted

How long does Infura store a file on IPFS?

Got a reply from an Infura member. At the moment if you pin objects on their nodes they won't be removed. Unpinned objects are garbage collected when the data store needs to reclaim space. File size ...
user avatar
5 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, ...
user avatar
5 votes

web3 Websocket connection to infura

was fixed on web3@1.0.0-beta.36 https://github.com/ethereum/web3.js/issues/1559#issuecomment-412348642
user avatar
5 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....
user avatar

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