better log

This commit is contained in:
fred 2021-08-09 20:44:56 +02:00
parent 2571508f76
commit 22d217c457
1 changed files with 3 additions and 1 deletions

View File

@ -11,9 +11,10 @@ IPFSNODEID=$(ipfs --timeout=30s id -f='<id>\n')
[[ $IPFSNODEID == "" ]] && echo "ipfs TIMEOUT" && exit 1
########################################################################
echo "PUBLISHING ~/.zen/ipfs SELF http://127.0.0.1:8181/ipns/$IPFSNODEID"
echo "Adding ~/.zen/ipfs to IPFS"
MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)
echo "OLD: $OLDCHAIN != NEW:$MIPFS ?"
if [[ "$OLDCHAIN" != "$MIPFS" ]] # MODIFY CHAIN only if something was changed
then
echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/.timestamp
@ -21,6 +22,7 @@ then
NODEIPNS=$(ipfs --timeout=180s name publish --quieter /ipfs/$MIPFS)
echo "$NODEIPNS:TIME:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.timestamp):CHAIN:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)"
fi
echo "PUBLISHED ~/.zen/ipfs TO http://127.0.0.1:8181/ipns/$IPFSNODEID"
########################################################################
## READ BLOCK CHAIN ##
# TIME=$(ipfs cat /ipns/${IPFSNODEID}/.${IPFSNODEID}/.timestamp)