Coder Social home page Coder Social logo

altangent / lightning-viz Goto Github PK

View Code? Open in Web Editor NEW
29.0 5.0 12.0 1.32 MB

Lightning Network Visualizer powered by LNTools

Home Page: https://lnviz.altangent.com

License: MIT License

JavaScript 87.82% HTML 0.71% Dockerfile 0.38% SCSS 11.09%
bitcoin lightning-network vizualization graph litecoin

lightning-viz's Introduction

lightning-viz

This a visualizer for the Bitcoin Lightning Network. The visualizer can directly connect to the Lightning Network using LNTools!

Lightning-viz supports advanced node querying (enter query: into the search bar) and remapping of the graph based on the node search results.

The server also periodically pings peers to determine their connectivity. The server collects geo-location data on nodes that have an address configured.

Installation

Requires Node 16+.

git clone https://github.com/altangent/lightning-viz
cd lightning-viz
npm install && npm run build

Running with LNTools

LNTools is a group of libraries that implement the Lighting Network BOLT specifications. With LNTools, a process can directly connect to other nodes and store gossip traffic in a RocksDB database.

Node Process

LNTOOLS_NETWORK=BitcoinTestnet \
LNTOOLS_BITCOIND_HOST=127.0.0.1 \
LNTOOLS_BITCOIND_PORT=18332 \
LNTOOLS_BITCOIND_RPCUSER=kek \
LNTOOLS_BITCOIND_RPCPASSWORD=kek \
LNTOOLS_BITCOIND_ZMQRAWBLOCKS=tcp://127.0.0.1:38333 \
LNTOOLS_BITCOIND_ZMQRAWTX=tcp://host.docker.internal:38332 \
LNTOOLS_PEER_PUBKEY=036b96e4713c5f84dcb8030592e1bd42a2d9a43d91fa2e535b9bfd05f2c5def9b9 \
LNTOOLS_PEER_HOST=38.87.54.163 \
LNTOOLS_PEER_PORT=9745 \
HTTP_PORT=8000 \
npm start

Docker

docker run \
    -e LNTOOLS_NETWORK=BitcoinTestnet \
    -e LNTOOLS_BITCOIND_HOST=host.docker.internal \
    -e LNTOOLS_BITCOIND_PORT=18332 \
    -e LNTOOLS_BITCOIND_RPCUSER=kek \
    -e LNTOOLS_BITCOIND_RPCPASSWORD=kek \
    -e LNTOOLS_BITCOIND_ZMQRAWBLOCKS=tcp://host.docker.internal:38333 \
    -e LNTOOLS_BITCOIND_ZMQRAWTX=tcp://host.docker.internal:38332 \
    -e LNTOOLS_PEER_PUBKEY=036b96e4713c5f84dcb8030592e1bd42a2d9a43d91fa2e535b9bfd05f2c5def9b9 \
    -e LNTOOLS_PEER_HOST=38.87.54.163 \
    -e LNTOOLS_PEER_PORT=9745 \
    -e HTTP_PORT=8000 \
    -v /somepath/lightning-viz/data:/usr/src/app/data \
    -p 8000:8000 \
    --name lnviz \
    -d \
    altangent/lnviz

Running with LND

Lightning-viz can also connect to an LND instance using the lnd-async library. You may need to pass environment variables supported by lnd-async to control LND behavior.

You will need to supply the CLIENT=LND environment variable.

CLIENT=LND npm start

lightning-viz's People

Contributors

bmancini55 avatar coretechs avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lightning-viz's Issues

Graph does not update unless server is restarted?

I run lightning-viz connected to my lnd litecoin client and it seems like the graph (and the numbers on top) is only being created once and is not being updated unless the server is restarted. Have I misconfigured something or is this intended?

Sort nodes in node list

Control sort of the nodes by (pub_key, alias, capacity, and last_updated). It currently only sorts by pub_key.

Showing SATS with thousand seperators

I am having hard time to read the number of SATS without a thousand seperator.

Example: 2143243242 SATS

Would it be better to visualize it with thousand seperators like 2'143'243'242 or 2,143,243,242

Add payment routing simulator

Create tool on selected nodes where you can enter a payment request. Query the server to find the routes that can be taken (QueryRoutes LND API). From that, highlight the channels that will be used in the graph.

Question about reachable node status

I have an active channel to this node:

PubKey: 03aaa4b0410d6b7ca72f71fc3b9334e7389778a7b98a7e52600979f249c2d387f6
Alias: AnriBTC

However, the reachable status icon is red. I'm not sure why the visualizer is stating that this node is not reachable/not active.

Recurring crash

error: message=missing: 0264404cece70e0639fe56c9083d86bf4deece51ee0a2bc2fe3115487b77a9fedc, stack=Error: missing: 0264404cece70e0639fe56c9083d86bf4deece51ee0a2bc2fe3115487b77a9fedc
at find (/home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:156:20)
at initialize (/home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:205:58)
at Function.force.links (/home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:241:43)
at resolve (/home/lnd/lightning-viz/src/server/domain/graph-service.js:66:23)
at new Promise ()
at runSimulation (/home/lnd/lightning-viz/src/server/domain/graph-service.js:30:10)
at Object.loadGraph (/home/lnd/lightning-viz/src/server/domain/graph-service.js:24:9)
at
/home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:186
target.vx -= x * (b = bias[i]);
^

TypeError: Cannot create property 'vx' on string '02a0bc43557fae6af7be8e3a29fdebda819e439bea9c0f8eb8ed6a0201f3471ca9'
at force (/home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:186:19)
at /home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:302:7
at Map.each (/home/lnd/lightning-viz/node_modules/d3-collection/build/d3-collection.js:56:60)
at tick (/home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:301:12)
at step (/home/lnd/lightning-viz/node_modules/d3-force/build/d3-force.js:288:5)
at timerFlush (/home/lnd/lightning-viz/node_modules/d3-timer/build/d3-timer.js:68:48)
at Timeout.wake [as _onTimeout] (/home/lnd/lightning-viz/node_modules/d3-timer/build/d3-timer.js:78:5)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)

lnd mandatory

I run lightningd (the client in c). does it also work with that or is lnd mandatory?
It should be easy to make it work with nearly every node, or?
Are there plans for that?

Display of channel animations

Channel animations are currently disabled due to high CPU usage. We can re-enable them once #2 is completed and the node/channel count is below a threshold. We also should always keep them disabled on mobile devices.

Mobile layout is broken

#2 and #4 are pre-requirements for a solid mobile experience. Once those are enable, we fix rendering of the info panes to stack below the graph.

Update/replace geo IP data endpoint

error: {
  "0": "#################################################################################################################################",
  "1": "#                                                                                                                               #",
  "2": "# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT                                                                                   #",
  "3": "#                                                                                                                               #",
  "4": "# This API endpoint is deprecated and has now been shut down. To keep using the freegeoip API, please update your integration   #",
  "5": "# to use the new ipstack API endpoint, designed as a simple drop-in replacement.                                                #",
  "6": "# You will be required to create an account at https://ipstack.com and obtain an API access key.                                #",
  "7": "#                                                                                                                               #",
  "8": "# For more information on how to upgrade please visit our Github Tutorial at: https://github.com/apilayer/freegeoip#readme      #",
  "9": "#                                                                                                                               #",
  "a": "#################################################################################################################################"
}

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.