Now PIN MEDIAKEY is re-published by bootstrap (avoid DHT emptyness when station is OFF)

This commit is contained in:
qo-op 2021-06-29 02:16:03 +02:00
parent c98a5bc7b6
commit d5feff7d4f
2 changed files with 3 additions and 2 deletions

View File

@ -216,10 +216,10 @@ done
## Then refresh MEDIAKEY IPNS/IPFS RELATION
## CORRECT ISSUE : https://git.p2p.legal/axiom-team/astrXbian/issues/25
########################################################################
for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK);
for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK); do
ipnsid=$(cat $ipnslink)
ipfsid=$(echo $ipnslink | cut -d '/' -f 6)
mediakey=$(cat~/.zen/PIN/${ipfsid}/MEDIAKEY)
mediakey=$(cat ~/.zen/PIN/${ipfsid}/MEDIAKEY)
[[ ! $(ipfs key list | grep ${mediakey}) ]] && echo "ERROR MISSING MEDIAKEY" && continue

View File

@ -48,6 +48,7 @@ do
[[ ! -f ~/.ipfs/keystore/$KEYFILE ]] && mv /tmp/ipns.mediakey ~/.ipfs/keystore/$KEYFILE || echo "KEYSTORE EXISTING. EXIT" && continue
echo "${mediakey}" > ~/.zen/PIN/${astrofile}/MEDIAKEY
echo "$(ipfs key list -l | grep ${mediakey} | cut -d ' ' -f 1)" > ~/.zen/PIN/${astrofile}/IPNSLINK
## USED BY BOOTSTRAP IN ipns_TAG_refresh.sh TO REFRESH MEDIAKEY publishing
fi
fi
else