Consensys / eth-lightwallet

Lightweight JS Wallet for Node and the browser
MIT License
1.47k stars 503 forks source link

None of the example works #174

Closed gregbkr closed 6 years ago

gregbkr commented 6 years ago

Hello,

I am new to ethereum, and I try to make the examples provided work. So far no luck:

git clone https://github.com/ConsenSys/eth-lightwallet/ && cd eth-lightwallet
node install

Open browser to example/example_demo_video.html, enter a seed "unhappy nerve cancel reject october fix vital pulse cash behind curious bicycle" and push setseed:

lightwallet.min.js:37 Uncaught TypeError: Cannot read property 'length' of null
    at PBKDF2_HMAC_SHA256_OneIter (lightwallet.min.js:37)
    at scrypt (lightwallet.min.js:37)
    at Function.KeyStore.deriveKeyFromPasswordAndSalt (lightwallet.min.js:1)
    at Function.KeyStore.createVault (lightwallet.min.js:1)
    at newWallet (webwallet.html:95)
    at HTMLButtonElement.onclick (webwallet.html:155)

I tried to debug with:

    <script type="text/javascript" src="https://rawgit.com/ConsenSys/eth-lightwallet/master/dist/lightwallet.min.js"></script>
    <script type="text/javascript" src="https://rawgit.com/ethereum/web3.js/develop/dist/web3.js"></script>
    <script type="text/javascript" src="https://rawgit.com/ConsenSys/hooked-web3-provider/master/build/hooked-web3-provider.js"></script>
...
var seed = "unhappy nerve cancel reject october fix vital pulse cash behind curious bicycle"
var keystore = new lightwallet.keystore(seed, 'test')
console.log(keystore)
keystore.generateNewAddress('test', 1)   <-- error seems here

Uncaught TypeError: Cannot read property 'encStr' of undefined
    at Function.KeyStore._decryptString (lightwallet.min.js:1)
    at KeyStore.isDerivedKeyCorrect (lightwallet.min.js:1)
    at KeyStore.generateNewAddress (lightwallet.min.js:1)
    at setSeed (webwallet.html:33)
    at HTMLButtonElement.onclick (webwallet.html:66)

Any help is very appreciated! Thank you. Greg

coder5876 commented 6 years ago

Hi @gregbkr, ah those examples have not been updated to the new version. The file webwallet.html should be updated though so you can check that one out in the meantime!

gregbkr commented 6 years ago

Hello @christianlundkvist and thank you!

The example: https://github.com/ConsenSys/eth-lightwallet/blob/master/example/webwallet.html is working.

I was using brave browser. Seems like none is working on brave. Switched to chrome for these tests.

Thanks for your help! Greg.

bitcoin4cashqc commented 6 years ago

hum could you post some dev console log or some debug? Maybe javascript disabled? I made a webview android app and web3.js and lightwallet work with good.