In this article I will explain how to integrate PeerSim with Eclipse IDE .
I am using peersim version 1.0.5 and Eclipse Helios IDE
Step 1: Download peersim-1.0.5 and extract it in a folder you like . Say the downloaded zip file was saved in C:\My Documents\Downloads. Extract it here and you will find a folder named peersim-1.0.5 .
Step 2: At first create a JAVA project . ( Go File -> Project -> JAVA Project )
Step 3: In window that popped up , unmark the option Use default location. A text box will be alive and show there the directory where peersim-1.0.5 was extracted . According to Step 1 that should be C:\My Documents\Downloads\peersim-1.0.5
Step 3: Press next to see everything is included correctly .
Step 4: Right Click on project name in the project explorer. Select Build Path -> Configure Build Path . In the window that popped up ,select the Libraries tab . Remove the jars named peersim-1.0.5.jar and peersim-doclet.jar.
Step 5: Right Click on project name in the project explorer. Select Run as -> Run Configuration. In the explorer at the left double click on JAVA Application.You will see a new run configuration window is on the right. Give any name you like at the Name field. Hit Search to find the main class.
The class name is Simulator under peersim package.
Step 6: Go to the Arguments tab. In the program arguments field input "example/config-example1.txt". The press Run. That will simulate a protocol configured in the example/config-example1.txt file.
There are also some other configuration files in the "example/" directory . Change in the "Argument" tab to check the others.
I am using peersim version 1.0.5 and Eclipse Helios IDE
Step 1: Download peersim-1.0.5 and extract it in a folder you like . Say the downloaded zip file was saved in C:\My Documents\Downloads. Extract it here and you will find a folder named peersim-1.0.5 .
Step 2: At first create a JAVA project . ( Go File -> Project -> JAVA Project )
Step 3: In window that popped up , unmark the option Use default location. A text box will be alive and show there the directory where peersim-1.0.5 was extracted . According to Step 1 that should be C:\My Documents\Downloads\peersim-1.0.5
Step 3: Press next to see everything is included correctly .
Step 4: Right Click on project name in the project explorer. Select Build Path -> Configure Build Path . In the window that popped up ,select the Libraries tab . Remove the jars named peersim-1.0.5.jar and peersim-doclet.jar.
Step 5: Right Click on project name in the project explorer. Select Run as -> Run Configuration. In the explorer at the left double click on JAVA Application.You will see a new run configuration window is on the right. Give any name you like at the Name field. Hit Search to find the main class.
The class name is Simulator under peersim package.
Step 6: Go to the Arguments tab. In the program arguments field input "example/config-example1.txt". The press Run. That will simulate a protocol configured in the example/config-example1.txt file.
There are also some other configuration files in the "example/" directory . Change in the "Argument" tab to check the others.
can u please tell me how can we add peersim and chord in the jcreator or NetBeans and how can we run the configuration file?
ReplyDeleteYou can get an example of chord implementation from the PeerSim home page. The name of the file is chord.tar.gz. Say you have configured PeerSim for Netbeans. Create a package peersim.chord under the "Source Package". Put all the files from src/peersim/chord folder of the downloaded chord file to that package just created.
DeletePut the example.cfg file into any folder in the project directory.That is the config file for chord protocol.
I do not know about JCreator , But to configure in Netbeans is almost similar to doing it in eclipse. Create a Java project by using "java Project form existing sources" and show the directory of PeerSim folder. Add the two jars mentioned above to "Libraries" folder of the project.Go to project properties.Select Run from the left panel.and you will find the Main class and Argument fields. Do similar what i did in my original post.
thanks.i have done all but it shows...
Deleterun:
Simulator: loading configuration
ConfigProperties: Property 'config-example3' set.
Simulator: unable to determine simulation engine type
there is also some errors...
import org.lsmp.djep.groupJep.*;
have u any idea...please let me know...
For the first error i would suggest you to check the file-name is correct or not . As i can see from the output there is no extension in the file name.Check the file-name and directory.
DeleteFor the second error ,see you have correctly included the
jep-2.3.0.jar
djep-1.0.0.jar
files in the Libraries folder. Versions are not important.You will find these files in Peersim folder.
Hope it Helps :-)
I mean to say the file-name of the config file.
DeleteHi sayeed i have done the following steps but shows run:
DeleteSimulator: loading configuration
ConfigProperties: Property 'config-example3' set.
Simulator: unable to determine simulation engine type
What code do i need to put in the Arguements tab
example/config-example3.txt
Deletehi after a long time...
Deletein peersim it basicaly runs one overlay network..if i want to run two overlay network..then what thing i have to do or is it possible?
Man, thank you very much to post this step by step. You just saved a lot trouble saving me time which I already don't have.
ReplyDeleteCheers!
how to execute chord in peersim eclipse
ReplyDeleteSee the 1st half of reply of The first comment on this post.
Deletei tried whether the output of chord is that example.cfg file or some other one i want the output of chord
ReplyDeleteexample.cfg is the configuration file.Here is the output of chord using the config file here. Hope it helps.
Deletethank u very much it helped me a lot.......do u have executable gnutella peersim source code i searched and got this http://code.google.com/p/gnutella-peersim/downloads/detail?name=P2PGnutella.tgz but it is fully java not peersim package can i integrate this code with peersim if so pls say me how
DeleteBonjour,
ReplyDeletecomment je peux exécuter chord et gnutella sur peersim sous eclipse car je veux faire une comparaison entre les deux. je suis debutante. est ce que vous pouvez me donner une reponse rapide ce urgent. merci
This comment has been removed by the author.
ReplyDeletedear i am running peersim on eclipse in ubuntu environment which is the main exe file so i should complie.
ReplyDeleteand i compile some file which gives this type of error
"Simulator: loading configuration
Simulator: unable to determine simulation engine type
"
I think you forgot to set the configuration file-name as program argument. Please follow the Step 6 of the post. Thanks
DeleteI am trying to integrate bittorrent on eclipse. i downloaded bittorrent.tar.gz from peersim homepage.
ReplyDeleteMade a java project
Imported libraries (djep-1.0.0.jar, jep-2.3.0.jar, peersim-1.0.3.jar)
to project's src folder i copied all the files from bitpeer/src/peersim folder of the extracted bittorrent.tar.gz
I also copied config-BitTorrent.txt configuration file
then I added the javadoc location path by right clicking on peersim-1.0.3.jar under Referenced Libraries section of project.
Then i moved to run->run as configuration..
There i added new java application and to Project i added bitTorrent
and to main class i added peersim.Simulator
To arguments i added the configuration file
but after running i'm getting the error :
peersim.config.IllegalParameterException: Parameter "protocol.bittorrent": Class peersim.bittorrent.BitTorrent not found
At peersim.config.ConfigContainer.getClazz:606
Can you please tell me what's wrong here?
Please use source code file instead of peersim-1.0.3.jar. Add peersim sources to "src" folder and copy the bittorrent related codes in package "peersim.bittorent"
ReplyDeletei didn't get one thing that what exactly you mean by source code file? i didn't get location of it
Deletecan u please give me a screenshot of the location of source code.
Thanks alot for your help!
Thanks for simple and clear explanation.
ReplyDeleteI am trying to run a project for SuperPeer which is available in Peersim website titled by SG-1 in the following link:
http://peersim.sourceforge.net/code/Superpeer.zip
I was trying to implement the same steps mentioned in this page but it does not work. I would appreciate your help.
Please brother, describe example1 output parameters in briefly.
ReplyDeletegood evening , i am beginner in peersim , and i am obliged to implement Gnutella System using this simulator, if you have some suggestions, or you have already this project, please help , it is urgent ... Thanks
ReplyDeleteyour blog is a big help to set-up chord in peersim .I am a beginner I want to set every node with a success rate and some task and want to print that .How do i do that . where to look.Thanks
ReplyDeletehow to intergrate peersim in netbeans?
ReplyDelete