dcrlnlpd

command module
v0.0.0-...-1a0d1a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: ISC Imports: 27 Imported by: 0

README

DCR LN Liquidity Provider Daemon

This service allows running a Lightning Network Liquidity Provider in the Decred network.

This LP allows remote clients to request the node associated to the LP to open an LN channel back to the requesting client. This allows the requesting client to have some inbound bandwidth to receive LN payments.

To create the channel, the LP charges some amount, specified as a percentage of the desired channel size.

NOTE: This software takes control of the outbound channels created by this node, such that it will close any channels that do not conform to its policy, even ones not created by it (e.g. manually created channels). See below for a discussion on the closing policy.

Building & Running

Requires Go 1.17+. Download the code, then run

$ go install .
$ dcrlnlpd

Configuration

A default config file is created in ~/.dcrlnlpd/dcrlnlpd.conf if it does not exist. CLI parameters can be found by running -h/--help.

Channel Closing Policy

The policy to decide whether to close a channel is:

  (totalSentAtoms / lifetime) >= (requiredSentAtoms / requiredInterval)

This policy is evaluated every closepolicy.checkinterval (default: 1 hour) and only for channels which have a lifetime greater than closepolicy.minchanlifetime.

What this means is that every time the check is evaluated, every channel must have had some minimum amount of atoms sent through it, otherwise it is closed.

With the default settings, the channel must have had at least 0.001 DCR sent through it every 24 hours, otherwise it will be closed. This policy is easily tweaked by changing the appropriate config entries.

Client

A client implementation is available in the github.com/decred/dcrlnlpd/client package. A CLI client is also provided in the cmd/client subdir.

An example invocation of the CLI client is the following:

go run ./cmd/client/ \
  --lnrpchost localhost:20100 \
  --lntlscertpath ~/dcrlndsimnetnodes/dcrlnd1/tls.cert \
  --lnmacaroonpath ~/dcrlndsimnetnodes/dcrlnd1/chain/decred/simnet/admin.macaroon \
  --addr http://localhost:29130 \
  --chansize 0.001

License

dcrlnlpd is licensed under the copyfree ISC License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
version
Package version provides a single location to house the version information for dcrlnlpd and other utilities provided in the same repository.
Package version provides a single location to house the version information for dcrlnlpd and other utilities provided in the same repository.
rpc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL