From 18a5008386508f7c7efff2a5ded5da18413c198a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 16 Oct 2019 17:17:41 +0200 Subject: [PATCH] Add lightning scripts --- r/lightning_begin.R | 2 +- scripts/lightning-client | 15 +++++++++++++++ scripts/lightning-server | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 scripts/lightning-client create mode 100755 scripts/lightning-server diff --git a/r/lightning_begin.R b/r/lightning_begin.R index 5ed5f68..65c54ed 100644 --- a/r/lightning_begin.R +++ b/r/lightning_begin.R @@ -10,7 +10,7 @@ ggplot(data=link_info, aes(x=timestamp, y=link, color=speed)) + theme_classic() -xx <- read.csv("../res/tmp_light/k.csv") +xx <- read.csv("../res/tmp_light/o.csv") xx2 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,way from xx group by packet_id,way") ggplot(data=xx2, aes(x=packet_id, y=lat, color=way)) + geom_line() + diff --git a/scripts/lightning-client b/scripts/lightning-client new file mode 100755 index 0000000..923210a --- /dev/null +++ b/scripts/lightning-client @@ -0,0 +1,15 @@ +#!/bin/bash +mkdir -p $6/{log,shared,res} +donar \ + -a lightning \ + -c \ + -o $6/shared/onion_services.pub \ + -l $4 \ + -p $5 \ + -b \ + -r 9000 \ +> $6/log/client-donar-stdout.log 2> $6/log/client-donar-stderr.log & +sleep 2 + +measlat -h 127.13.3.7 -p 9000 -r > /dev/null 2>&1 # Used to wait for connections +measlat -h 127.13.3.7 -p 9000 -c $1 -i $2 -s $3 > $6/log/client-measlat-stdout.log 2> $6/log/client-measlat-stderr.log diff --git a/scripts/lightning-server b/scripts/lightning-server new file mode 100755 index 0000000..7e815af --- /dev/null +++ b/scripts/lightning-server @@ -0,0 +1,14 @@ +#!/bin/bash +mkdir -p $6/{log,shared} +cd $6/shared + +donar \ + -a lightning \ + -s \ + -l $1 \ + -p $2 \ + -b \ + -e 9000 \ +> ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & + +measlat -h 127.0.0.1 -p 9000 -l -c $3 -i $4 -s $5 > ../log/server-measlat-stdout.log 2> ../log/server-measlat-stderr.log