# Test Task ## Summary Your task is to design a simple p2p gossiping application in Rust. The peer should have a cli interface to start it and connect itself to the other peers. Once connected, the peer should send a random gossip message to all the other peers every N seconds. The messaging period should also be specifiable in the command line. When a peer receives a message from the other peers, it should print it in the console. ## Example ### Peer Startup ```bash= # Starting the first peer with messaging period 5 seconds at port 8080: ./peer --period=5 --port=8080 # Starting the second peer which will connect to the first # messaging period - 6 seconds # port - 8081 ./peer --period=6 --port=8081 --connect="127.0.0.1:8080" # Starting the second peer which will connect to all the peers through the first # messaging period - 7 seconds # port - 8082 ./peer --period=7 --port=8082 --connect="127.0.0.1:8080" ``` ### Example Output Taking into account the network startup from the previous section, the third peer might have the following output: ```bash= # 00:00:00 - My address is "127.0.0.1:8082" # 00:00:00 - Connected to the peers at ["127.0.0.1:8080", "127.0.0.1:8081"] # 00:00:05 - Received message [random message] from "127.0.0.1:8080" # 00:00:06 - Received message [random message] from "127.0.0.1:8081" # 00:00:07 - Sending message [random message] to ["127.0.0.1:8080", "127.0.0.1:8081"] # 00:00:10 - Received message [random message] from "127.0.0.1:8080" # 00:00:12 - Received message [random message] from "127.0.0.1:8081" # 00:00:14 - Sending message [random message] to ["127.0.0.1:8080", "127.0.0.1:8081"] # ... ``` ## Deliverables You are free to use any libraries you find necessary, excluding only the ones that explicitly implement p2p logic (like [libp2p](https://github.com/libp2p/rust-libp2p)). The exact format of the CLI input and output of your app is also up to you. Submit the task either with a *link to github repository* or as a *zip archive*. The submitted task should include a `README.md` file with the explanation on how to use your app.