NODEIPFSID starts with 12D3KooW
This commit is contained in:
parent
4f2a93813b
commit
765741151c
|
@ -42,7 +42,7 @@ export isG1smsRunning=$(ps auxf --sort=+utime | grep -w gammu | grep -v -E 'colo
|
||||||
export isKodiRunning=$(ps auxf --sort=+utime | grep -w kodi | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
export isKodiRunning=$(ps auxf --sort=+utime | grep -w kodi | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
||||||
|
|
||||||
# ? isNextcloudRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
# ? isNextcloudRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
||||||
### DETECT FLAVOURS (TODO: Publish and share into ipfs/.Qm***/ )
|
### DETECT FLAVOURS (TODO: Publish and share into ipfs/.12D3KooW***/ )
|
||||||
########################################################################
|
########################################################################
|
||||||
cd $MY_PATH
|
cd $MY_PATH
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ if [[ ! -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna ]]; then
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# GIVE NAME TO NODE G1 WALLET: "6789diceware"
|
# GIVE NAME TO NODE G1 WALLET: "6789diceware"
|
||||||
# And write /home/$YOU/.zen/g1sms/.Qm***/G1SSB/(_files)
|
# And write /home/$YOU/.zen/g1sms/.12D3KooW***/G1SSB/(_files)
|
||||||
####################################################################
|
####################################################################
|
||||||
PRE=${ADMINPHONE:8:4}
|
PRE=${ADMINPHONE:8:4}
|
||||||
ZUID=$(/home/$YOU/.zen/astroport/zen/tools/diceware.sh 1 | xargs)
|
ZUID=$(/home/$YOU/.zen/astroport/zen/tools/diceware.sh 1 | xargs)
|
||||||
|
@ -93,7 +93,7 @@ $NODE_UIDNA
|
||||||
|
|
||||||
############ If sudo without password activated (Raspbian)
|
############ If sudo without password activated (Raspbian)
|
||||||
# SYSTEM MODIFY hosts & hostname ###########################
|
# SYSTEM MODIFY hosts & hostname ###########################
|
||||||
# WRITE NODE uidna NAME TO /etc/hosts & .Qm*/_uidna file
|
# WRITE NODE uidna NAME TO /etc/hosts & .12D3KooW*/_uidna file
|
||||||
# sudo echo "127.0.0.101 $NODE_UIDNA" >> /etc/hosts
|
# sudo echo "127.0.0.101 $NODE_UIDNA" >> /etc/hosts
|
||||||
# sudo echo "$NODE_UIDNA" > /etc/hostname
|
# sudo echo "$NODE_UIDNA" > /etc/hostname
|
||||||
############################################################
|
############################################################
|
||||||
|
|
|
@ -26,13 +26,13 @@ _chain.prev _ipfs.publishkey.crypt _passenger.ipfs.BB.aes _QRCODE.read.p
|
||||||
~/.zen/ipfs_swarm
|
~/.zen/ipfs_swarm
|
||||||
|
|
||||||
# Each "G1SSBIPFS" Node publish ID and DATA indexes
|
# Each "G1SSBIPFS" Node publish ID and DATA indexes
|
||||||
~/.zen/ipfs_swarm/.Qm***/
|
~/.zen/ipfs_swarm/.12D3KooW***/
|
||||||
# Other Swarm Node access with "ipfs ls /ipns/Qm***/.Qm***"
|
# Other Swarm Node access with "ipfs ls /ipns/Qm***/.12D3KooW***"
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> ~/.zen/ipfs_swarm/.Qm*** sub directory is used for exchanging messages between peers
|
> ~/.zen/ipfs_swarm/.12D3KooW*** sub directory is used for exchanging messages between peers
|
||||||
|
|
||||||
> cron_MINUTE.sh monitor all LOCAL channels populated/monitored through to ~/.zen/ipfs_swarm
|
> cron_MINUTE.sh monitor all LOCAL channels populated/monitored through to ~/.zen/ipfs_swarm
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ echo 'Are you sure? LOVE economy is made of LOVE...' && exit 1
|
||||||
rm -f ~/.ipfs/keystore/*.key
|
rm -f ~/.ipfs/keystore/*.key
|
||||||
rm -Rf ~/.zen/tag/*
|
rm -Rf ~/.zen/tag/*
|
||||||
rm -Rf ~/.zen/ipfs/.$ipfsnodeid/TAG
|
rm -Rf ~/.zen/ipfs/.$ipfsnodeid/TAG
|
||||||
rm -Rf ~/.zen/ipfs_swarm/.Qm*
|
rm -Rf ~/.zen/ipfs_swarm/.12D3KooW*
|
||||||
rm -Rf ~/.zen/ipfs_swarm/*
|
rm -Rf ~/.zen/ipfs_swarm/*
|
||||||
|
|
||||||
### EMPTY miam STOMACK
|
### EMPTY miam STOMACK
|
||||||
|
|
|
@ -25,7 +25,7 @@ if [[ $(which gammu) ]]; then
|
||||||
ipfs p2p listen /x/g1sms /ip4/127.0.0.1/tcp/10099
|
ipfs p2p listen /x/g1sms /ip4/127.0.0.1/tcp/10099
|
||||||
else
|
else
|
||||||
# Looking for g1sms NODE in my swarm
|
# Looking for g1sms NODE in my swarm
|
||||||
SMSNODE=$(ls /home/$YOU/.zen/ipfs_swarm/.Qm*/G1SSB/_g1sms | shuf -n 1 | cut -d '/' -f 6 | cut -d '.' -f 2)
|
SMSNODE=$(ls /home/$YOU/.zen/ipfs_swarm/.12D3KooW*/G1SSB/_g1sms | shuf -n 1 | cut -d '/' -f 6 | cut -d '.' -f 2)
|
||||||
sleep $((1 + RANDOM % 10)) # Wait for DHT to propagate.... Then forward /x/g1sms
|
sleep $((1 + RANDOM % 10)) # Wait for DHT to propagate.... Then forward /x/g1sms
|
||||||
[[ $SMSNODE ]] && ipfs p2p forward /x/g1sms /ip4/127.0.0.1/tcp/10097 /p2p/$SMSNODE
|
[[ $SMSNODE ]] && ipfs p2p forward /x/g1sms /ip4/127.0.0.1/tcp/10097 /p2p/$SMSNODE
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -14,7 +14,7 @@ ME="${0##*/}"
|
||||||
############# '$MY_PATH/$ME'
|
############# '$MY_PATH/$ME'
|
||||||
########################################################################
|
########################################################################
|
||||||
# ex: ./'$ME'
|
# ex: ./'$ME'
|
||||||
# SYNC IPFS SWARM PEERS SHARED DATA .Qm****
|
# SYNC IPFS SWARM PEERS SHARED DATA .12D3KooW****
|
||||||
########################################################################'
|
########################################################################'
|
||||||
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||||
export IPFSNODEID=$(ipfs id -f='<id>\n')
|
export IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||||
|
@ -39,12 +39,12 @@ NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS)
|
||||||
ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$IPFSNODEID
|
ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$IPFSNODEID
|
||||||
|
|
||||||
echo "REFRESHING /home/$YOU/.zen/ipfs_swarm/ from my SWARM peers"
|
echo "REFRESHING /home/$YOU/.zen/ipfs_swarm/ from my SWARM peers"
|
||||||
rm -Rf /home/$YOU/.zen/ipfs_swarm/.Qm*
|
rm -Rf /home/$YOU/.zen/ipfs_swarm/.12D3KooW*
|
||||||
rm -Rf /home/$YOU/.zen/ipfs_swarm/*
|
rm -Rf /home/$YOU/.zen/ipfs_swarm/*
|
||||||
|
|
||||||
count=1
|
count=1
|
||||||
# Search for All peers Nodes. ## TODO: To be changed when Swarm is too big or not expanding
|
# Search for All peers Nodes. ## TODO: To be changed when Swarm is too big or not expanding
|
||||||
#for id in $(ls -d ~/.zen/ipfs_swarm/.Qm* | cut -d '.' -f 3); # Alternative search...
|
#for id in $(ls -d ~/.zen/ipfs_swarm/.12D3KooW* | cut -d '.' -f 3); # Alternative search...
|
||||||
for peer in $(ipfs swarm peers);
|
for peer in $(ipfs swarm peers);
|
||||||
do
|
do
|
||||||
id=$(echo "$peer" | grep 'ip4' | awk -F '/' '{print $7}')
|
id=$(echo "$peer" | grep 'ip4' | awk -F '/' '{print $7}')
|
||||||
|
|
|
@ -48,7 +48,7 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "REMOVE OLD TASK MARKED AS DONE"
|
echo "REMOVE OLD TASK MARKED AS DONE"
|
||||||
for scan in /home/$YOU/.zen/ipfs_swarm/.Qm*/TASK/done.*; do
|
for scan in /home/$YOU/.zen/ipfs_swarm/.12D3KooW*/TASK/done.*; do
|
||||||
lscan=$(echo $scan | sed s/_swarm//g ) ## Remove _swarm
|
lscan=$(echo $scan | sed s/_swarm//g ) ## Remove _swarm
|
||||||
lid=$(echo $scan | cut -d '/' -f 6 | cut -d '.' -f 2 ) ## Get matching IPFSNODEID
|
lid=$(echo $scan | cut -d '/' -f 6 | cut -d '.' -f 2 ) ## Get matching IPFSNODEID
|
||||||
lnano=$(echo $scan | cut -d '/' -f 8 | cut -d '.' -f 2 ) ## Get done timestamp
|
lnano=$(echo $scan | cut -d '/' -f 8 | cut -d '.' -f 2 ) ## Get done timestamp
|
||||||
|
|
|
@ -14,7 +14,7 @@ ME="${0##*/}"
|
||||||
############# '$MY_PATH/$ME'
|
############# '$MY_PATH/$ME'
|
||||||
########################################################################
|
########################################################################
|
||||||
# ex: ./'$ME'
|
# ex: ./'$ME'
|
||||||
# SYNC IPFS SWARM PEERS SHARED DATA .Qm****
|
# SYNC IPFS SWARM PEERS SHARED DATA .12D3KooW****
|
||||||
########################################################################'
|
########################################################################'
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
|
@ -25,7 +25,7 @@ if [[ $(which gammu) ]]; then
|
||||||
ipfs p2p listen /x/g1sms /ip4/127.0.0.1/tcp/10099
|
ipfs p2p listen /x/g1sms /ip4/127.0.0.1/tcp/10099
|
||||||
else
|
else
|
||||||
# Looking for g1sms NODE in my swarm
|
# Looking for g1sms NODE in my swarm
|
||||||
SMSNODE=$(ls /home/$YOU/.zen/ipfs_swarm/.Qm*/G1SSB/_g1sms | shuf -n 1 | cut -d '/' -f 6 | cut -d '.' -f 2)
|
SMSNODE=$(ls /home/$YOU/.zen/ipfs_swarm/.12D3KooW*/G1SSB/_g1sms | shuf -n 1 | cut -d '/' -f 6 | cut -d '.' -f 2)
|
||||||
# Wait for DHT to propagate.... before getting eventual /x/g1sms forward
|
# Wait for DHT to propagate.... before getting eventual /x/g1sms forward
|
||||||
[[ $SMSNODE ]] && sleep $((1 + RANDOM % 10)) && ipfs p2p forward /x/g1sms /ip4/127.0.0.1/tcp/10097 /p2p/$SMSNODE
|
[[ $SMSNODE ]] && sleep $((1 + RANDOM % 10)) && ipfs p2p forward /x/g1sms /ip4/127.0.0.1/tcp/10097 /p2p/$SMSNODE
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -67,9 +67,9 @@ do
|
||||||
$MY_PATH/ipfs_SWARM_refresh.sh
|
$MY_PATH/ipfs_SWARM_refresh.sh
|
||||||
# SWARM ALREADY DONE IT ??
|
# SWARM ALREADY DONE IT ??
|
||||||
# IS LIKE "SELECT FROM ipfs_swarm WHERE _tag.zensource=$timestamp"(or something like that in SQL), means a ZenTag already exists.
|
# IS LIKE "SELECT FROM ipfs_swarm WHERE _tag.zensource=$timestamp"(or something like that in SQL), means a ZenTag already exists.
|
||||||
CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.Qm*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
||||||
# OR SWARM PROCESS IN ACTION (NB: copy tasks must be asynchronous in swarm)
|
# OR SWARM PROCESS IN ACTION (NB: copy tasks must be asynchronous in swarm)
|
||||||
[[ ! $CHECKSWARM ]] && CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.Qm*/TAG/process.timestamp.ssb | tail -n 1 | cut -f 6 -d '/')
|
[[ ! $CHECKSWARM ]] && CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/process.timestamp.ssb | tail -n 1 | cut -f 6 -d '/')
|
||||||
[[ $CHECKSWARM ]] \
|
[[ $CHECKSWARM ]] \
|
||||||
&& echo "$timestamp ALREADY on NODE $CHECKSWARM CONTINUE" \
|
&& echo "$timestamp ALREADY on NODE $CHECKSWARM CONTINUE" \
|
||||||
&& echo "$timestamp" > ~/.zen/zenyta.last.ts \
|
&& echo "$timestamp" > ~/.zen/zenyta.last.ts \
|
||||||
|
|
|
@ -65,9 +65,9 @@ do
|
||||||
# SWARM REFRESH
|
# SWARM REFRESH
|
||||||
$MY_PATH/ipfs_SWARM_refresh.sh
|
$MY_PATH/ipfs_SWARM_refresh.sh
|
||||||
# SWARM ALREADY DONE
|
# SWARM ALREADY DONE
|
||||||
CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.Qm*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
||||||
# OR SWARM PROCESS IN ACTION
|
# OR SWARM PROCESS IN ACTION
|
||||||
[[ ! $CHECKSWARM ]] && CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.Qm*/TAG/process.timestamp.ssb | tail -n 1 | cut -f 6 -d '/')
|
[[ ! $CHECKSWARM ]] && CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/process.timestamp.ssb | tail -n 1 | cut -f 6 -d '/')
|
||||||
[[ $CHECKSWARM ]] \
|
[[ $CHECKSWARM ]] \
|
||||||
&& echo "$timestamp ALREADY on NODE $CHECKSWARM CONTINUE" \
|
&& echo "$timestamp ALREADY on NODE $CHECKSWARM CONTINUE" \
|
||||||
&& echo "$timestamp" > ~/.zen/zenytv.last.ts \
|
&& echo "$timestamp" > ~/.zen/zenytv.last.ts \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
## In case OLD IPFSNODEID exists (remove it)
|
## In case OLD IPFSNODEID exists (remove it)
|
||||||
IPFSNODEID=$(ipfs id -f='<id>\n') && [[ $IPFSNODEID == "" ]] && exit 1
|
IPFSNODEID=$(ipfs id -f='<id>\n') && [[ $IPFSNODEID == "" ]] && exit 1
|
||||||
for DOTQm in ~/.zen/ipfs/.Qm*; do
|
for DOTQm in ~/.zen/ipfs/.12D3KooW*; do
|
||||||
Qm=$(echo $DOTQm | cut -d '/' -f 6 | cut -d '.' -f 2)
|
Qm=$(echo $DOTQm | cut -d '/' -f 6 | cut -d '.' -f 2)
|
||||||
[[ "$Qm" != "$IPFSNODEID" && "$Qm" != "" ]] && rm -Rf $DOTQm && echo "OLD IPFS ID REMOVED"
|
[[ "$Qm" != "$IPFSNODEID" && "$Qm" != "" ]] && rm -Rf $DOTQm && echo "OLD IPFS ID REMOVED"
|
||||||
done
|
done
|
||||||
|
|
|
@ -125,7 +125,7 @@ AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1) # ZenTag Name SHA256
|
||||||
|
|
||||||
# TODO ACTIVATE SWARM UNICITY CHECK
|
# TODO ACTIVATE SWARM UNICITY CHECK
|
||||||
# Create Unique Zentag for all IPFS SWARM!
|
# Create Unique Zentag for all IPFS SWARM!
|
||||||
while [[ $(grep -Rwl "$AA" ~/.zen/ipfs_swarm/.Qm*/TAG/*/_tag.uid) ]]; do
|
while [[ $(grep -Rwl "$AA" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.uid) ]]; do
|
||||||
AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g )
|
AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g )
|
||||||
AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1)
|
AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1)
|
||||||
done
|
done
|
||||||
|
@ -210,7 +210,7 @@ echo "
|
||||||
|
|
||||||
"
|
"
|
||||||
# SEARCH FOR SAME SOURCE in IPFS... Not to make it twice...
|
# SEARCH FOR SAME SOURCE in IPFS... Not to make it twice...
|
||||||
CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs_swarm/.Qm*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
||||||
[[ $CHECKSWARM == "" ]] && CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs/.$IPFSNODEID/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
[[ $CHECKSWARM == "" ]] && CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs/.$IPFSNODEID/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
|
||||||
[[ -s ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer ]] && ISSUERSWARM=$(cat ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer)
|
[[ -s ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer ]] && ISSUERSWARM=$(cat ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer)
|
||||||
[[ "$CHECKSWARM" != "" && "$ISSUERSWARM" == "$ISSUER" ]] && ipfs key rm $keyname && rm -Rf ~/.zen/tag/${AAH} \
|
[[ "$CHECKSWARM" != "" && "$ISSUERSWARM" == "$ISSUER" ]] && ipfs key rm $keyname && rm -Rf ~/.zen/tag/${AAH} \
|
||||||
|
|
Loading…
Reference in New Issue