The following repo contains 2 modules that make up a Sparkswap Payment Channel Network Engine:
- NPM module w/ LND abstraction layer (located in
src
) - 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:
- Bitcoin node (currently bitcoind)
- LND BTC node (Sparkswap fork)
- Litecoin node (currently litecoind)
- LND LTC node (Sparkswap fork)
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
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.
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
Documentation is up-to-date as of v0.2.0-alpha-release
NOTE: Please see detailed documentation at sparkswap.com/docs/engines/lnd
isAvailable
validateEngine
createNewAddress
getPaymentChannelNetworkAddress
getPublicKey
createInvoice
createRefundInvoice
getInvoiceValue
getInvoices
isInvoicePaid
payInvoice
createSwapHash
executeSwap
getSettledSwapPreimage
prepareSwap
translateSwap
getConfirmedBalance
getUncommittedBalance
getTotalChannelBalance
getUnconfirmedBalance
isBalanceSufficient
getTotalPendingChannelBalance
getUncommittedPendingBalance
getPendingChannelCapacities
getOpenChannelCapacities
getMaxChannel
getMaxChannelForAddress
createChannel
numChannelsForAddress
closeChannels
getChannelsForRemoteAddress
connectUser
getPeers
withdrawFunds
changeWalletPassword
The Sparkswap LND Engine is licensed under the MIT License.