Coder Social home page Coder Social logo

lightning-network-simulator's People

Contributors

codacy-badger avatar imgbotapp avatar snyk-bot avatar whiteyhat 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

Watchers

 avatar

lightning-network-simulator's Issues

Direct access to wiki on startup

When the Lightning Network simulator startup, direct access to the project wiki #8 in a web view must be implemented. By doing so, the issue to improve the resolution quality of the welcome image #38 should be fixed.

Representation of the simulation results

The results obtained from running a lightning network simulation must be displayed in the right sidebar within the main GUI, as described in #10

The main result outputs from the simulation are:

  • Transactions. The number of transactions successfully sent in the simulated lightning network.
  • Failed transactions. The Number of failed transactions in the simulated network.
  • Hops. The number of hops successfully taken during the multi-hop stress test in the simulated lightning network.
  • Fees. The number of fees successfully raised for using channels during each hop.
  • Channels. The number of active channels in the simulated network.
  • Congested Channels. The number of congested channels in the simulated network.
  • Network Balance. The wealth of the entire simulated network.
  • Network Size. The number of nodes in the simulated network

Improve visual design of the network simulation tool

When displaying a network using the simulation tool as described in #17 should be considered the design specifications based on creating a visual distinction of node balances and channel capacities. It should be 3 options to visually represent the channel capacities:

  • Low: Noce balances and channel capacities are highlighted with red colour to represent the low balance as a visual warning.
  • Medium: Node balances and channel capacities are highlighted with orange colour to represent the medium balance as a visual warning.
  • High: Node balances and channel capacities are highlighted with green colour to represent the high balance as a visual warning.

In the case of the channels, the width of the edges should have a relation with the channel capacity.

Simulation result not accurate

Simulation results are not accurate, and as a result invalid. It needs triage and passes an evaluation to reduce severity.

Represent simulation results using charts and graphs

The simulation results should be visually represented using graphs and charts. A third party library could speed up the development process feature and improve the visual likeness of #19
There are 4 essential results to display using charts:

Data to represent

  • Nodes
  • Channels
  • Transactions
  • Routing

Charts to implement

  • Plot XY Chart
  • Linear Chart
  • Pie Chrt

Load Network

Load a network using the network map #15 and a native file chooser.

  • Limit the file path to the folder where the network maps are saved by default.
  • Limit the selection of files to be in JSON format

Export simulation

The exporting process of the network simulation and results must be done by writing a network map #15 using the data model syntax #16 which contains data about:

  • Simulations results
  • Network configuration

Data Structure to store the routing table

A data structure to optimize the routing decisions of #6 should be considered as a support object entity. The data structure should map nodes which are connected through a channel to identify the shortest path based on any optimization mechanism within the class.

100% of edges not displayed

Channels are represented as edges when network is loaded #14 in the simulation tool #17

However, some edges are missing from the simulation representation. This might be due to an error when edges are created in the GUI.

Create UML Diagrams

Design behavioural and structural diagrams using the UML standard. The diagrams should contain enough design insights about the internal architecture of the lightning network simulator.

Structural UML Diagrams

  • UML Class Diagram
  • UML Object Diagram

Behavioural UML Diagrams

  • UML Use Case Diagram
  • UML Sequence Diagram

Pseudo code

  • Pseudo code diagrams

Placeholder in text fields

Placeholders are text hints within text fields to use as an example when adding a text field input. Integrating placeholder to enhance the intuition of input when creating a network should be considered.

Testing the fitness function

Create an evaluation method of the fitness function of the lightning network simulator using the case test sheet. The fitness function of the simulation is in charge of routing transactions:

  1. Direct transactions
  2. Single-hop transactions
  3. Multi-hop transactions

The fitness function should deliver the simulation outputs in the terminal to allow further research.

  • Evaluate the Routing mechanism
  • Assert Routing outputs with simulation outputs
  • Assert Routing in comparison with #6

Glossary

Create and updated list of definitions and acronyms for the documentation

Random location of network is forced

When the network is loaded #14 the location is forced to be random. This bus needs triage to until prior resolution. The random seed needs to be successfully saved in the network map #15

Mock up program screens

The simulation tool required a GUI to be developed before creating/loading any simulation. Prior to this stage, mock-ups of each desktop application page are required to proceed with the design process of the lightning network simulator tool.

Pseudocode for main algorithms

Design pseudocode diagrams of algorithms from the main algorithms in the project to enhance visualization and procedural thinking. Diagrams must include visual representations for loops, conditionals and relevant commented notes of each specific step.

Create Java Docs

Create proper java documentation including information about the API.

Network Map

JSON file compliant with the network data model #16 syntax to allow the reading and loading methods of payment channel networks in the Lightning Network Simulation.

  • Generate network map automatically when a user add the required input to create a lightning network
  • Update the network map when the user has completed a simulation

Toolbar

The toolbar should contain options to manage and interact with the simulation at any time. At the top of the desktop application should be always accessible and visible.

The toolbar should be divided into 4 main options to maximize the utility of the lightning simulation tool:

  1. File. Tools regarding the simulation file.
  2. Edit. Edit the simulation file or interact with the simulation.
  3. Analyze. Analyze the simulation results.
  4. Help. Information and helpful resources for users.

There is more available information about the toolbar design specification and implementation in the wiki

Wiki

Set up an available wiki where the project documentation is accessible.

Routed transactions

The current model is not very efficient to perform routed transactions. The routing model should be able to optimize transaction based on:

Direct transactions

  • Direct transactions

Routed transactions

  • Cheapest route
  • Shortest path
  • Combination of both

Analysis tool

