Skip to main content

Extract custom metadata records that may have been attached to lightning payments you received

Project description

⚡️📝 TLV Payment Metadata Records Parser for LND

Extract custom TLV payment metadata records that may have been attached to lightning payments you received. For example, you can extract boostagrams from payments received through value-for-value podcasting apps.

For more information, see the release notes of LND's v0.9 release.

Installation

Make sure you have up-to-date installations of pip and setuptools:

pip install --upgrade pip
pip install --upgrade setuptools

Then install the lntlvs CLI:

pip install lntlvs

Examples

By default, only podcast metadata will be extracted. To query the first 100 payments on your node, run:

lntlvs --maxinvoices 100

To queriy from the next 100 payments, run:

lntlvs --maxinvoices 100 --indexoffset 100

To extract another type of custom records other than podcast metadata, specify the --tlvkey option. To extract multiple types of custom records, repeat this option multiple times. See here for a list of TLV keys used in the open.

lntlvs --tlvkey 7629171 --tlvkey 7629169 # Extract tip note and podcast metadata

Usage

Usage: lntlvs [OPTIONS]

  Extract custom metadata records that may have been attached to lightning payments you received.

Options:
  --tlscertpath <value>   Path to the TLS certificate for lnd's RPC service  [default: ~/.lnd/tls.cert]
  --macaroonpath <value>  Path to the (read-only) macaroon for lnd's RPC service  [default: ~/.lnd/data/chain/bitcoin/mainnet/readonly.macaroon]
  --rpchost <value>       The address and port where lnd's RPC service is listening  [default: 127.0.0.1:10009]
  --tlvkey <value>        A TLV key to extract - can be specified multiple times  [default: 7629169]
  --indexoffset <value>   Query for invoices starting at (not including) this offset  [default: 0]
  --maxinvoices <value>   The maximum number of invoices to query  [default: 1000]
  --help                  Show this message and exit.

Development

Create a virtual environment:

python -m venv .venv && source .venv/bin/activate

Install production and development dependencies:

pip install -e ".[dev]"

Re-generating gPRC Code

If required, update the LND interface definition in src/protobuf/custom_records/generated/lightning.proto by running:

src/protobuf/update.sh

Then re-generate the gPRC code with:

src/protobuf/generate.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lntlvs-0.0.1.tar.gz (79.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lntlvs-0.0.1-py3-none-any.whl (81.2 kB view details)

Uploaded Python 3

File details

Details for the file lntlvs-0.0.1.tar.gz.

File metadata

  • Download URL: lntlvs-0.0.1.tar.gz
  • Upload date:
  • Size: 79.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for lntlvs-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4df8146df7de36f60ccc36cc224f56b4ed3668c7297f668b4b8f95d030161fd9
MD5 b95aff6fbfd9f75074786c985d713dd6
BLAKE2b-256 1c9115b3c9eabc99e4ec9cbd6162aeb11f9b8222aaa2aa874b4c9bb71037fcd3

See more details on using hashes here.

File details

Details for the file lntlvs-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lntlvs-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 81.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for lntlvs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39e1ed3b813c33dddf66ad06c0defacf2eb77362ec79292fa5d08fb4b7478919
MD5 5cfb91923a64f287b81b375e400ef0e6
BLAKE2b-256 f5561227e83b0a9899536642ccba8023499bec72dc8d60d1483599389e50b93f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page