3

I am running into the same issue proposed by this question. I cannot resolve it because I am using a remote provider (INFURA), per this document.

My code looks like this:

var ethwallet = require('ethereumjs-wallet');
var ProviderEngine = require("web3-provider-engine");
var WalletSubprovider = require('web3-provider-engine/subproviders/wallet.js');
var Web3Subprovider = require("web3-provider-engine/subproviders/web3.js");
var Web3 = require("web3");

// Import the raw private key of the admin
const keys = require('../test/keystores/keys.json');
const admin_key = keys.admin.privateKey;
const admin_addr = keys.admin.address;

// Add the admin key to the provider. This will unlock the account so it can
// deploy the contracts and run the tests.
var wallet = ethwallet.fromPrivateKey(Buffer.from(admin_key, 'hex'));
var engine = new ProviderEngine();

// Start the infuranet provider
var infuranet = "https://infuranet.infura.io";
var engine = new ProviderEngine();
engine.addProvider(new WalletSubprovider(wallet, {}));
engine.addProvider(new Web3Subprovider(new 
Web3.providers.HttpProvider(infuranet)));
engine.start();

module.exports = {
  networks: {
    infura: {
      network_id: 5810,
      provider: engine,
      from: admin_addr
    },
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*"
    }
  }
};

And I am running:

truffle migrate --network infura

Which hangs indefinitely. This also happens if I run:

truffle compile --network infura

Or any other truffle action.

Is it possible to run this without a local node? I would like to deploy these to this network using the remote INFURA provider.

1
  • 1
    Instead of using infuranet.infura.io try with the url obtained when you registered to infura service.
    – Ismael
    Commented Aug 23, 2017 at 1:56

1 Answer 1

1

The answer to this problem should be adding two more lines, which you can find in the last answer here.

Your Answer

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

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