aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl
diff options
context:
space:
mode:
authorViktor TrĂ³n <viktor.tron@gmail.com>2018-06-22 05:00:43 +0800
committerGitHub <noreply@github.com>2018-06-22 05:00:43 +0800
commiteaff89291ce998ba4bf9b9816ca8a15c8b85f440 (patch)
treec77d7a06627a1a7f578d0fec8e39788e66672e53 /swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl
parentd926bf2c7e3182d694c15829a37a0ca7331cd03c (diff)
parente187711c6545487d4cac3701f0f506bb536234e2 (diff)
downloadgo-tangerine-eaff89291ce998ba4bf9b9816ca8a15c8b85f440.tar
go-tangerine-eaff89291ce998ba4bf9b9816ca8a15c8b85f440.tar.gz
go-tangerine-eaff89291ce998ba4bf9b9816ca8a15c8b85f440.tar.bz2
go-tangerine-eaff89291ce998ba4bf9b9816ca8a15c8b85f440.tar.lz
go-tangerine-eaff89291ce998ba4bf9b9816ca8a15c8b85f440.tar.xz
go-tangerine-eaff89291ce998ba4bf9b9816ca8a15c8b85f440.tar.zst
go-tangerine-eaff89291ce998ba4bf9b9816ca8a15c8b85f440.zip
Merge pull request #17041 from ethersphere/swarm-network-rewrite-merge
Swarm POC3 - happy solstice
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);