github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/test/3nodetest/client/run.sh (about) 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 3 4 echo "3nodetest> starting client daemon" 5 6 ipfs daemon --debug & 7 sleep 3 8 9 # switch dirs so ipfs client profiling data doesn't overwrite the ipfs daemon 10 # profiling data 11 cd /tmp 12 13 while [ ! -f /data/idtiny ] 14 do 15 echo "3nodetest> waiting for server to add the file..." 16 sleep 1 17 done 18 echo "3nodetest> client found file with hash:" $(cat /data/idtiny) 19 20 ipfs cat $(cat /data/idtiny) > filetiny 21 22 cat filetiny 23 24 diff -u filetiny /data/filetiny 25 26 if (($? > 0)); then 27 printf '%s\n' 'files did not match' >&2 28 exit 1 29 fi 30 31 while [ ! -f /data/idrand ] 32 do 33 echo "3nodetest> waiting for server to add the file..." 34 sleep 1 35 done 36 echo "3nodetest> client found file with hash:" $(cat /data/idrand) 37 38 cat /data/idrand 39 40 ipfs cat $(cat /data/idrand) > filerand 41 42 if (($? > 0)); then 43 printf '%s\n' 'ipfs cat failed' >&2 44 exit 1 45 fi 46 47 diff -u filerand /data/filerand 48 49 if (($? > 0)); then 50 printf '%s\n' 'files did not match' >&2 51 exit 1 52 fi 53 54 echo "3nodetest> success"