-
Notifications
You must be signed in to change notification settings - Fork 0
/
swarm-client.sh
81 lines (57 loc) · 2.36 KB
/
swarm-client.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# Author: push at ravenland.org
# Date: 26/04/2019
# Description: A Basic Client Service that can be daemonised with SystemD on Linux Systems to provide an infrastructural integrity
# service for all Ravencoin IPFS objects existing on the Ravencoin chain. Begone lost interplanetary files on the Ravencoin IPFS network.
# data loss on IPFS Ravencoin begone!
# to be added to cron.daily
# Mirror all IPFS on Ravencoin chain from source at Seed master.
spinner() {
local i sp n
sp='/-\|'
n=${#sp}
printf ' '
while sleep 0.1; do
printf "%s\b" "${sp:i++%n:1}"
done
}
finish() {
killall swarm-client.sh
}
trap finish EXIT
cat banner;
sleep 3
echo "Ravencoin IPFS Swarm + IPFS Mirror Service"; sleep 1;
echo "created by [email protected] (C) 2019"; sleep 1;
echo "Connecting to master Swarm Server via IPFS"; sleep 1;
# client command to connect to Ravenland Ravencoin swarm service
ipfs swarm connect /ip4/91.134.145.4/tcp/4001/ipfs/QmdgR69oTuHDoUjRrhYSiz5cpkXCj371vmF6qx3uxPkSSJ
echo "adding Ravenland Ravencoin IPFS Mirror Service to your IPFS Bootstrap configuration"; sleep 1;
# client command to permanently bootstrap your client to Ravenland Ravencoin Swarm Service
ipfs bootstrap add /ip4/91.134.145.4/tcp/4001/ipfs/QmdgR69oTuHDoUjRrhYSiz5cpkXCj371vmF6qx3uxPkSSJ
curl -L bootstrap.ravenland.org/ravencoin_ipfs_list_$(date +%Y-%m-%d).txt > allipfs
# Create working Sync directory
mkdir sync
cd sync;
while read -r hash; do
printf 'Synchronising Ravencoin IPFS_Hash Object $hash: '
spinner &
wget -c "https://gateway.ravenland.org/ipfs/$hash";
kill "$!" 2> /dev/null;
wait "$!" 2> /dev/null;
printf "\nAdding Object as IPFS Pin.. "
spinner &
ipfs pin add $hash;
kill "$!" 2> /dev/null
wait "$!" 2> /dev/null # kill the spinner
printf '\n';
done < "../allipfs"
#while read -r hash2; do
# ipfs pin add $hash2
#done < "../allipfs"
# client command to connect to Ravenland Ravencoin swarm service
ipfs swarm connect /ip4/91.134.145.4/tcp/4001/ipfs/QmdgR69oTuHDoUjRrhYSiz5cpkXCj371vmF6qx3uxPkSSJ
# client command to permanently bootstrap your client to Ravenland Ravencoin Swarm Service
ipfs bootstrap add /ip4/91.134.145.4/tcp/4001/ipfs/QmdgR69oTuHDoUjRrhYSiz5cpkXCj371vmF6qx3uxPkSSJ
# connection may not be persistent
# Some additional steps may be necessary. Whilst this work in progress.