2

I'm trying to use the Truffle development environment inside of EtherCamp Ethereum Studio.

My main reference is this issue in the Truffle issue tracker. It suggests using eth-lightwallet and hooked-web3-provider with the latest version of Truffle. To do so, it suggests modifying the truffle.js file to look like this:

  var lightwallet = require('eth-lightwallet');
  var HookedWeb3Provider = require("hooked-web3-provider");

  var contents = JSON.stringify(require('./wallet.json'));
  var global_keystore = lightwallet.keystore.deserialize(contents);

  global_keystore.passwordProvider = function(callback) {
    console.log('PWD requested...');
    callback(null, 'test');
  };

  // get the first account in this wallet
  var account = global_keystore.getAddresses()[0];
  console.log('Main account is ', account);

  // create the provider
  var provider = new HookedWeb3Provider({
    host: 'http://1.2.3.4:8545',
    transaction_signer: global_keystore
  });

  module.exports = {
    build: {
      "index.html": "index.html",
      "app.js": [
        "javascripts/app.js"
      ],
      "app.css": [
        "stylesheets/app.css"
      ],
      "images/": "images/"
    },
    verbose: true,
    rpc: {
      provider: provider,
      verbose: true,
      from: account
    }
  }

I did so. But it fails:

The new KeyStore constructor has been deprecated in favor of KeyStore.createVault(), and will be removed in a future version. Read issue #109 for info. https://github.com/ConsenSys/eth-lightwallet/issues/109
TypeError: Cannot convert undefined or null to object
    at Function.keys (native)
    at Function.KeyStore.deserialize (/usr/lib/node_modules/eth-lightwallet/lib/keystore.js:399:42)
    at Object.<anonymous> (/root/workspace/solidity-experiments/truffle.js:5:44)

The 5th line of truffle.js is this: "var global_keystore = lightwallet.keystore.deserialize(contents);".

I'm new to eth-lightwallet, truffle and the whole ethereum scene so I'm kinda lost on how to proceed from here. How can I fix this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.