The analysis tool should cover the minimum viable features to manage the simulation inputs and display outputs from the simulation in the most frictionless way possible. Hence, the use of interactive charts and graphs as well as tools to meet the analysis criteria:

  • Managing simulation inputs. The inputs management process of the lightning network simulation must be delivered to instantly modify channel capacities and node balances. In order to offer a wide range of different network topology behaviours, the channel capacities and node balances should have 3 inputs each, low balances/capacities, medium balances/capacities and high balances/capacities.
  • Exporting a lightning network. The exporting process of the lightning network simulations and results must be done by writing a network map which contains the network model including simulations results, nodes, channels and transactions. The network model should be in an object-oriented language such as JSON.
  • Displaying simulation results. The results obtained from running a lightning network simulation must be displayed in the right sidebar within the main GUI, as described in the design criteria.

There is more available information accessible at the wiki.

Simulation tool

The simulation tool should cover the minimum viable features to display, simulate stress tests, provide routing mechanisms for one-hop and multi-hop transactions and create a network in the most frictionless way possible. Hence, a general user interface should be created based on the following design specifications:

  • Creating and loading a lightning network. The creation of a lightning network must be done by writing a network map which contains the network model including nodes, channels and transactions. The loading process is reading such map network to create the required objects to display the simulation in the GUI. The network model should be in an object-oriented language such as JSON.
  • Displaying a lightning network. The displaying process of the lightning network simulation must be achieved using an interactive graph able to meet the simulation criteria. Third party libraries to deliver this design specification such as MxGpraph, Swing and JGraphX are suitable to provide this criterion.
  • Running a simulation. The simulation process of the lightning network simulation must be done by displaying the lightning network from the data inputs obtained from the network map to create a transaction stress test. This stress test consists of creating one-hop and multi-hop transactions until node balances reach zero or channel capacities reach the maximum consequently becoming congested. The GUI must be updated constantly when a transaction is sent to show interactivity within the simulation. On each GUI update, channel capacities and node balance labels should be updated as well as the visual representation of them should meet the design criteria. Alternatively, when a channel is congested due to a maximum capacity reach, it should disappear from the general user interface.
  • Routing transactions in a lightning network. The routing mechanism must be delivered to allow the generation of transactions seamlessly during the stress test simulation.

There is more available information accessible in the wiki.

Set the transaction recipient dynamically

When the simulation #17 starts, the simulated transaction recipient is limited to 1 during the simulated stress test. This number should not be hardcoded, but dynamic or selected by the user:

  • Allow users to select 3 types of the transaction stress test.
  1. Low. Ranges from 1-10
  2. Medium. Ranges from 10-50
  3. High. Ranges from +50
  • If users do not select any type, create a combination of the 3 types dynamically.

Traffic Generator

Create a class to create a traffic generator object entity that encloses:

  • The transaction buffer

Network Data Model

JSON Syntax containing the main objects in a lightning network simulation. The list includes:

  • Node. An object composed of other object entities like balance, channels, transactions, id...

  • Channel. An object composed of other object entities like capacity, transactions, id, fee...

  • Transaction. An object composed of other object entities like tokens, to...

There is more available information about the main object entities, relations and the network data model in the Wiki.

Testing

Introduction

Testing the lightning network simulator is key to prove the utility and goodness of the simulation and analysis tool. Therefore, testing must be implemented to ensure the code meets the design criteria and the expected outputs.

The use of a testing framework should be considered to maximize the testing within the lightning network simulator.

Fields of the project to test

  • Simulation tool
  • Analysis tool
  • UI components
  • Routing (as described in #24)

Testing methods

  • Unit tests. Unit tests that check specific methods to assert an expected output.
  • UI tests. Assert certain UI elements are visibly displayed and/or exist when an expected behaviour is performed.
  • Case tests. A set of conditions or variables under which a tester will determine whether a system under test satisfies requirements or works correctly

Travis CI cannot build

Travis Continuous Integration can not build + test the project when new push or PR are appearing.

  • Create a solid java build.xml file and complete the set up process

Parse JSON to load network simulation

Loading a network should be as seamless as possible using an object-oriented language for data inter-exchange such as JSON or XML.

  • Parse JSON network map into object entities.
  • Parse data obtained from the simulation result into the JSON network map.

The network map uses the data model syntax described in #16

Improve code quality

  • Improve object-oriented classes
  • Create interfaces for class inheritance
  • Refactor of methods
  • Create commented code
  • Create Java Documentation #69

Export Transactions to the network map

Currently, the exporting process #23 exports the entire network topology into the network map #15 using the network data model syntax #16

This including channels, node, simulation results... However, the transactions are missing. The exporting data should differentiate the transactions by types:

  • Direct transactions
  • Routed transactions

simulator not running

i'm running the maven project on eclipse, however i'm not being able to run the simulator.

Documentation

Complete a minimum viable of quality content for the project documentation with the following sections:

  • Background & Objectives
  • Bibliography
  • Design
  • Evaluation
  • Glossary
  • Implementation
  • Testing
  • Third Party Services

Research the problem to find a solution

Problem

Bitcoin is an open-sourced peer-to-peer electronic cash system. The maximum transaction capacity is 7 transactions per second on its best-case scenario. This is a relatively low number in comparison with the current transaction processing from commercial standards such as visa, performing 24 000 transactions per second.

Solution

The lightning network protocol emerges as a solution to overcome this problem. The protocol is a second layer protocol to leverage the power of blockchains currencies like Bitcoin. The architecture of the protocol is composed of bidirectional payment channels to allow the creation of microtransactions within the bitcoin network while being off-chain.

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.