IPv8 Datasync Test Suite

Introduction and manual to the mighty IPv8Datasync Test Suite.

Quick start guide to the galaxy

Run

  • ./testbench2.py --numberofclients 3

And see them synchronize! Check the testbench2.py section of this page for details

List of programs in the suite

createdb.py

createdb.py creates a database with IPv8 entries as defined in ipv8model.py. You can create databases of predefined size (with --size) and similar to a percentage with another database (--similarity, --similar-db). You can run the script with --help to get a full list of the supported functionality. All the test need of course to have databases to synchronize, so createdb.py is a important part of the test suite.

Example run:

  • ./createdb.py --size=1000 --output /tmp/server.sql
    • Will create a database /tmp/server.sql with 1000 random entries.
  • ./createdb.py --size=500 --similar-db /tmp/server.py --similarity 0.5 /tmp/client.sql
    • Will create a database /tmp/client.sql with 250 entries copied from /tmp/server.sql and 250 random entries

Note: Generation of data can take a long of time. Prefer values up to 50K entries

comparedb.py

comparedb.py will take two databases and compare the rows of the IPv8 table as defined in the ipv8model.py. Will output the size of each database, the number of similar entries and the ratio of their similarity. Will also report if an entry exists multiple times in a database.

Example run:

  • ./comparedb.py /tmp/server.sql /tmp/client.sql

Note: Comparison of databases can take a long time. Be patient.

server.py

server.py implements a server node for client to connect to and get database updates. Implements the Tribler Server Protocol as define in Ipv8Datasync.

Example run:

  • ./createdb.py --size=1000 --output /tmp/server.sql
  • ./server.py --dbfile=/tmp/server.sql --ip 127.0.0.1

Note: The program will run endlessly and can be terminated with ctrl-C.

client.py

client.py implements a client node which connects to a server and gets database updates. Implements the Tribler Client Protocol as define in Ipv8Datasync.

Example run:

  • ./createdb.py --size=1000 --output /tmp/client.sql
  • ./client.py --dbfile=/tmp/client.sql --server 127.0.0.1 --ip 127.0.0.2

Note: The program will run endlessly and can be terminated with ctrl-C.

node.py

node.py implements a fully working node, acting both as client and server.

Example run:

  • ./createdb.py --size=1000 --output /tmp/node.sql
  • ./node.py --dbfile /tmp/node.sql --ip 127.0.0.1 --iprange 1-5

Will bind to 127.0.0.1 and try to connect to hosts 127.0.0.2 - 127.0.0.5

testbench2.py

testbench2.py is an automated tool to test node synchronization. Will create --numberofclients databases and a node for each database and you can see them synchronize!

Example run:

  • ./testbench2.py --numberofclients 5

Output: The output is the machine output from client.py. For each succesfull sync you get a line with the following format

IP of the nodeRoundTYPEConnected toBloom filter entries Bloom filter size Rows received Data received Data Sent Entries in the local db after sync
127.0.0.11SYNC127.0.0.249881710019984832600

You can parse the output with parser.py

parser.py

parser.py will parse the output of testbench2.py and create a series of PDF files with visual represantation of the connections and status of the node databases per round. Helps you understand and debug the system

Example run:

  • ./testbench2.py --numberofclient 3 | tee testing.out
  • ./parser.py testing.out

Will create PDFs named 1.pdf, 2.pdf, ..., <lastround>.pdf in /tmp . Each PDF represents a round Work in progress.

testbench.py

stats-parser.py