diff options
author | Viktor TrĂ³n <viktor.tron@gmail.com> | 2018-06-22 05:00:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 05:00:43 +0800 |
commit | eaff89291ce998ba4bf9b9816ca8a15c8b85f440 (patch) | |
tree | c77d7a06627a1a7f578d0fec8e39788e66672e53 /swarm/pss/testdata/addpsstodiscoverytestsnapshot.pl | |
parent | d926bf2c7e3182d694c15829a37a0ca7331cd03c (diff) | |
parent | e187711c6545487d4cac3701f0f506bb536234e2 (diff) | |
download | go-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.pl | 28 |
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); |