INFURA / infura

Official Public Repository for INFURA
https://infura.io
380 stars 62 forks source link

Does Infura support the Web3.js 1.0 API? #29

Closed lukehedger closed 6 years ago

lukehedger commented 7 years ago

Using web3@1.0.0-beta.18 I have attempted to deploy a contract to Rinkeby with a single argument:

myContract.deploy({ arguments: [ 123 ] })

The contract deploys OK but when calling a method to return the constructor argument, 0 is returned, which suggests the argument was not processed.

myContract.methods.echo().call({ from: fromAccount })
  .then( res => console.log(res) ) //=> 0

The contract is here for ref:

pragma solidity ^0.4.0;

contract Echo {
  uint value;

  function Echo(uint _value) {
    value = _value;
  }

  function echo() constant returns (uint) {
    return value;
  }
}
chuacw commented 6 years ago

Hi @egalano Can I get an invite? Scanning blocks for transactions take way too long! chuacw a gmail com

bitpshr commented 6 years ago

Hi @egalano, could I please get an invite? paulbouchon90@gmail.com. Thanks!

buhrmi commented 6 years ago

Hello @egalano me too, please: buhrmi@gmail.com

artemii235 commented 6 years ago

Hello @egalano. Please send me an invite too: ortgma@gmail.com. Does it work already on main net?

decodedbrain commented 6 years ago

Hello @egalano. Please send me invite to WebSockets Infura access to decodemybrain@gmail.com

ghost commented 6 years ago

Hello @egalano Kindly send me the invitation for infura WS support. sheraz1392@gmail.com

pash7ka commented 6 years ago

Hi @egalano, I would like to try Infura WS support, please send me an invite. pash7ka+infura@gmail.com

DomiDre commented 6 years ago

Hi @egalano are you still searching for beta testers for the web socket support? I would like an invitation homiedomi@gmail.com

cheerfyt commented 6 years ago

Hi there, i want to sync some data (about my contracts) from infura.io to my local db, is there any way to do this? @egalano can i get an invite? cheerfyt@gmail.com

trakout commented 6 years ago

@egalano If websocket support is still in testing, I'd love to receive an invite. Thanks! (redacted)

pash7ka commented 6 years ago

I've never received any reply to my request, so it seems like this beta testing program is not running.

ertugrulyilmaz commented 6 years ago

Hi @egalano, I would like to try Infura WS support, please send me an invite. ert.yil@gmail.com

doexclusive commented 6 years ago

Hi @egalano , If it's possible please grant me access to testing of Infura Websockets, my email is denig55amg@gmail.com

Bryan792 commented 6 years ago

If this is still running, I would like access Bryan792 [ at ] gmail.com Thanks.

ZhiGuang commented 6 years ago

@egalano Can you send me an invitation? nrobot@outlook.com Thank you.

eacolina commented 6 years ago

@egalano Can I get access to the beta too? eacolina@uwaterloo.ca Thanks!

Hirama commented 6 years ago

@egalano Can I get access to the beta too? giorkin@gmail.com Many thanks!

caa1982 commented 6 years ago

Can I get access to the beta please? cyril@2getherbank.com thanks!

wnz99 commented 6 years ago

@egalano Could I please get access to the beta too? dfava80@gmail.com Thanks!

tritao commented 6 years ago

Hi, can I get access to the beta too? joao@tritao.eu Thanks!

johncpalmer commented 6 years ago

Hi, idk if this is getting to spammy at this point but, @egalano I would love access to the beta as well. Want to be able to subscribe to events. Thanks!

bergutman commented 6 years ago

@egalano If you're still accepting requests for the beta, could I possibly get access at connorgutman@gmail.com? Thank you and happy New Year! 🎉

dellintosh commented 6 years ago

@egalano If you have any extra invitations for the beta testing I'd love to get one as well. Thank you!

adonley commented 6 years ago

@egalano same here, would love beta for this infura feature -> andrewjdonley@gmail.com . Thanks!

capablemonkey commented 6 years ago

I'd also like to help test this! :) technix1@gmail.com

ryanschneider commented 6 years ago

Hey everyone, Ryan from Infura here.

Two updates. First off, I'm targeting tomorrow morning (California time) to roll out a new version of our websocket infrastructure. There shouldn't be any down time, but your existing sessions may time out.

This new version is more scalable, so after it's released I'll post the URLs for all 3 support networks, so you won't need an invite going forward.

Expect the upgrade to occur around 2017-01-09 17:00 UTC, about 24 hours from now. If you see any issues after the rollout, please @-reply me instead of egalano. Thanks!

dmitryVonDrake commented 6 years ago

@egalano Hi! I'd also like to test this! dmitry8drak@gmail.com Thanks a lot!

ryanschneider commented 6 years ago

The upgrade will be a little bit delayed but is still happening soon, I'll post here when the endpoints are cut over.

ryanschneider commented 6 years ago

Ok all, the new endpoints are live and are accessible at:

wss://mainnet.infura.io/ws
wss://ropsten.infura.io/ws
wss://rinkeby.infura.io/ws

Again, at-reply me on this issue or create a new one if you run into any issues.

buhrmi commented 6 years ago

Wow, amazing. Thanks so much for providing this...!!!

dellintosh commented 6 years ago

@ryanschneider - first off, thank you for this! I'm having some difficulties getting the new batch requests to work properly, is that functionality available on these new endpoints?

ryanschneider commented 6 years ago

Sorry for the delay @dellintosh, currently we do not support batch requests. I'll add it to our road map to see if it's something we can support in a scalable manner.

