ln-charts parses the output of bos accounting commands into various charts for your Lightning Node.

Overview

image

ln-charts

ln-charts parses the output of bos accounting commands into various charts for your Lightning Node. It runs on Angular, JS, HTML, CSS, ngx-charts, Ionic Storage and Luxon.

You must have bos which runs on lnd to use this version of ln-charts.

You can run ln-charts locally or access at https://cold-sats.github.io/ln-charts/.

Data Storage

ln-charts stores your data locally in your browser using Ionic Storage. Only you can see the data you upload. It will persist in your browser until you remove it using the "Clear Data" button in the UI.

How to Build Charts

Step 1: Run bos commands on your Lightning node.

bos accounting forwards --month x --year -y --csv
bos accounting chain-fees --month x --year -y --csv
bos accounting payments --month x --year -y --csv
bos accounting invoices --month x --year -y --csv

You can add the --disable-fiat flag if you don't want bos to calculate the fiat values for your reports. ln-charts does not use this fiat value and this will speed things up.

Step 2: Copy and paste the output into ln-charts interface.

Highlight the beginning of the text, scroll a little so scrollbar appears, grab the scrollbar and drag to the bottom (or scroll with the mouse wheel). Then hold shift, tap the end of the text to highlight everything, and copy.

Only paste one report type at a time into ln-charts. You can include the header at the beginning or not. It can take up to a minute to paste large amounts of text. Example report:

"Amount","Asset","Date & Time","Fiat Amount","From ID","Network ID","Notes","To ID","Transaction ID","Type"
-378,"BTC","2022-04-04T17:38:45.000Z",-0.1755226480744611,"","","Channel close: 0:closechannel:shortchanid-794957902071791618 [Chain Fee]","","329f9f7767e4383546ef2942749554f0c1e230f8544db2992261e53d2ec8f365:fee","fee:network"
-292,"BTC","2022-04-04T19:52:57.000Z",-0.13558892390937208,"","","0:openchannel:shortchanid-803136069653233665 [Chain Fee]","","d3e69380718d54bfea8bcf25780fec7e9d2406a2617f044e6c5b51d06fa48a3c:fee","fee:network"

Parsing

ln-charts automatically determines the type of report entered and parses it into multiple charts:

Forwards get parsed into:

  • Forwards - sats earned, count, avg. earning, avg. ppm, avg. earning, sats routed

Chain Fees get parsed into:

  • Chain Fees - sats spent, count, avg. size

