Socket
Socket
Sign inDemoInstall

lightning

Package Overview
Dependencies
80
Maintainers
1
Versions
328
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lightning

Lightning Network client library


Version published
Weekly downloads
4.7K
decreased by-5.78%
Maintainers
1
Install size
15.2 MB
Created
Weekly downloads
 

Changelog

Source

10.9.2

  • Add support for LND v0.17.5-beta

Readme

Source

Lightning

npm version

Methods for working with the Lightning Network

Selected Projects using Lightning

LND Authentication

To connect to an LND node, authentication details are required.

Export credentials via CLI: balanceofsatoshis: npm install -g balanceofsatoshis and export via bos credentials --cleartext

Or export them manually:

Run base64 on the tls.cert and admin.macaroon files to get the encoded authentication data to create the LND connection. You can find these files in the LND directory. (~/.lnd or ~/Library/Application Support/Lnd)

base64 -w0 ~/.lnd/tls.cert
base64 -w0 ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

You can then use these to interact with your LND node directly:

const {authenticatedLndGrpc} = require('lightning');

const {lnd} = authenticatedLndGrpc({
  cert: 'base64 encoded tls.cert file',
  macaroon: 'base64 encoded admin.macaroon file',
  socket: '127.0.0.1:10009',
});

To access unauthenticated methods like the wallet unlocker, use unauthenticatedLndGrpc instead.

Debugging

If you encounter any issues connecting and wish to view detailed information about the underlying grpc calls, you can run Node with these environment variables set:

GRPC_VERBOSITY=DEBUG GRPC_TRACE=all node YOURSCRIPTNAME.js

Methods

Keywords

FAQs

Last updated on 24 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc