6

I've recently started to use Truffle to automate/speed up my development.

As I'm still getting the grasp of it I've come up with a barrier when trying to use INFURA for migrations.

INFURA nodes don't answer to blockFilter requests and as so migrations in Truffle don't work as stated in their Truffle + INFURA integration post.

Any ideas on how to make this work besides changing Truffle's code to polling instead of receiving events? :)

EDIT: After searching for any solution to validate deployment of contracts I just settled for Augur's great public node that exposes filter methods.

3 Answers 3

5

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.

A while ago we modified our architecture, so load balancers are not the issue.

I'll check with the Truffle team about their use of filters and update this post.

0
2

Adding a FilterSubrovider from web3-provider-engine to the engine in your truffle.js will allow you to deploy the contract to Ropsten, I have not tried this on the mainnet.

const FilterSubprovider = require('web3-provider-engine/subproviders/filters.js')
engine.addProvider(new FilterSubprovider())
1

Infura doesn't give you your own node. Instead they're running a load-balancer in front of a pool of shared nodes. That's why they disallow state-modifying calls.

I would suggest you to look into: https://github.com/MetaMask/provider-engine It allows you to handle some RPC calls completely client-side.

1
  • I know about web3-provider-engine and actually it is used in Truffle (or at least a fork of that). It does serve the purpose and accept newFilter calls, INFURA is the problem here. As it isn't capable of handling state modifying calls this simply can't be done client side. I realized not even MetaMask could do that for me! :)
    – GNSPS
    Feb 4, 2017 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.