Development
From Pfyshnet
pfyshnet is written in java. We recommend using the eclipse IDE. It integrates nicely with Subversion using the Subclipse plug-in.
Latest Test Results
Latest Simulation Results
Installing Subclipse and Checking Out the Project
Once you have Eclipse installed, you can install Subclipse using the following procedure.
1) Start Eclipse and go to the workspace.
2) Go to Help->Software Updates->Find and Install.
3) Select "Search for new features to install", click Next.
4) Enter this in "Work with:"
http://subclipse.tigris.org/update_1.6.x
5) Press the "Add" button.
6) Type in "Subclipse" for the name, press enter.
7) Select "Subclipse".
8) Follow the prompts until it has been downloaded and installed. Allow Eclipse to be restarted.
9) Go to Window->Preferences.
10) Expand "Team", and select "SVN" (You may get an error about JavaHL, click Ok).
11) Change the SVN Interface to SVNKit (Pure Java), click Ok.
12) Go to Window->Open Perspective->Other.
13) Select SVN Repository Exploring.
14) Click the "Add SVN Repository" icon.
15) Enter the URL, and click Finish.
https://pfyshnet.svn.sourceforge.net/svnroot/pfyshnet
16) Accept the certificate permanently.
17) Go to File->New->Project..
18) Expand SVN and select "Checkout Projects from SVN". Click Next.
19) Select the pfyshnet repository and click Next.
20) Select the pfyshnet project, and click Finish.
Now you can use Eclipse to make your edits. Right click on the project and use Team->Commit/Update.
Adding The log4j Library to Eclipse
log4j is what pfyshnet uses for generating log files.
1) Download the latest release from http://logging.apache.org/log4j/1.2/download.html
2) Unzip and extract the archive.
3) Open Eclipse.
4) Go to Windows->Preferences..
5) Expand Java->Build Path->User Libraries
6) Click "New" and type in "log4j". Click OK.
7) Click "Add JARs"
8) Browse to the directory where you extracted log4j, select the jar file, and click OK.
9) Click OK.
Adding The DB4O Library to Eclipse
DB4O is what pfyshnet uses for a database.
1) Download the latest release from http://www.db4o.com/DownloadNow.aspx
2) Unzip and extract the archive.
3) Open Eclipse.
4) Go to Windows->Preferences..
5) Expand Java->Build Path->User Libraries
6) Click "New" and type in "db4o". Click OK.
7) Click "Add JARs"
8) Browse to the directory where you extracted db4o, select the java5 jar file from the lib directory. Click OK.
9) Click OK.
Adding The BouncyCastle Library to Eclipse
Bouncy Castle is Pfyshnet's encryption library.
1) Download the latest release from http://www.bouncycastle.org/latest_releases.html
2) Unzip and extract the archive.
3) Open Eclipse.
4) Go to Windows->Preferences..
5) Expand Java->Build Path->User Libraries
6) Click "New" and type in "bouncycastle". Click OK.
7) Click "Add JARs"
8) Browse to the directory where you extracted bouncycastle. There will be a jars subdirectory.
9) select the bcprov-jdk16* jar file. Click OK.
10) Click OK.
Adding The FEC Library to Eclipse
We use Onionnetwork's FEC library for Forward Error Correction.
1) Download the latest release from http://onionnetworks.com/developers/
2) Unzip and extract the archive.
3) Open Eclipse.
4) Go to Windows->Preferences..
5) Expand Java->Build Path->User Libraries
6) Click "New" and type in "fec". Click OK.
7) Click "Add JARs"
8) Browse to the directory where you extracted the zip file. cd to the "lib" directory.
9) select the onion-* jar files.
10) Click OK.
Adding The jpoller Library to Eclipse
JPoller keeps track of file updates for the GUI.
1) Download the latest release from http://www.sourceforge.net/projects/jpoller
2) Unzip and extract the archive.
3) Open Eclipse.
4) Go to Windows->Preferences..
5) Expand Java->Build Path->User Libraries
6) Click "New" and type in "jpoller". Click OK.
7) Click "Add JARs"
8) Browse to the directory where you extracted the zip file.
9) Add pollmgt.jar
10) cd to the "lib" subdirectory, add org.sadun.util.jar
Adding The swing-layout Library to Eclipse
This allows our GUI to be cool.
1) Download the latest swing-layout jar from https://swing-layout.dev.java.net/servlets/ProjectDocumentList
2) Open Eclipse.
3) Go to Windows->Preferences..
4) Expand Java->Build Path->User Libraries
5) Click "New" and type in "swing-layout". Click OK.
6) Click "Add JARs"
7) Select the swing-layout jar you downloaded.
9) Click "Ok"
Adding The appframework Library to Eclipse
This allows our GUI to be cool.
1) Download the latest appframework jar from https://appframework.dev.java.net/servlets/ProjectDocumentList?expandFolder=6862&folderID=0
2) Open Eclipse.
3) Go to Windows->Preferences..
4) Expand Java->Build Path->User Libraries
5) Click "New" and type in "appframework". Click OK.
6) Click "Add JARs"
7) Select the appframework jar you downloaded.
9) Click "Ok"
Adding The swing-worker library to Eclipse
This allows our GUI to be cool. More stuff for java 5 compatibility from Dane.
1) Download the latest swing-worker jar from https://swingworker.dev.java.net/servlets/ProjectDocumentList?folderID=9637&expandFolder=9637&folderID=0
2) Open Eclipse.
3) Go to Windows->Preferences..
4) Expand Java->Build Path->User Libraries
5) Click "New" and type in "swing-worker". Click OK.
6) Click "Add JARs"
7) Select the appframework jar you downloaded.
9) Click "Ok"
Running the Cobertura core test
NOTE: Cobertura/Java has issues parsing the commandline in Linux! I've resorted to running Cobertura on Windows.
1) Download and install Cobertura from here.
2) Update your SVN checkout of Pfyshnet and "Clean" the build.
3) I turn off "Build Automatically" in Eclipse when running Cobertura, because as documented here it overwrites the eclipse workspace .class files.
4) cd to your Cobertura run directory.
5) Delete the existing cobertura.ser file if one exists.
6) Run:
cobertura-instrument.bat <path_to_eclipse_workspace>\pfyshnet\bin\org\pfyshnet\core\* <path_to_eclipse_workspace>\pfyshnet\bin\tests\core\*
cd <path_to_eclipse_workspace>\pfyshnet\bin
java -classpath .;<path_to_cobertura>\cobertura.jar;<path_to_logj_lib>\<logj.jar> -Dnet.sourceforge.cobertura.datafile=<path_to_cobertura>\cobertura.ser tests.core.CoreTest 10000000 <path_to_eclipse_workspace>\pfyshnet\src\tests\core\log4j.properties
7) After a few hours when the above finishes cd to the cobertura run directory. Create the subdirectory cobertura_report
8) Run:
cobertura-report.bat --datafile cobertura.ser --destination cobertura_report --format html <path_to_eclipse_workspace>\pfyshnet\src\