Payments get parsed into:

  • Payments - sats sent, count, avg. size
  • Rebalance Fees - sats sent, count, avg. size
  • Lightning Fees (doesn't include rebalance fees) - sats sent, count, avg. size

Invoices get parsed into:

  • Keysends - sats received, count, avg. size

All charts are then summed into a profit chart:

  • Profit = forward earnings + keysends - chain fees - rebalance fees - lightning fees - payments

Exclude Lists

ln-charts has an exclude list for payments and keysends. Use it to filter out events you don't want to see in charts.

Payments Exclude List

Paste the text from the "Notes" column of the bos payments report. Example: Wallet of Satoshi

Keysends Exclude List

Paste the text from the "Amount" column of the bos invoices report. Example: 2000000

How to Determine What to Exclude

  1. Paste the bos accounting reports into Google Sheets
  2. Select the column -> Data -> Split text to columns
  3. Select all columns -> Data -> Create filter

Now you can filter the columns and browse much easier. Browse invoices report for keysends (noted as [Push Payment]). Then scan payments report for payments with unique notes.

Running Locally

Use Angular CLI to run ln-charts locally on your computer. The data you save will persist between sessions.

Clone the repo and navigate to it:

git clone https://github.com/cold-sats/ln-charts
cd ln-charts

Install and start npm (if you don't already have npm):

npm install
npm start

Install Angular CLI globally:

npm install -g @angular/cli

Run on http://localhost:4200/#/:

ng serve --open

When running locally you have the option to save your data in the bos-data directory instead of inputting it into the UI and saving in cache. Only use one type of data storage at a time (either project files or inputting into UI).

When running locally you can also save keysends / payments exclude list items in the csv-parser provider.

ln-charts uses Google Analytics to track usage. If you prefer to not allow this, pull the no-google-analytics branch which does not include that.

Backing Up Your Data

I recommend maintaining a local backup of all of your bos accounting data (if you don't run ln-charts locally and save your data in the project folders). You can export stored data as a .txt using the "Export" button shown next to each report in the UI.

Contributing

Contributions are welcome! Let me know if you find bugs or have ideas. Create an issue or PR.

If you enjoy ln-charts and want to donate please keysend:

bos send 020a3dce2dab038955eb435a8342e4fe897304015314485d3738d5f41eccb47859 --amount 1000 --message "Thanks for ln-charts!"
Comments
  • Add feature to filter channels for Forwards graph

    Add feature to filter channels for Forwards graph

    Currently, bos accounting forwards --csv output has forwarding data for an entire node without the ability to filter channels. Filtering Channel ID's would allow you to analyze the forwarding data of a group channels.

    opened by Sats-Magnetic 0
  • Export CSV for each report

    Export CSV for each report

    Right now user can only export the raw CSV for each of the 4 bos reports.

    Add a "Charts" section at the bottom of the "Add Data" page which lists each chart (looks just like the "Saved Data" section), with an export text link next to each. When clicked export the raw CSV data for that chart.

    Also move the payments and keysends exclude list text links to this charts section.

    opened by cold-sats 0
  • Clear data button for each report

    Clear data button for each report

    In the add data page - add a text link "Clear" next to each report type. When clicked, show an "Are you sure", then when confirmed clear the data for just that report type.

    opened by cold-sats 0
  • Don't allow identical data

    Don't allow identical data

    When user uploads a new bos accounting report, check if any of the rows are identical (i.e. the user likely made a mistake in pasting a month they have already pasted, or copied the same month twice)

    If there are identical rows, do not upload the data and throw an error: "Unable to upload. Some of the data you added redundant."

    opened by cold-sats 0
  • Better minimum screen width handling

    Better minimum screen width handling

    Current behavior: the add data + exclude list pages wrap to the bottom when you resize the browser past a certain point.

    New behavior: at this point instead hide the content on the right that won't fit and show a horizontal scrollbar

    image
    opened by cold-sats 0
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Node IPC 43 Dec 9, 2022
This project will be using various AI and Rule Engine algorithm to detect various attack against a company!

?? Introduction This project will be using various AI and Rule Engine algorithm to detect various attack against a website! ?? Mission After starting

Harish S.G 4 Apr 29, 2022
All terminal commands in one place (you can Contribute to it by putting latest commands and adding Readme)

Terminal-Commands All basic terminal commands in one place Show some ❤ by some repositories You can contribute to this readme If you to contribute wit

Shehzad Iqbal 7 Dec 15, 2022
Automaticly parses known pocket ips patch resources, scans folders or zip files for matching roms and applies the patches.

Pocket Automaton Automaticly parses known pocket ips patch resources, scans folders or zip files for matching roms and applies the patches. Usage pock

null 3 Nov 27, 2022
Discovers and parses news, blog and podcast posts from any website

post-feed-reader A library to fetch news, blog or podcast posts from any site. It works by auto-discovering a post source, which can be an RSS/Atom/JS

Guilherme Chaguri 4 Mar 14, 2022
Parses natural language to date schedules.

DateParrot DateParrot parses natural language into a unified schedule object or ISO date. This package is in a very early stage and not yet production

Jörg Bayreuther 7 Aug 3, 2022
parses human-readable strings for JavaScript's Temporal API

?? temporal-parse What is the temporal-parse? Temporal is the next generation of JavaScript's standard Date API. It's currently proposed to TC39 (see:

Eser Ozvataf 22 Jan 2, 2023
Simple yet flexible charting Lightning Web Component using Chart.js for admins & developers

Lightning Web Chart.js Component Simple yet flexible charting Lightning Web Component using Chart.js for admins & developers Documentation Getting sta

@SalesforceLabs 109 Dec 9, 2022
A website for tracking community support for BIP21 QR codes that support on-chain and lightning bitcoin payments.

BIP21 Microsite This is a WIP microsite to promote the usage of a BIP21 payment URI QR code that can include lightning invoices or offers. Wallet supp

Stephen DeLorme 16 Nov 27, 2022
🦆 lightning fast duckdb bindings for bun runtime

@evan/duckdb lightning fast duckdb bindings for bun runtime Install bun add @evan/duckdb Features ?? batteries included ?? jit optimized bindings ?? 4

evan 29 Oct 20, 2022
Web app that generates BOLT11 invoices from an LNURL or Lightning Address.

LNURL Pay ⚡️ Web app that generates BOLT11 invoices from an LNURL or Lightning Address. Getting Started First, run the development server: npm run dev

Sam Samskies 7 Nov 3, 2022
A tiny, lightning fast jQuery-like library for modern browsers.

Sprint.js Sprint is a high-performance, 5KB (gzipped) DOM library for modern browsers. Sprint notably shines on bandwidth and resource constrained dev

Benjamin De Cock 4.3k Jan 3, 2023
A boilerplate project to build proof of concept paywalls with lightning service authentication tokens (LSATs)

lsat-workshop-boilerplate A boilerplate project to build proof of concept paywalls with lightning service authentication tokens (LSATs) Install Setup

Buck Perley 2 Oct 13, 2022
⚡️ Lightning Time: a new way to measure time

Lightning Time ⚡️ Lightning Time ⚡️ is a new way to measure time. It's a spin on hexadecimal time: the day is split into 16 parts over and over. The f

Purdue Hackers 7 Nov 22, 2022
A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file

Welcome to the Generative GIF Engine v2.0.4 ?? [8 minute read] This python and node app generates layered-based gifs to create NFT gif art! It is fast

Jalagar 112 Jan 2, 2023
A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file

Welcome to the Generative Animated Engine v3.0.1 ?? [8 minute read] This repo used to be called jalagar/Generative_Gif_Engine but because it now suppo

Jalagar 47 May 24, 2022