Browse Source

NODEIPFSID starts with 12D3KooW

master
qo-op 1 month ago
parent
commit
765741151c
13 changed files with 21 additions and 21 deletions
  1. +1
    -1
      cron_MINUTE.sh
  2. +2
    -2
      g1sms/init_keys.sh
  3. +3
    -3
      zen/README.md
  4. +1
    -1
      zen/ipfs_EMPTY.sh
  5. +1
    -1
      zen/ipfs_OPEN_ports.sh
  6. +3
    -3
      zen/ipfs_SWARM_refresh.sh
  7. +1
    -1
      zen/ipfs_TASK_do.sh
  8. +1
    -1
      zen/ipns_TAG_refresh.sh
  9. +1
    -1
      zen/port_ipfsp2p_g1sms_all.sh
  10. +2
    -2
      zen/ssb_GET_zenyta.sh
  11. +2
    -2
      zen/ssb_GET_zenytv.sh
  12. +1
    -1
      zen/tools/clean_OLD_ipfs.Qm.sh
  13. +2
    -2
      zen/zen_MAKE.sh

+ 1
- 1
cron_MINUTE.sh View File

@ -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)
# ? 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

+ 2
- 2
g1sms/init_keys.sh View File

@ -57,7 +57,7 @@ if [[ ! -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna ]]; then
####################################################################
# 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}
ZUID=$(/home/$YOU/.zen/astroport/zen/tools/diceware.sh 1 | xargs)
@ -93,7 +93,7 @@ $NODE_UIDNA
############ If sudo without password activated (Raspbian)
# 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 "$NODE_UIDNA" > /etc/hostname
############################################################

+ 3
- 3
zen/README.md View File

@ -26,13 +26,13 @@ _chain.prev _ipfs.publishkey.crypt _passenger.ipfs.BB.aes _QRCODE.read.p
~/.zen/ipfs_swarm
# Each "G1SSBIPFS" Node publish ID and DATA indexes
~/.zen/ipfs_swarm/.Qm***/
# Other Swarm Node access with "ipfs ls /ipns/Qm***/.Qm***"
~/.zen/ipfs_swarm/.12D3KooW***/
# 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

+ 1
- 1
zen/ipfs_EMPTY.sh View File

@ -38,7 +38,7 @@ echo 'Are you sure? LOVE economy is made of LOVE...' && exit 1
rm -f ~/.ipfs/keystore/*.key
rm -Rf ~/.zen/tag/*
rm -Rf ~/.zen/ipfs/.$ipfsnodeid/TAG
rm -Rf ~/.zen/ipfs_swarm/.Qm*
rm -Rf ~/.zen/ipfs_swarm/.12D3KooW*
rm -Rf ~/.zen/ipfs_swarm/*
### EMPTY miam STOMACK

+ 1
- 1
zen/ipfs_OPEN_ports.sh View File

@ -25,7 +25,7 @@ if [[ $(which gammu) ]]; then
ipfs p2p listen /x/g1sms /ip4/127.0.0.1/tcp/10099
else
# 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
[[ $SMSNODE ]] && ipfs p2p forward /x/g1sms /ip4/127.0.0.1/tcp/10097 /p2p/$SMSNODE
fi

+ 3
- 3
zen/ipfs_SWARM_refresh.sh View File

@ -14,7 +14,7 @@ ME="${0##*/}"
############# '$MY_PATH/$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 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
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/*
count=1
# 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);
do
id=$(echo "$peer" | grep 'ip4' | awk -F '/' '{print $7}')

+ 1
- 1
zen/ipfs_TASK_do.sh View File

@ -48,7 +48,7 @@ do
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
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

+ 1
- 1
zen/ipns_TAG_refresh.sh View File

@ -14,7 +14,7 @@ ME="${0##*/}"
############# '$MY_PATH/$ME'
########################################################################
# ex: ./'$ME'
# SYNC IPFS SWARM PEERS SHARED DATA .Qm****
# SYNC IPFS SWARM PEERS SHARED DATA .12D3KooW****
########################################################################'
########################################################################

+ 1
- 1
zen/port_ipfsp2p_g1sms_all.sh View File

@ -25,7 +25,7 @@ if [[ $(which gammu) ]]; then
ipfs p2p listen /x/g1sms /ip4/127.0.0.1/tcp/10099
else
# 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
[[ $SMSNODE ]] && sleep $((1 + RANDOM % 10)) && ipfs p2p forward /x/g1sms /ip4/127.0.0.1/tcp/10097 /p2p/$SMSNODE
fi

+ 2
- 2
zen/ssb_GET_zenyta.sh View File

@ -67,9 +67,9 @@ do
$MY_PATH/ipfs_SWARM_refresh.sh
# 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.
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)
[[ ! $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 ]] \
&& echo "$timestamp ALREADY on NODE $CHECKSWARM CONTINUE" \
&& echo "$timestamp" > ~/.zen/zenyta.last.ts \

+ 2
- 2
zen/ssb_GET_zenytv.sh View File

@ -65,9 +65,9 @@ do
# SWARM REFRESH
$MY_PATH/ipfs_SWARM_refresh.sh
# 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
[[ ! $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 ]] \
&& echo "$timestamp ALREADY on NODE $CHECKSWARM CONTINUE" \
&& echo "$timestamp" > ~/.zen/zenytv.last.ts \

+ 1
- 1
zen/tools/clean_OLD_ipfs.Qm.sh View File

@ -1,7 +1,7 @@
#!/bin/bash
## In case OLD IPFSNODEID exists (remove it)
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" != "$IPFSNODEID" && "$Qm" != "" ]] && rm -Rf $DOTQm && echo "OLD IPFS ID REMOVED"
done

+ 2
- 2
zen/zen_MAKE.sh View File

@ -125,7 +125,7 @@ AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1) # ZenTag Name SHA256
# TODO ACTIVATE SWARM UNICITY CHECK
# 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 )
AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1)
done
@ -210,7 +210,7 @@ echo "
"
# 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 '/')
[[ -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} \

Loading…
Cancel
Save