Note: Install them with: sudo pip install <pkg name>
Start an instance of p2plive by typing:
twistd -l 2p.log --pidfile 2p -r udtepoll p2plive -s p2plive/settings1
This will be our broadcast(the peer node which produces the information in a channel). p2plive/settings has some example settings which can be tuned depending on the demands of the channel. Do note that everyone involved in the channel must have similar configuration. [NODE1]
Start a peer node that will be interested in the information that bc delivers
twistd -l 1p.log --pidfile 1p -r udtepoll p2plive -s p2plive/settings
Now that we have run the two peer nodes we should run some of the services they provide according to what we want from them. In p2plive there is no fixed roles on an implementation level. Everything related to that is done by the "governor". It is a client that "speaks" the Temerity protocol and controls the actions of the peer.
cat func_test/node0_client | nc localhost -q 1 33440
This will tell NODE0 that we want him to actively be in the designated channel and let him know about the other peer by giving the NODE1 address. The last step is that we want a producer server on port 9001, so we can get the received information from there.
cat func_test/node1_client | nc localhost -q 2 33441
NODE1 will start spreading too. Then feed the candy pool with a file and start a consumer server on port 10000.
Run(It will establish a connection between NODE0 and NODE1):
cat func_test/node0_behaviour | nc localhost -q 2 7000
Now is the time to run the behaviours/governors for the two nodes. Open two new tabs and type respectively:
These are ofcourse used only for example and do not in any way represent a real governor.
Finally you can now send data on port 10000 and receive data on port 9001(with netcat for example).
For now send streams that DO NOT contain x00(due to limitation of numpy)
If you don't want to go through these steps run ./funt_test/init_transfer
- Run tests(while in root dir): trial tests/
- Look at the examples in func_test/