ripple / ripple-lib-extensions

[Deprecated] A collection of extensions to ripple-lib. Instead, see https://github.com/XRPLF/xrpl.js
https://github.com/XRPLF/xrpl.js
22 stars 31 forks source link

How to use ripple-lib-extension #29

Open tuloski opened 7 years ago

tuloski commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

Noone? @shekenahglory ?

shekenahglory commented 7 years ago

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.

tuloski commented 7 years ago

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! ripple-lib-orderbook@0.1.1 prepublish: npm run clean && npm run compile npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ripple-lib-orderbook@0.1.1 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 commented 7 years ago

None?

tuloski commented 7 years ago

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

alandotcom commented 7 years ago

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

tuloski commented 7 years ago

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?

alandotcom commented 7 years ago

Yea, just paste it all into a gist and link to it here On Thu, Mar 23, 2017 at 3:24 PM tuloski notifications@github.com 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 .

tuloski commented 7 years ago

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

It's 30k lines :)

alandotcom commented 7 years ago

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

tuloski commented 7 years ago

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

inmyth commented 7 years ago
  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);
    });
    });
tuloski commented 7 years ago

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

inmyth commented 7 years ago

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

r0bertz commented 5 years ago

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