Skip to content

A Node.js RPC client for lightningnetwork/lnd ⚡️

License

Notifications You must be signed in to change notification settings

treygriffith/lnrpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

LNRPC

Latest synced to [email protected].

Generates a Lightning Network RPC client directly from github.com/lightningnetwork/lnd. Lnrpc is versioned in step with lnd, please see release branches: release/v*.*.*;

Installation

yarn add lnrpc

# Or
npm i lnrpc -S

For best results, be sure to install lnd before using this project and ensure you have an lnd instance running.

Usage

Connecting to an lnd instance at localhost:10001.

const createLnrpc = require('lnrpc');

(async function() {
  const lnrpc = await createLnrpc();

  // All requests are promisified
  const balance = await lnrpc.walletBalance({witness_only: true});

  // ...and you're off!
  console.log(balance);
})();

Options

const createLnrpc = require('lnrpc');

(async function() {
  const lnrcpCustom = await createLnrpc({
    /*
     By default lnrpc connects to `localhost:10001`,
     however we can point to any host.
     */
    server: '173.239.209.2:3001',

    /*
     By default  lnrpc looks for your tls certificate at:
     `~/.lnd/lnd.conf`, unless it detects you're using macOS and
     defaults to `~/Library/Application\ Support/Lnd/tls.cert`
     however you can configure your own SSL certificate path like:
     */
     tls: './path/to/tls.cert',

    /*
     You can also provide a TLS certificate directly as a string
     (Just make sure you don't commit this to git).
     Overwrites: `tls`
     */
    cert: process.env.MY_SSL_CERT
  });
})();

API Reference

All lnrpc methods documentation can be found here.

Contributors

To develop on the project please run:

git clone [email protected]:Matt-Jensen/lnrpc.git && cd $_
yarn
npm run start

License

This project is licensed under the MIT License.

About

A Node.js RPC client for lightningnetwork/lnd ⚡️

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%