Brunet:Communication using brunet address

From Grid-Appliance Wiki

Jump to: navigation, search

Contents

Introduction

Before staring this section, if you are not familiar with Brunet, you can refer to Brunet page first. This page shows a way to use IDataHandler for transfering message between nodes. At the sender side, this application gets target brunet address(e.g. "brunet:node:EURY4RXQFQF552MPVVTGRGSW3S6PPDCK") and message to send from user. At the receiver side, the HandleData module prints sender address and message.

Compiling and running

Compile using existing library

You can download library and source code here. You should compile "HelloWorldNodeDataHandler.cs" with Brunet.dll and BrunetApp.dll files.

For example, you can type "gmcs -r:Brunet.dll,BrunetApp.dll HelloWorldNodeDataHandler.cs" in the console. You can also use mono compiler other than "gmcs".

Compile using your own brunet source code

If you want to use your brunet source code, you should create a folder under Applications directory, and copy HelloWorldNodeDataHandler.cs and default.build files to the directory.

For example, create folder "HelloWorld" under the Brunet-Application directory (i.e.,brunet/src/Brunet/Applications/HelloWorld/), and copy two files to (brunet/src/Brunet/Applications/HelloWorld/). Run "nant" in the directory, and new executable will reference your own brunet source code.

If you have compile problem, you can download new version of brunet soucre code here

Running the application

1. Prepare hosts where you will run the HelloWorld application. To run two applications in one machine, you have to prepare two configuration files with different XmlRpcManager Port number

2. Run HelloWorldNodeDataHandler.exe with input argument local.config (Linux: mono HelloWorldNodeDataHandler local.config, Windows: HelloWorldNodeDataHandler.exe local.config)

3. Type destination brunet address(e.g. "brunet:node:EURY4RXQFQF552MPVVTGRGSW3S6PPDCK"), to where you want to send message.

4. Type message which you want to send.

5. Sender address and message will appear at the console of destination node.

Caution : It may take several 10 seconds to discover each nodes. Thus, the message might not be sent to the destination node at the beginning.

Personal tools