aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl
diff options
context:
space:
mode:
authorethersphere <thesw@rm.eth>2018-06-20 20:06:27 +0800
committerethersphere <thesw@rm.eth>2018-06-22 03:10:31 +0800
commite187711c6545487d4cac3701f0f506bb536234e2 (patch)
treed2f6150f70b84b36e49a449082aeda267b4b9046 /swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl
parent574378edb50c907b532946a1d4654dbd6701b20a (diff)
downloadgo-tangerine-e187711c6545487d4cac3701f0f506bb536234e2.tar
go-tangerine-e187711c6545487d4cac3701f0f506bb536234e2.tar.gz
go-tangerine-e187711c6545487d4cac3701f0f506bb536234e2.tar.bz2
go-tangerine-e187711c6545487d4cac3701f0f506bb536234e2.tar.lz
go-tangerine-e187711c6545487d4cac3701f0f506bb536234e2.tar.xz
go-tangerine-e187711c6545487d4cac3701f0f506bb536234e2.tar.zst
go-tangerine-e187711c6545487d4cac3701f0f506bb536234e2.zip
swarm: network rewrite merge
Diffstat (limited to 'swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl')
-rw-r--r--swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl b/swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl
new file mode 100644
index 000000000..b75cc9894
--- /dev/null
+++ b/swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use JSON;
+
+my $f;
+my $jsontext;
+my $nodelist;
+my $network;
+
+open($f, "<", $ARGV[0]) || die "cant open " . $ARGV[0];
+while (<$f>) {
+ $jsontext .= $_;
+}
+close($f);
+
+$network = decode_json($jsontext);
+$nodelist = $network->{'nodes'};
+
+for ($i = 0; $i < 0+@$nodelist; $i++) {
+ #my $protocollist = $$nodelist[$i]{'node'}{'info'}{'protocols'};
+ #$$protocollist{'pss'} = "pss";
+ my $svc = $$nodelist[$i]{'node'}{'config'}{'services'};
+ pop(@$svc);
+ push(@$svc, "pss");
+ push(@$svc, "bzz");
+}
+
+print encode_json($network);