P2P ring network for file sharing in C over TCP sockets.
69
A P2P ring network for file sharing, implemented in C over TCP sockets.
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-netis 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"
node1is an example of the created container's name.
dir1is 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.
Content type
Image
Digest
sha256:d904a6fd2…
Size
96.4 MB
Last updated
17 days ago
docker pull carlossanchezh/p2p-ring-network