Code Monkey home page Code Monkey logo

helipad's Introduction

Helipad

This package will poll a Lightning LND node for invoices related to Podcasting 2.0 and display them in a web interface. It's intended for use as a way to see incoming Boost-a-grams and other data from podcast listeners in a browser.

Helipad is intended to run as a dockerized Umbrel app, but can also be run as a standalone executable if compiled from source.

Helipad runs as a single process web server with the LND poller running in a separate thread. Invoices are checked for every 9 seconds, parsed and stored locally in a Sqlite database. The main webserver thread then serves them to clients over HTTP(S).

After compiling, you start the binary like this:

./helipad 8080

You may pass the port number you want it to listen on, on the command line as the only argument. If you don't pass a port number it will listen by default on port 2112. (RIP Neil)

The FQDN of your LND node must be present in an environment variable called $LND_URL in order to connect to it, like this:

export LND_URL="mynode.example.com:10009"

If you don't export that variable, it will attempt to connect to "localhost:10009".

Helipad also needs your admin.macaroon and tls.cert files. It will first look for them in the locations pointed to by these two environment variables:

  • LND_ADMINMACAROON
  • LND_TLSCERT

Information about the Umbrel app environment is in the umbrel folder for those interested.



Configuration

Each configurable item has multiple options. They are listed in the config file here. In each case, the environment variable is tried first, then the configuration file parameter, then a sane default based on known locations in use from other projects.

The only exception to this is the listen_port which can be specified on the command line as the only argument. This is just for convenience as it's a very common thing to change during testing.



API

The very simplistic API consists of the following endpoints:

/api/v1/index

This call returns the current most recent invoice index number that Helipad has reconciled with LND.

/api/v1/balance

This call returns the current channel balance that LND is reporting.

/api/v1/boosts

This call returns count boosts starting at index. If the old parameter is present, the boosts returned start from index and descend by count, showing older boosts. Otherwise, they start at index and ascend by count, showing newer boosts.

/api/v1/streams

This call returns count streams starting at index. If the old parameter is present, the streams returned start from index and descend by count, showing older streams. Otherwise, they start at index and ascend by count, showing newer streams.



CSV export

There is an endpoint called /csv that will export boosts as a CSV list to make organizing easier. The parameters behave just like the boosts and streams endpoints, but also accept an end parameter which limits how far back in time the CSV export list goes. An example call would look like this:

GET http://localhost:2112/csv?index=38097&count=13049&old=true&end=25048

This will give back a csv list of 13,049 boosts starting at index 38097 and descending back in time - but will not go past index number 25048.



Development

Quick Start (Debian/Linux Mint/Ubuntu/Pop!_OS)

In order to run Helipad locally you need to install the Rust Compiler rustc, the Rust package manager cargo, and the needed shared libraries libssl-dev/libsqlite3-dev. Clone the Github repo with git clone ... and enter the helipad directory. Note, all commands going forward will need to be ran from this directory. cargo run will compile and run helipad. If Helipad fails to start you may need to edit helipad.conf or set/unset Environment Variables.

sudo apt install rustc cargo libssl-dev libsqlite3-dev
git clone https://github.com/Podcastindex-org/helipad.git
cd helipad
# Edit helipad.conf as needed
cargo run
# Open http://127.0.0.1:2112 in your browser

There is an example build script for quick compile/run when iterating on new features. The script sets a proper environment, does a debug compile and runs the executable.

helipad's People

Contributors

daveajones avatar ericpp avatar valcanobacon avatar coldacid avatar brianoflondon avatar cameron-ipfspodcasting avatar jamescridland avatar kukks 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.