chuacw commented 6 years ago

@ryanschneider the new endpoints seem to be much much slower than before. Previously, my webpage retrieves data with the endpoint almost instantaneously (in the sense that data is shown so fast, I couldn't even see it crawl on the screen). Now, I can see the data crawling on the screen.

ryanschneider commented 6 years ago

@chuacw which RPCs are you using? Are these subscriptions or single RPC calls?

maxidev commented 6 years ago

For web3 1.0 usage is there any other RPC url? or we can use: https://mainnet.infura.io/xhy**

rhlsthrm commented 6 years ago

Getting the following error on Web3 1.0 when I try to call a contract function:

Error: Returned error: The method eth_sendTransaction does not exist/is not available

Is sending transactions not supported through the INFURA nodes? I unlocked my account and can sign transactions properly.

CC @ryanschneider

ryanschneider commented 6 years ago

No only eth_sendRawTransaction is supported. sendTransaction would require us to have access to your private key. You'll need to create and sign the tx locally and then send it via eth_sendRawTransaction.

See: https://github.com/INFURA/infura/wiki/FAQ

rhlsthrm commented 6 years ago

@ryanschneider thanks for the quick response! I'm trying to interact with contracts through raw Web3. I did it through Truffle before with their abstraction, but now I am trying to use raw Web3. I'll have to see if there's a way to do it with the raw transaction.

eccheung4 commented 6 years ago

@ryanschneider I'm getting this error when trying to use getPastEvents on the wss://rinkeby.infura.io/ws

Error: CONNECTION ERROR: Couldn't connect to node on IPC.
    at Object.InvalidConnection (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/web3-core-helpers/src/errors.js:35:16)
    at WebsocketProvider._timeout (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/web3-providers-ws/src/index.js:192:48)
    at W3CWebSocket.connection.onclose (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/web3-providers-ws/src/index.js:96:15)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onClose (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/websocket/lib/W3CWebSocket.js:228:10)
    at WebSocketConnection.<anonymous> (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/websocket/lib/W3CWebSocket.js:201:17)
    at emitTwo (events.js:125:13)
    at WebSocketConnection.emit (events.js:213:7)
    at WebSocketConnection.handleSocketClose (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/websocket/lib/WebSocketConnection.js:382:14)
    at emitOne (events.js:120:20)
    at TLSSocket.emit (events.js:210:7)
    at _handle.close (net.js:547:12)
    at TCP.done [as _onclose] (_tls_wrap.js:356:7)

Using code similar to this:

  const provider = `wss://rinkeby.infura.io/ws`
  let web3 = new Web3(new Web3.providers.WebsocketProvider(provider))
  let contract = new web3.eth.Contract(contractAbi, contractAddress);

  contract.getPastEvents('allEvents',
    {fromBlock: 0,  toBlock: 'latest'},
    (error, logs) => {
    if (error) console.error(error);
    logs.forEach(log => {
        // Do something with log
    })
  })
davidboom95 commented 6 years ago

@eeccheung4 same problem here

ryanschneider commented 6 years ago

@eccheung4 what happens if you use a smaller known block range (e.g. the first couple of blocks when you contract was published)? I'm trying to diagnose where in the stack tis might be failing.

Thanks!

eccheung4 commented 6 years ago

@ryanschneider contract deployed at block 1168155, https://rinkeby.etherscan.io/tx/0x532120c88552b3598fccfa113fdccf1b0f3fd52888a9f714f380d8f1984d10cf

I tried setting fromBlock: 1168150, but got same error.

Related issue, but looks to be fixed for ropsten: https://github.com/INFURA/infura/issues/54

ryanschneider commented 6 years ago

@eccheung4 can you try this endpoint instead:

wss://rinkeby.infura.io/_ws

It's not as scalable of an endpoint, but is implemented slightly differently so would help me pinpoint what might be the cause.

eccheung4 commented 6 years ago

@ryanschneider yes, using that endpoint worked as before. I'm not getting that error anymore.

DeRain commented 6 years ago

Hello @egalano, could you kindly send me access to ws endpoint? My email kirill.b@smartum.pro - thanks!

eccheung4 commented 6 years ago

@DeRain

Links are public now:

wss://mainnet.infura.io/ws
wss://ropsten.infura.io/ws
wss://rinkeby.infura.io/ws
MAVRO2 commented 6 years ago

Hi all, i can't connect to infura's websocket

const provider = 'wss://mainnet.infura.io/ws';
let web3 = new Web3(new Web3.providers.WebsocketProvider(provider))
let contract = new web3.eth.Contract(abi, contractAddress);

connection not open on send() Error: connection not open

I tried this from 2 different servers

MAVRO2 commented 6 years ago

Anybody here?

egalano commented 6 years ago

@MAVRO2 I'm able to connect fine. Please use this script to test your setup:

#!/usr/bin/env node
const Web3 = require('web3');

const web3 = new Web3(new Web3.providers.WebsocketProvider('wss://mainnet.infura.io/ws'));

const subscription = web3.eth.subscribe('newBlockHeaders', (error, blockHeader) => {
  if (error) return console.error(error);

  console.log('Successfully subscribed!', blockHeader);
}).on('data', (blockHeader) => {
  console.log('data: ', blockHeader);
});

// unsubscribes the subscription
subscription.unsubscribe((error, success) => {
  if (error) return console.error(error);

  console.log('Successfully unsubscribed!');
});
wnz99 commented 6 years ago

Will Kovan be supported?