Skip to content

Conversation

@OriolRoura
Copy link

Description

This function introduces the ability to monitor communications between Lightning nodes in a Polar test network. It can be enabled during the creation of a new network. To facilitate monitoring, a new modal interface has been added to control and view the results. Additionally, new Docker containers—currently hosted on my Docker Hub—have been integrated into the Docker network. These containers are responsible for carrying out the actual monitoring

Steps to Test

  1. Create a new network with the monitoring enabled
  2. Start the new network
  3. Click on the new button (can be seen on the second image) to open the modal
  4. Using the modal you can start/stop monitoring and apply filters to the monitoring done.

Screenshots

netSetting2 net2

modalImage

@Abdulkbk
Copy link
Contributor

Abdulkbk commented Jul 3, 2025

Hey @OriolRoura, good job! I would love to review this PR, but please consider splitting it into smaller commits to make the review process easier. Additionally, instead of merging from master, try rebasing when there are new commits.

This feature introduces the ability to monitor communications between Lightning nodes on a Polar
test network. It can be enabled during the creation of a new network. To facilitate monitoring, a
new modal interface has been added for controlling and viewing the results. Additionally, new Docker
containers—currently hosted on my Docker Hub—have been integrated into the Docker network. These
containers are responsible for performing the actual monitoring
@OriolRoura OriolRoura force-pushed the monitoring-feature branch from a677dba to 57756ff Compare July 6, 2025 13:04
@OriolRoura
Copy link
Author

Hello @Abdulkbk, I'm not sure how to break the project into functional commits. I have only two main parts:

  1. The first commit would include the monitoring system.
  2. The second commit would cover the visual interface.

Originally, I developed this project using an older version of Polar on an independent project. When I first started, the current version had a compilation error. In this fork, I'm applyinig all the changes from the original project to the current version of Polar.

Do you want me to split the commit in this two parts? Or do you want me to do in a diferent way?

@jamaljsr
Copy link
Owner

jamaljsr commented Aug 4, 2025

Hey @OriolRoura thanks for submitting this PR. I agree with @Abdulkbk that the commit structure here makes it pretty difficult to review this. This is a pretty large diff and almost all of the changes are in the first commit. In general, you want your commits to be broken up into small, logical chunks of functionality that can be reviewed independently. It's not expected to have the feature fully functional in each commit, but they should tell a story about how the different parts combine to make the whole. #1159 is an example of good commit structure. It's slightly smaller than this PR but is similar in that it adds a new docker container to the compose file and has UI changes to as well.

But before you work on the commits, can you briefly describe the reasons why you want to monitor the traffic between LN nodes? I've been working on LN apps for a while now and have never had the need to analyze the communication at the packet level. I'd like to understand the benefits of having this functionality baked into Polar.

@OriolRoura
Copy link
Author

I developed this feature because I couldn’t find any existing tool that provides easy access to Lightning communication on a network level. My initial motivation was personal. I needed it to track network communication for a research project trying to identify the lightning messages in the network and decrypt them. You can find the project at OriolRoura/LightningDecryptor
After building it, I realized this functionality could be valuable for others studying or experimenting with the Lightning Network.

This feature is fully optional; it can be enabled or disabled when creating a new network, so users who don’t need it won’t be affected.

OriolRoura and others added 10 commits September 23, 2025 16:33
Adds abstractions and logic for file operations and network management.
This functionality allows communication between Polar and the lnd nodes.
Updates Docker orchestration logic to support custom monitoring containers in Polar networks.

composeFile.ts: Adds logic to include monitoring services in the Docker Compose configuration.
dockerService.ts: Extends Docker service management to handle monitoring containers.
nodeTemplates.ts: Provides templates for monitoring containers, enabling their integration.
Updates store models and type definitions to support:
The monitoring modal
The monitoring-enabled network state.
Adds UI components and integrates a monitoring modal into the network.
This modal allows the control of the monitoring.
Adds translation strings for all new UI elements and modal controls related to network monitoring.
Some languages were translated automatically using a translation tool.
Adds tests and mocks to ensure correct behavior and reliability of the network monitoring feature.
Existing tests were updated to remain compatible with new functionality.
Updates dependencies and configuration files required for the new monitoring functionality.
A mock I forgot to include on the testing commit.
@polespinasa
Copy link

Concept ACK

But before you work on the commits, can you briefly describe the reasons why you want to monitor the traffic between LN nodes?

For projects related to privacy analysis this would be great see for example Fingerprinting LN Nodes; which uses network traffic analysis to discover which implementation your peers are running.
Also this would be useful when analyzing the network looking for vulnerabilities or possible attacks to perform.

I've been working on LN apps for a while now and have never had the need to analyze the communication at the packet level. I'd like to understand the benefits of having this functionality baked into Polar.

Maybe for a LN apps dev point of view is not an useful tool, but for research projects it surely is. And even more if it shows the content of the network packages decrypted and in plain text. @OriolRoura does this PR enable this?

@OriolRoura
Copy link
Author

At the moment, the PR doesn't support decrypting packages exchanged between nodes. I managed to get decryption working by modifying the node itself, but I'm aiming for a cleaner solution that avoids altering the nodes directly.
If this PR is considered acceptable in its current form, I plan to continue improving it by adding native support for decrypting packages and enhancing the feature in any way I can.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants