Giter Site home page Giter Site logo

lnd-engine's Introduction

sparkswap - sparkswap.com

CircleCI

Sparkswap LND Engine

The following repo contains 2 modules that make up a Sparkswap Payment Channel Network Engine:

  1. NPM module w/ LND abstraction layer (located in src)
  2. Dockerfiles for all containers needed for the LND Engine to run on a broker daemon

A current docker setup a functional BTC/LTC LND Engine:

  1. Bitcoin node (currently bitcoind)
  2. LND BTC node (Sparkswap fork)
  3. Litecoin node (currently litecoind)
  4. LND LTC node (Sparkswap fork)

Installation (lnd-engine only)

The following commands will install dependencies, import associated proto files for the lnd-engine codebase and will build all docker images

npm run build

To run tests, use npm run test

Installation w/ Docker

The lnd-engine docker files make use of Docker's internal image storage (to replicate the functionality of docker hub locally). Run the npm run build command to update all docker images on your local docker installation.

Library Usage

const LndEngine = require('lnd-engine')

const engineOptions = {
  logger: ...,
  tlsCertPath: /absolute/path/to/tls/cert, // required
  macaroonPath: /absolute/path/to/macaroon, // required
}

const engine = new LndEngine('0.0.0.0:10009', 'BTC', engineOptions)

engine.getUncommittedBalance.... etc

API

Documentation is up-to-date as of v0.2.0-alpha-release

NOTE: Please see detailed documentation at sparkswap.com/docs/engines/lnd

Healthcheck

isAvailable
validateEngine

Addresses

createNewAddress
getPaymentChannelNetworkAddress
getPublicKey

Invoices

createInvoice
createRefundInvoice
getInvoiceValue
getInvoices
isInvoicePaid
payInvoice

Cross-Chain Atomic Swaps

createSwapHash
executeSwap
getSettledSwapPreimage
prepareSwap
translateSwap

Balances

getConfirmedBalance
getUncommittedBalance
getTotalChannelBalance
getUnconfirmedBalance
isBalanceSufficient
getTotalPendingChannelBalance
getUncommittedPendingBalance
getPendingChannelCapacities
getOpenChannelCapacities
getMaxChannel
getMaxChannelForAddress

Channels

createChannel
numChannelsForAddress
closeChannels
getChannelsForRemoteAddress
connectUser
getPeers

Wallets

withdrawFunds
changeWalletPassword

License

The Sparkswap LND Engine is licensed under the MIT License.

lnd-engine's People

Contributors

treygriffith avatar dannypaz avatar martineehrlich avatar clark800 avatar bradleystachurski avatar dependabot-preview[bot] avatar greenkeeper[bot] avatar zallarak avatar

Stargazers

Jimmy avatar  avatar Corey avatar G avatar Han Hua avatar Alessio Delmonti avatar  avatar Mike Ghen avatar  avatar  avatar Will Pankiewicz avatar Ian Macalinao avatar  avatar Zick avatar Pradyuman Vig avatar Donely Gunn avatar David Michael avatar Joel avatar  avatar  avatar  avatar  avatar  avatar Andrejs Agejevs avatar shane.stars avatar  avatar  avatar Sylvain Tissier avatar Marco Jardim avatar  avatar [sCRiPTz-TEAM] avatar WENDEL avatar

Watchers

James Cloos avatar  avatar WENDEL avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.