Sign inSign up

carlossanchezh/p2p-ring-network

By carlossanchezh

•Updated 17 days ago

P2P ring network for file sharing in C over TCP sockets.

Image
Languages & frameworks
0

69

carlossanchezh/p2p-ring-network repository overview

⁠P2P RING Network

A P2P ring network for file sharing, implemented in C over TCP sockets.

⁠How to use this image

This image contains the compiled ring application. Each running container acts as one node of the P2P network. To form a ring, you need to run at least one node and connect the rest to it.

The recommended way to run it is by starting several containers on the same Docker network, so they can reach each other by container name.

Pull the image:

docker pull carlossanchezh/p2p-ring-network:latest

Create a network:

docker network create ring-net

ring-net is an example of a network name.

Launch the first node:

docker run -it --rm --name node1 --network ring-net carlossanchezh/p2p-ring-network:latest bash -c "mkdir -p /tmp/dir1 && exec ./ring /tmp/dir1"

node1 is an example of the created container's name.

dir1 is an example of the node's shared directory name.

Write down the port shown in the welcome message, then open a new terminal and launch another node pointing to the previous one:

docker run -it --rm --name node2 --network ring-net carlossanchezh/p2p-ring-network:latest bash -c "mkdir -p /tmp/dir2 && exec ./ring /tmp/dir2 node1 <NODE1_PORT>"

You can launch more nodes, linking each one to another node of the ring to expand the network.

⁠Repository

https://github.com/carlossanchezh/p2p-ring-network⁠

Tag summary

Content type

Image

Digest

sha256:d904a6fd2…

Size

96.4 MB

Last updated

17 days ago

docker pull carlossanchezh/p2p-ring-network