diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f5daeb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/chord-node diff --git a/test.bash b/test.bash new file mode 100755 index 0000000..f884f98 --- /dev/null +++ b/test.bash @@ -0,0 +1,19 @@ +#!/bin/bash + +set -ex + +go build -o ./chord-node + +# Test create and join. +./chord-node join -ip 127.0.0.1:3000 & +FIRST=$! +sleep 3 + +./chord-node join -ip 127.0.0.1:3001 -c 127.0.0.1:3000 & +SECOND=$! +./chord-node join -ip 127.0.0.1:3002 -c 127.0.0.1:3000 & +THIRD=$! + +sleep 5 +# Each node logs its predecessor and successors. At this point, we see the ring. +kill $FIRST $SECOND $THIRD