Questions tagged [web3-providers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
16
votes
4answers
9k views

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

I am using infura for connecting to testnet/mainnet as my server side web3 provider. This works for most requests and operations, but it does not seem to work for Events. const allEvents = (event, ...
16
votes
6answers
23k views

Better pattern to detect web3 default account when using metamask

Context: I want to use blockies to render an identicon on the page, i get the defaultAccount from web3, for this, the user has to be logged on to metamask with a selected address from his wallet. The ...
4
votes
1answer
537 views

How does getDefaultProvider work in ethers.js?

From the docs: This creates a FallbackProvider backed by multiple backends (INFURA and Etherscan). This is the recommended method of connecting to the Ethereum network if you are not running ...
16
votes
2answers
11k views

Connecting to hosted web3 provider from NodeJS backend

I'm using these instructions from etherchain. Here's a similar question(seems like duplicate, but it's not). The solution provided there doesn't work for me, because I don't have a local ethereum ...
4
votes
1answer
2k views

get address of new contract from contract factory

i need to deploy a rental contract at runtime whenever user want's to start the contract. for this purpose i have acontract factory. here is the actual code for facotry pragma solidity ^0.4.8; import ...
3
votes
1answer
584 views

Providing Metamask hooks only using node hosted on server

I am currently looking into hosting an Ethereum node on my web server in order to allow my users to interact with my dApps without needing Metamask (although it could be used). How could I have the ...
4
votes
0answers
492 views

How to Catch Connection Issues to Web3 Provider using Web3.js

My node.js script is able to successfully connect to the Web3 provider when both the private key (using truffle-privatekey-provider) and the provider host URL are correct. let privateKey = ..., ...
2
votes
1answer
2k views

possible reason for insufficient funds for gas * price + value

I have been researching this whole day, but I have a web3 instance, (the Web3 is version 1.0.0) const web3 = new Web3(new Web3.providers.HttpProvider('https://ropsten.infura.io/<myKey>')); ...
1
vote
0answers
151 views

Can't call another contract constant function in Remix in Web3 provider mode, but it works in Javascript VM

Remix behaves differently when running Javascript VM and web3 provider mode. I have two contracts: contract ERC20Basic { function totalSupply() public view returns (uint256){} function ...
0
votes
1answer
293 views

Can I retrieve data from smart contract to my local webpage without using metamask?

I am creating a DApp where I want to show the public variable's information from the contract. I want my users who don't have metamask to see this information also. Is there a way I can do that? If ...
6
votes
3answers
4k views

What are providers in the Ethereum?

The below given code is from the a tutorial given here at one of the tutorials on Truffle // Set the provider for our contract App.contracts.Adoption.setProvider(App.web3Provider); I see we set up a ...
3
votes
0answers
6k views

Get RPC URL / IP of Metamask's current provider

Suppose I have multiple copies of the same dapp running on different servers which do not directly communicate with each other, for testing purposes, and can manually interact with different dapp ...
1
vote
1answer
2k views

web3.js error: Cannot read property 'providers' of undefined

What is problem of this simple html / JavaScript / ethreumjs / web3.js code? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title&...
0
votes
1answer
581 views

JSON RPC + web3: Subscribe to Solidity events

When using web3 and the JSON RPC, is there a way to subscribe to Solidity events? For instance, I want to subscribe to every event Transfer(address indexed from, address indexed to, uint256 value); ...