ripple-lib-extensions icon indicating copy to clipboard operation
ripple-lib-extensions copied to clipboard

How to use ripple-lib-extension

Open tuloski opened this issue 8 years ago • 16 comments

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?

tuloski avatar Nov 26 '16 15:11 tuloski

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.

tuloski avatar Nov 27 '16 14:11 tuloski

Noone? @shekenahglory ?

tuloski avatar Dec 28 '16 22:12 tuloski

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.

shekenahglory avatar Dec 29 '16 22:12 shekenahglory

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

tuloski avatar Jan 08 '17 14:01 tuloski

None?

tuloski avatar Feb 01 '17 18:02 tuloski

Is there someone still maintaining ripple-lib and ripple-lib-extensions?

tuloski avatar Mar 16 '17 08:03 tuloski

@tuloski can you try running npm install with --verbose?

alandotcom avatar Mar 16 '17 14:03 alandotcom

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?

tuloski avatar Mar 23 '17 22:03 tuloski

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 .

alandotcom avatar Mar 24 '17 00:03 alandotcom

https://gist.github.com/tuloski/0fb83bac9f3fa78be470d5ed2eca09a2

It's 30k lines :)

tuloski avatar Mar 24 '17 23:03 tuloski

It got cut off. Maybe inspect the output for where the error occurs and just share that part

alandotcom avatar Mar 25 '17 00:03 alandotcom

The error is on the last lines....look for ERR!, but basically babel is failing to compile. The dist folder is not created.

tuloski avatar Mar 25 '17 12:03 tuloski

  1. clone the repo
  2. go to the module directory
  3. run npm install (in my case there were some errors)
  4. 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 avatar May 23 '17 01:05 inmyth

@inmyth I have errors and the dist folder is not created

tuloski avatar May 24 '17 11:05 tuloski

I tried this on Ubuntu 16.04 with node 7.10 and npm 4.2.0. It didn't work on Windows.

inmyth avatar May 24 '17 23:05 inmyth

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

r0bertz avatar Jan 10 '19 06:01 r0bertz