Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christoph2806/e95d6c4ae0aeece949c84d5563720b27 to your computer and use it in GitHub Desktop.
Save christoph2806/e95d6c4ae0aeece949c84d5563720b27 to your computer and use it in GitHub Desktop.
These are the tweaks I had to perform to get uport running on meteor (at least to the point that QR-Code is shown) :
* Create an empty working dir ($wd). Install meteor skeleton (I use meteorkitchen)
* Install uport-lib:
* $wd> meteor npm install --save git://github.com/ConsenSys/uport-lib.git#release-2.1.1
* $wd> cd node_modules/uport-lib
* $wd/node_modules/uport-lib> npm install
* [now edit package.json with your favorite editor and insert the following line in the section "scripts", around line 239:
"build-commonjs": "babel src -d lib --plugins transform-es2015-modules-commonjs",
]
* $wd/node_modules/uport-lib> npm run build-commonjs
* $wd/node_modules/uport-lib> cd node_modules/sshpk
* $wd/node_modules/uport-lib/node_modules/sshpk> npm install
* $wd/node_modules/uport-lib/node_modules/sshpk> cd ../..
* $wd/node_modules> sudo rm -r crypto (somehow, an outdated crypto lib is required by jsontoken)
* $wd/node_modules> cd jsontoken
* $wd/node_modules/jsontoken> [edit the package.json and remove crypto@0.0.3 from the dependencies (around line 57)]
* $wd/node_modules/jsontoken> cd ../sshpk
* $wd/node_modules/sshpk> npm install
Now in your Meteor code, in some xyz_view.js insert:
up = require('uport-lib');
Template.TEMPLATE_NAME.events({
'click #connect_uport': function () {
var uport = new up.Uport('FriendWallet');
var web3 = uport.getWeb3();
uport.getUserPersona()
.then(function (persona) {
console.log(persona.profileAddress);
console.log(persona.profile);
});
}
});
You should at least see your QR-Codes now.
Good luck!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment