run.sh 1.02 KB
Newer Older
1
ipfs bootstrap add /ip4/$BOOTSTRAP_PORT_4011_TCP_ADDR/tcp/$BOOTSTRAP_PORT_4011_TCP_PORT/ipfs/QmNXuBh8HFsWq68Fid8dMbGNQTh7eG6hV9rr1fQyfmfomE
2
ipfs bootstrap # list bootstrap nodes for debugging
Brian Tiger Chow's avatar
Brian Tiger Chow committed
3

4

5
echo "3nodetest> starting client daemon"
Brian Tiger Chow's avatar
Brian Tiger Chow committed
6 7 8
ipfs daemon &
sleep 3

9
while [ ! -f /data/idtiny ]
Brian Tiger Chow's avatar
Brian Tiger Chow committed
10
do
11
    echo "3nodetest> waiting for server to add the file..."
Brian Tiger Chow's avatar
Brian Tiger Chow committed
12 13
    sleep 1
done
14
echo "3nodetest> client found file with hash:" $(cat /data/idtiny)
Brian Tiger Chow's avatar
Brian Tiger Chow committed
15

16
ipfs cat $(cat /data/idtiny) > filetiny
Brian Tiger Chow's avatar
Brian Tiger Chow committed
17

18 19 20 21 22 23 24 25 26 27 28
cat filetiny

diff -u filetiny /data/filetiny

if (($? > 0)); then
    printf '%s\n' 'files did not match' >&2
    exit 1
fi

while [ ! -f /data/idrand ]
do
29
    echo "3nodetest> waiting for server to add the file..."
30 31
    sleep 1
done
32
echo "3nodetest> client found file with hash:" $(cat /data/idrand)
33 34 35 36

cat /data/idrand

ipfs cat $(cat /data/idrand) > filerand
Brian Tiger Chow's avatar
Brian Tiger Chow committed
37 38

if (($? > 0)); then
39
    printf '%s\n' 'ipfs cat failed' >&2
Brian Tiger Chow's avatar
Brian Tiger Chow committed
40 41 42
    exit 1
fi

43
diff -u filerand /data/filerand
Brian Tiger Chow's avatar
Brian Tiger Chow committed
44 45 46 47 48 49

if (($? > 0)); then
    printf '%s\n' 'files did not match' >&2
    exit 1
fi

50
echo "3nodetest> success"