ripple-lib-extensions
ripple-lib-extensions copied to clipboard
How to use ripple-lib-extension
Hi guys, sorry my ignorance in js and npm and so on, but I'm not able to use this library. I have a root folder with the package.json to use RippleAPI, where all the node-modules were created. Now I cloned this ripple-lib-extension into the root folder and?? If I try to use RippleOrderbook it sais it is not defined. Should I add something into the package.json and do some npm install?
I tried npm install inside the "orderbook" folder and the "value", but both fail. I have node 5.8.0 and npm version 4.0.2.
Noone? @shekenahglory ?
are you looking to use the orderbook in node or browser? navigate to the orderbook directory then run npm install
- it should compile to the dist/npm
directory. For browser, you need the extra step of running gulp
, which will compile to the dist/web
directory.
I tried that but I get:
npm ERR! Linux 3.10.92-71
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.8.0
npm ERR! npm v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prepublish: npm run clean && npm run compile
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script 'npm run clean && npm run compile'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ripple-lib-orderbook package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run clean && npm run compile
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ripple-lib-orderbook
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ripple-lib-orderbook
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /home/odroid/RippleAPI_BOTS/ripple-lib-extensions/orderbook/npm-debug.log
None?
Is there someone still maintaining ripple-lib and ripple-lib-extensions?
@tuloski can you try running npm install
with --verbose
?
Tell the author that this fails on your system: npm ERR! babel -D --optional runtime -d dist/npm/ src/
It is not able to compile.
@lumberj it is of course printing lots of stuff with --verbose. Are you interested in some of them?
Yea, just paste it all into a gist and link to it here On Thu, Mar 23, 2017 at 3:24 PM tuloski [email protected] wrote:
Tell the author that this fails on your system:
npm ERR! babel -D --optional runtime -d dist/npm/ src/
It is not able to compile.
@lumberj https://github.com/lumberj it is of course printing lots of stuff with --verbose. Are you interested in some of them?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/ripple/ripple-lib-extensions/issues/29#issuecomment-288879019, or mute the thread https://github.com/notifications/unsubscribe-auth/ABum5MFlKicVOrtwh8rECy6w6j_34V02ks5rovEogaJpZM4K87Ez .
https://gist.github.com/tuloski/0fb83bac9f3fa78be470d5ed2eca09a2
It's 30k lines :)
It got cut off. Maybe inspect the output for where the error occurs and just share that part
The error is on the last lines....look for ERR!, but basically babel is failing to compile. The dist folder is not created.
- clone the repo
- go to the module directory
- run
npm install
(in my case there were some errors) - refer to the generated files in
dist/npm
const OrderBook = require('./ripple-lib-extensions/orderbook/dist/npm/orderbook').OrderBook;
const altnet = 'ws://s.altnet.rippletest.net:51233';
const api = new RippleAPI({
server: altnet
});
api.connect().then(function() {
var book = OrderBook.createOrderBook(api, {
currency_pays: 'XRP',
issuer_gets: 'rHjGuGDJvKQ2RSLj3WesnxVoKVVhbSwYQL',
currency_gets: 'USD'
});
book.on('model', function(offers) {
console.log(offers);
});
});
@inmyth I have errors and the dist folder is not created
I tried this on Ubuntu 16.04 with node 7.10 and npm 4.2.0. It didn't work on Windows.
One thing to note is ripple-lib-extensions is not the package name. There are 4 packages in the 4 subdirectorries. You can find the package name in package.json. They can be installed with npm, e.g.
npm install -g ripple-lib-orderbook