PCN Simulator allows you to simulate payments in a payment channel network and observe occuring network changes. This includes changes in topology and liquidity, depending on the behavior of nodes, as well as various routing and protocol parameters. The next section will get you started!
The simulator in this repository is based on octn-simulation published by CSIRO that can be found in the CSIRO Data Access Portal (original repository).
System Requirements:
- JDK 1.8 (JAVA_HOME needs to be set)
- npm
- IntelliJ / Eclipse
- Kotlin Plugin for IntelliJ / Kotlin Plugin for Eclipse
- Optional: Docker
To get started, import the project as a Gradle project into your Java IDE. Alternatively, you can use the Gradle wrapper
provided in the project. The first execution of gradlew
on Linux and macOS or gradlew.bat
on Windows will install
the correct version of Gradle for local use within the project.
To build the project, follow these steps:
- Install frontend dependencies: In the directory
src/main/resources/public
runnpm install
- Build the frontend: In the directory
src/main/resources/public
runnpm run build
- Create a jar: In the project root directory, run
./gradlew jar
- Create code documentation: In the project root directory, run
./gradlew dokka
- Build a Docker image: In the project root directory, run
docker build -t pcn-simulator:0.2.0 .
Run in IDE: To run the app in your IDE. The program entry point is located in the Main.kt
class.
Run container: To run a Docker container, type docker run -p 8081:8081 pcn-simulator:0.2.0
. For both cases, the tool is will now be available at http://127.0.0.1:8081.
To run the evaluation you need additional tools:
- Python 3
- matplotlib
- graphviz (also needs graphviz executables v2.38)
- numpy
- scipy
- memory-profiler
Evaluate template generation:
> cd evaluation/templates
# 1. create and render templates
> python generate.py
# 2. collect metrics from templates
> python collect.py
# 3. create diagrams
> python plot.py # diagram per metric and scenario
> python plot-summary.py # summarizing metrics and scenarios on one page
> python plot-eval-template-properties.py # final selection of metrics
Evaluate routing algorithms:
> cd evaluation/simulations
# 1. create templates per scenario and network size
> python template.py
# 2. simulate templates
> python simulate.py
# 3. create diagrams
> python plot.py # diagram per metric and scenario
> python plot-summary.py # summarizing metrics per scenario
# 4. create diagrams for final selection of metrics
> python plot-eval-channels-malicious.py
> python plot-eval-etora-mem-sizes.py
> python plot-eval-etora-success-sizes.py
> python plot-eval-fees-hub.py
> python plot-eval-hops-hub.py
> python plot-eval-mdart-success-sizes.py
> python plot-eval-packet-count-commercial.py
> python plot-eval-packet-size-commercial.py
> python plot-eval-success-faulty.py
> python plot-eval-success-hub.py
> python plot-eval-success-lowpart.py
> python plot-eval-success-malicious.py
> python plot-eval-terp-success-sizes.py
The results of the template-evaluation can be found in evaluation/templates.
The results of the evaluation of the routing algorithms can be found in evaluation/simulations. A sub-directory exists per scenario, containing the selected templates (*.json files) in three sizes (sm, md, lg).
Refer to LICENSE.txt
- Rafael Konlechner
- David Lobmaier (dlob)