Skip to content

incentivus/Lightning-Network-Centralization

Repository files navigation

LNChannelOpening

Lightning Network Channel and Capacity Selection

Made with Python pandas - up-to-date Gym - >=0.2 Stable-baselines3 - >= 1.6 Sb3-contrib - >= 1.6

NetworkX - ~2.8.5 tensorboard - ~=2.9.1

How to Use

Prerequisite

Please make sure you have installed python3.8 or higher versions of python.

Install

git clone https://github.com/AAhmadS/Lightning-Network-Centralization
cd Lightning-Network-Centralization

All dependencies will be handled using the command :

pip install -r requirements.txt

Run

python3 -m scripts.ln_channel_opening --algo PPO --model Transformer --tb_name PPO_tensorboard
python3 -m scripts.baselines --strategy random
python3 -m scripts.evaluation --model --model Transformer

Parameters

ln_channel_opening:

Parameter Default choices
--algo PPO PPO, A2C
--total_timesteps 200000 Arbitrary Integer
--max_episode_length 10 Arbitrary Integer less than total_timesteps
--counts [10, 10, 10] List of Integers
--amounts [10000, 50000, 100000] List of Integers
--epsilons [.6, .6, .6] List of floats between 0 and 1
--capacity_upper_scale_bound 25 Arbitrary Integer
--max_capacity 1e7 Arbitrary Integer
  • You can modify the transaction sampling parameters by changing counts, amounts and epsilons
    • counts contains count of each transaction type.
    • amounts contains amount of each transaction type in satoshi.
    • epsilons is the ratio of merchants in final sampling.
  • Please note that length of counts, amounts and epsilons lists should be the same. baselines:
Parameter Default choices
--strategy top_k_betweenness random, top_k_betweenness, top_k_degree, bottom_k_betweenness, bottom_k_degree

You can check the results on tensorboard.

tensorboard --logdir plotting/tb_results/

Trouble-shootings

If you are facing problems with tensorboard, run the command below in terminal :

python3 -m tensorboard.main --logdir plotting/tb_results/

License

This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International license.

Creative Commons License

Citation

About

Repository for paper: Joint Combinatorial Node Selection and Resource Allocations in the Lightning Network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors