Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Ripple Quick Start Guide

You're reading from  Ripple Quick Start Guide

Product type Book
Published in Dec 2018
Publisher Packt
ISBN-13 9781789532197
Pages 160 pages
Edition 1st Edition
Languages
Author (1):
Febin John James Febin John James
Profile icon Febin John James

First Ripple application

In our first application, we'll write a simple program to connect to the network and fetch the account details of a specific Ripple address.

Here's the code that connects to the Ripple test network and fetches the account details of the address: 'r41sFTd4rftxY1VCn5ZDDipb4KaV5VLFy2'. Let's run this code first and then get into the details to learn how it works. Save the following code into a file and give it the name 'get_account.js':

'use strict';
const RippleAPI = require('ripple-lib').RippleAPI;

const api = new RippleAPI({
server: 'wss://s.altnet.rippletest.net:51233' // Ripple Test Network Address
});

api.connect().then(() => {
const accountAddress = 'r41sFTd4rftxY1VCn5ZDDipb4KaV5VLFy2';

console.log('Fetching account details of', accountAddress);
return api.getAccountInfo...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}