Skip to content

Instantly share code, notes, and snippets.

@tyzbit
Last active April 8, 2025 22:11
Show Gist options
  • Save tyzbit/ade826eb5363e02196c0940b2bf15d03 to your computer and use it in GitHub Desktop.
Save tyzbit/ade826eb5363e02196c0940b2bf15d03 to your computer and use it in GitHub Desktop.
The Lightning Network (Testnet)

Forked from vasturiano, with dataset and minor other changes.

The Lightning Network as seen from my node at 00:30 UTC on June 7 2018. This data is updated manually, not automatically.

Nodes are colored according to settings set by the node operators. Nodes are sized according to the total amount of BTC in channels they have open. Lines are channels between nodes. Nodes that fly off into the background don't have any channels my node knows about. Line colors are representative of the channel capacity, but is colored dynamically.

Click on a node to see its address info and capacity.

function getGraphDataSets() {
const loadBlocks = function(Graph) {
qwest.get('graph.json').then((_, data) => {
//data.nodes.forEach(node => { node.name = `${node.alias?node.alias+': ':''}${node.pub_key || node.id}` });
data.nodes.forEach(node => {
node.name = `${node.alias}`
var capacity = 0;
var links = 0;
// check each link, and if it connects to the node, up the node's capacity.
node.size = data.links.forEach(link => {
if ( (node.id == link.source) || (node.id == link.target) ) {
links = links + 1;
capacity = capacity + link.capacity;
}
});
// capacity is in BTC
node.capacity = capacity/100000000;
node.averagechansize = (node.capacity/links);
node.links = links;
// size indicative of average channel size
node.size = node.capacity*10
});
Graph
.cooldownTicks(300)
.cooldownTime(20000)
.nodeColor('color')
.nodeVal('size')
.nodeResolution(4)
.onNodeClick(function(node) {
document.getElementById('graph-data-description').innerHTML = `Total value of this node's channels: ${node.capacity} BTC. Average channel size: ${node.averagechansize} BTC. Total number of channels: ${node.links}.`
node.addresses.forEach(function(address) {
document.getElementById('graph-data-description').innerHTML += "<font color=\"green\" size=\"4em\"><br><b>" + node.alias + "</b>: " + node.id + "@" + address.addr + "</font>"
})
if ( node.addresses.length < 1 ) {
document.getElementById('graph-data-description').innerHTML += "<font color=\"red\" size=\"4em\"><br><b>" + node.alias + "</b> (" + node.id + ") is not advertising any addresses</font>"
}
})
.linkAutoColorBy('capacity')
.linkLabel('capacity')
.linkOpacity(0.4)
.forceEngine('ngraph')
.graphData(data);
});
};
loadBlocks.description = "<em>Lightning TESTNET</em> data (<a href='https://gist.github.com/tyzbit/ade826eb5363e02196c0940b2bf15d03'>https://gist.github.com/tyzbit/ade826eb5363e02196c0940b2bf15d03</a>)";
return [loadBlocks];
}
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment