mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 21:15:47 +00:00
2.0 KiB
2.0 KiB
#The Ripple JavaScript Library
ripple-lib connects to the Ripple network via the WebSocket protocol and runs in Node.js as well as in the browser.
###In this file:
- Overview
- Getting
ripple-lib - Quickstart
- Running tests
###For additional documentation see:
- The
ripple-libGuides (docs/GUIDES.md) - The
ripple-libAPI Reference (docs/REFERENCE.md) - https://ripple.com/wiki/Ripple_JavaScript_library
###Also see:
##Getting ripple-lib
- Via npm for Node.js:
npm install ripple-lib - Build from the source using
gruntand load the minifiedripple-#.#.#-min.jsinto your webpage
##Quickstart
Remote (remote.js) is the module responsible for managing connections to rippled servers:
/* Loading ripple-lib with Node.js */
var Remote = require('ripple-lib').Remote;
/* Loading ripple-lib in a webpage */
// var Remote = ripple.Remote;
var remote = new Remote({
// see the API Reference for available options
trusted: true,
local_signing: true,
local_fee: true,
fee_cusion: 1.5,
servers: [
{
host: 's1.ripple.com'
, port: 443
, secure: true
}
]
});
remote.connect(function() {
/* remote connected */
// see the API Reference for available functions
});
See The ripple-lib Guides and The ripple-lib API Reference for walkthroughs and details about all of the available functions and options.
##Running tests
-
Clone the repository
-
cdinto the repository and install dependencies withnpm install -
npm testormake test
Generating code coverage
ripple-lib uses jscoverage to generate code coverage. To generate a file coverage.html, run make coverage