forked from STI/Astroport.ONE
v0.2
This commit is contained in:
parent
84033b7ab7
commit
74979908c9
28
README.md
28
README.md
|
@ -73,6 +73,34 @@ NAVIGATEUR JOUEUR
|
||||||
- aptitudes / équipements
|
- aptitudes / équipements
|
||||||
- arbres informationnels, projection de rêves.
|
- arbres informationnels, projection de rêves.
|
||||||
|
|
||||||
|
---
|
||||||
|
# astrXbian Balise Structure
|
||||||
|
|
||||||
|
Chaque Astronaute quand il se connecte transmet ses G1 clefs au démon ipfs.
|
||||||
|
|
||||||
|
Voici où se situe ses chaines...
|
||||||
|
|
||||||
|
~/.zen/game/players/$PLAYER/moa
|
||||||
|
~/.zen/game/players/$PLAYER/keystore
|
||||||
|
~/.zen/game/players/$PLAYER/secret.dunikey
|
||||||
|
~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/G1SSB/
|
||||||
|
|
||||||
|
Dans IPFS, chaque MEDIA ajouté est associé à une première clef "créateur".
|
||||||
|
Chaque "contrat" permettant de libérer le MEDIA est inscrit en tant que index.html de chaque sous-répertoire.
|
||||||
|
Le contrat final correspond à enchainer la découverte des sous-répertoires, avant le dernier contenant le HASH recherché.
|
||||||
|
|
||||||
|
'G1SSB' contient le contrat "Identité du joueur", Astronaute.
|
||||||
|
'FRIENDS' les contrats et niveau de confiance déclarés.
|
||||||
|
'KEY' les contrats envers des oeuvres numériques ou numérisées (NFT).
|
||||||
|
|
||||||
|
Ces données sont diffusées au travers de la balise IPFS du joueur quand il est connecté.
|
||||||
|
|
||||||
|
Le joueur possède les clefs des canaux 'moa_player' et 'qo-op_player', ce sont ses journaux.
|
||||||
|
Le premier lié à l'administration du jeu et des joueurs
|
||||||
|
Le second public. L'équivalent d'une chaine multimédia collectivement approvisionnées...
|
||||||
|
|
||||||
|
L'interface de ces journaux est TiddlyWiki, chaque enregistrement se trouve enregistré en blockchain par le capitaine.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -25,40 +25,12 @@ source ~/.zen/ipfs.sync; echo "CAPTAIN is $CAPTAIN"
|
||||||
|
|
||||||
[[ $PLAYER != $CAPTAIN ]] && echo "CAPTAIN RUN ONLY. EXIT" && exit 1
|
[[ $PLAYER != $CAPTAIN ]] && echo "CAPTAIN RUN ONLY. EXIT" && exit 1
|
||||||
|
|
||||||
# Remove old _SLICKDIV_
|
|
||||||
rm ~/.zen/game/players/$CAPTAIN/moa/slick.div 2>/dev/null
|
|
||||||
|
|
||||||
for player in $(ls ~/.zen/game/players/); do
|
|
||||||
|
|
||||||
|
|
||||||
moans=$(cat ~/.zen/game/players/$player/.moans)
|
|
||||||
# CHECK DIFFERENCES FROM LATEST TIME CHECK
|
|
||||||
## GETTING LAST 'player_moa' ONLINE VERSION
|
|
||||||
ipfs cat /ipns/$moans > ~/.zen/game/players/$player/moa/index.html
|
|
||||||
IPUSH=$(ipfs add -Hq ~/.zen/game/players/$player/moa/index.html | tail -n 1)
|
|
||||||
|
|
||||||
# Avance la blockchain CAPTAIN pour archiver les '$player.moa.chain' des Etats modifiés
|
|
||||||
[[ $(cat ~/.zen/game/players/$CAPTAIN/moa/$player.moa.chain 2>/dev/null) != "$IPUSH" ]] &&\
|
|
||||||
echo $IPUSH > ~/.zen/game/players/$CAPTAIN/moa/$player.moa.chain && \
|
|
||||||
echo $MOATS > ~/.zen/game/players/$CAPTAIN/moa/$player.moa.ts && \
|
|
||||||
echo "$player 'moa' UPDATE : $MOATS $IPUSH" && \
|
|
||||||
echo "<div class='multiple'><h4>$player</h4></div>" >> ~/.zen/game/players/$CAPTAIN/moa/slick.div
|
|
||||||
# echo "<div class='multiple'><h4><a href='http://127.0.0.1:8080/ipns/"${moans}"' target=${moans}>$player</a></h4></div>" >> ~/.zen/game/players/$CAPTAIN/moa/slick.div && \
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
MOANS=$(ipfs key list -l | grep -w moa | cut -d ' ' -f 1) ## GET CAPTAIN PLAYER NS PUBKEY
|
MOANS=$(ipfs key list -l | grep -w moa | cut -d ' ' -f 1) ## GET CAPTAIN PLAYER NS PUBKEY
|
||||||
|
|
||||||
CAPTAINNS=$(ipfs key list -l | grep -w $CAPTAIN | cut -d ' ' -f 1) ## GET CAPTAIN PLAYER NS PUBKEY
|
CAPTAINNS=$(ipfs key list -l | grep -w $CAPTAIN | cut -d ' ' -f 1) ## GET CAPTAIN PLAYER NS PUBKEY
|
||||||
CAPTAINMOANS=$(ipfs key list -l | grep -w moa_$CAPTAIN | cut -d ' ' -f 1)
|
CAPTAINMOANS=$(ipfs key list -l | grep -w moa_$CAPTAIN | cut -d ' ' -f 1)
|
||||||
CAPTAINQOOPNS=$(ipfs key list -l | grep -w qo-op_$CAPTAIN | cut -d ' ' -f 1)
|
CAPTAINQOOPNS=$(ipfs key list -l | grep -w qo-op_$CAPTAIN | cut -d ' ' -f 1)
|
||||||
|
|
||||||
# Get one line
|
|
||||||
[[ ! -f ~/.zen/game/players/$CAPTAIN/moa/slick.div ]] && echo "http://127.0.0.1:8080/ipns/$CAPTAINNS/slick.html" && exit 0
|
|
||||||
|
|
||||||
SLICKDIV=$(<~/.zen/game/players/$CAPTAIN/moa/slick.div);
|
|
||||||
echo $SLICKDIV
|
|
||||||
|
|
||||||
# Copying homepage.html template
|
# Copying homepage.html template
|
||||||
cat ${MY_PATH}/../templates/homepage.html > ~/.zen/game/players/$CAPTAIN/moa/slick.html
|
cat ${MY_PATH}/../templates/homepage.html > ~/.zen/game/players/$CAPTAIN/moa/slick.html
|
||||||
sed -i "s~_IPNSL_~/ipns/$MOANS~g" ~/.zen/game/players/$CAPTAIN/moa/slick.html
|
sed -i "s~_IPNSL_~/ipns/$MOANS~g" ~/.zen/game/players/$CAPTAIN/moa/slick.html
|
||||||
|
@ -77,4 +49,27 @@ echo $SLICKDIV
|
||||||
|
|
||||||
echo "http://127.0.0.1:8080/ipns/$CAPTAINNS/slick.html"
|
echo "http://127.0.0.1:8080/ipns/$CAPTAINNS/slick.html"
|
||||||
|
|
||||||
|
|
||||||
|
# UPDATE TW UPDATE CHAIN
|
||||||
|
for player in $(ls ~/.zen/game/players/); do
|
||||||
|
|
||||||
|
|
||||||
|
moans=$(cat ~/.zen/game/players/$player/.moans)
|
||||||
|
# CHECK DIFFERENCES FROM LATEST TIME CHECK
|
||||||
|
## GETTING LAST 'player_moa' ONLINE VERSION
|
||||||
|
echo "Getting $player/.moans /ipns/$moans"
|
||||||
|
ipfs --timeout=10s get -o ~/.zen/game/players/$player/moa/ /ipns/$moans || continue
|
||||||
|
IPUSH=$(ipfs add -Hq ~/.zen/game/players/$player/moa/index.html | tail -n 1)
|
||||||
|
|
||||||
|
# Avance la blockchain CAPTAIN pour archiver les '$player.moa.chain' des Etats modifiés
|
||||||
|
[[ $(cat ~/.zen/game/players/$CAPTAIN/moa/$player.moa.chain 2>/dev/null) != "$IPUSH" ]] &&\
|
||||||
|
echo $IPUSH > ~/.zen/game/players/$CAPTAIN/moa/$player.moa.chain && \
|
||||||
|
echo $MOATS > ~/.zen/game/players/$CAPTAIN/moa/$player.moa.ts && \
|
||||||
|
echo "$player 'moa' UPDATE : $MOATS $IPUSH" && \
|
||||||
|
echo "<div class='multiple'><h4>$player</h4></div>" >> ~/.zen/game/players/$CAPTAIN/moa/slick.div
|
||||||
|
# echo "<div class='multiple'><h4><a href='http://127.0.0.1:8080/ipns/"${moans}"' target=${moans}>$player</a></h4></div>" >> ~/.zen/game/players/$CAPTAIN/moa/slick.div && \
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -61,7 +61,21 @@ echo "==== qo-op & moa Captain/Station keystore ===="; sleep 2
|
||||||
|
|
||||||
# Keep already created keys !!?
|
# Keep already created keys !!?
|
||||||
cp ~/.ipfs/keystore.astrXbian.${PLAYER}.${MOATS}/* ~/.ipfs/keystore/ 2>/dev/null
|
cp ~/.ipfs/keystore.astrXbian.${PLAYER}.${MOATS}/* ~/.ipfs/keystore/ 2>/dev/null
|
||||||
|
###################################################################################
|
||||||
|
# 'tokenring' Key there? TOKENRING IS A SHARED KEY TO KNOW WHO IS NEXT IN MY FRIEND TO WRITE COMMON CHANNEL
|
||||||
|
# In case of corruption... Swarm goes into DEFCON 3 procedure and eject "bad friend"
|
||||||
|
# Shared between Astroport to choose Station next write time.
|
||||||
|
[[ ! -f ~/.ipfs/keystore/key_orxwwzloojuw4zy ]] && qoopns=$(ipfs key gen tokenring)
|
||||||
|
# tokenring show which PLAYER is the actual 'official' qo-op and moa channels publisher/
|
||||||
|
# tokenringnns is used to choose who is next...
|
||||||
|
ipfs key list -l | grep -w tokenring
|
||||||
|
tokenringns=$(ipfs key list -l | grep -w tokenring | cut -d ' ' -f 1)
|
||||||
|
ipfs name publish --key=tokenring /ipfs/$(echo $PLAYER | ipfs add -q) 2>/dev/null
|
||||||
|
|
||||||
|
echo "----> 'tokenringnns' WHO IS NEXT : http://127.0.0.1:8080/ipns/$tokenringns"; sleep 1
|
||||||
|
echo "$tokenringnns" > ~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/.tokenringnns ## 'tokenring' is "who is next player to play"
|
||||||
|
|
||||||
|
###################################################################################
|
||||||
# 'qo-op' Key there? Or Captain already join a flag
|
# 'qo-op' Key there? Or Captain already join a flag
|
||||||
# Astroport public channel 'state of mind' propagation...
|
# Astroport public channel 'state of mind' propagation...
|
||||||
[[ ! -f ~/.ipfs/keystore/key_ofxs233q ]] &&\
|
[[ ! -f ~/.ipfs/keystore/key_ofxs233q ]] &&\
|
||||||
|
@ -75,6 +89,7 @@ echo "==== qo-op & moa Captain/Station keystore ===="; sleep 2
|
||||||
echo "----> Station 'qo-op' channel : http://127.0.0.1:8080/ipns/$qoopns"; sleep 1
|
echo "----> Station 'qo-op' channel : http://127.0.0.1:8080/ipns/$qoopns"; sleep 1
|
||||||
echo "$qoopns" > ~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/.qoopns ## 'qo-op' public channel declared in ipfs balise
|
echo "$qoopns" > ~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/.qoopns ## 'qo-op' public channel declared in ipfs balise
|
||||||
|
|
||||||
|
###################################################################################
|
||||||
# 'moa' Key there? It is the 'Administrative' 3 star.level confidence information layer.
|
# 'moa' Key there? It is the 'Administrative' 3 star.level confidence information layer.
|
||||||
[[ ! -f ~/.ipfs/keystore/key_nvxwc ]] &&\
|
[[ ! -f ~/.ipfs/keystore/key_nvxwc ]] &&\
|
||||||
moans=$(ipfs key gen moa) && \
|
moans=$(ipfs key gen moa) && \
|
||||||
|
@ -87,22 +102,23 @@ echo "==== qo-op & moa Captain/Station keystore ===="; sleep 2
|
||||||
echo "----> Station 'moa' channel : http://127.0.0.1:8080/ipns/$moans"; sleep 1
|
echo "----> Station 'moa' channel : http://127.0.0.1:8080/ipns/$moans"; sleep 1
|
||||||
echo "$moans" > ~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/.moans ## 'moa' captain controled channel
|
echo "$moans" > ~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/.moans ## 'moa' captain controled channel
|
||||||
|
|
||||||
echo
|
###################################################################################
|
||||||
echo "===== Connect captain IPFS datadir to Station (balise junction) ====="; sleep 2
|
echo
|
||||||
|
echo "===== Connect captain IPFS datadir to Station (balise junction) ====="; sleep 2
|
||||||
|
|
||||||
[[ -d ~/.zen/ipfs.astrXbian ]] && mv ~/.zen/ipfs.astrXbian ~/.zen/ipfs.astrXbian.${MOATS} && echo "BACKUP ~/.zen/ipfs.astrXbian.${MOATS}"; sleep 2
|
[[ ! -d ~/.zen/ipfs.astrXbian ]] && mv ~/.zen/ipfs ~/.zen/ipfs.astrXbian && echo "BACKUP ~/.zen/ipfs.astrXbian" || rm ~/.zen/ipfs; sleep 2
|
||||||
mv ~/.zen/ipfs ~/.zen/ipfs.astrXbian && echo "BACKUP current ~/.zen/ipfs"; sleep 2
|
mv ~/.zen/ipfs ~/.zen/ipfs.astrXbian && echo "BACKUP current ~/.zen/ipfs"; sleep 2
|
||||||
|
|
||||||
# Linking ~/.zen/ipfs
|
# Linking ~/.zen/ipfs
|
||||||
# ~/.zen/secret.dunikey
|
# ~/.zen/secret.dunikey
|
||||||
[[ ! -f ~/.zen/secret.dunikey.astrXbian ]] && mv ~/.zen/secret.dunikey ~/.zen/secret.dunikey.astrXbian && echo "BACKUP ~/.zen/secret.dunikey.astrXbian"; sleep 2
|
[[ ! -f ~/.zen/secret.dunikey.astrXbian ]] && mv ~/.zen/secret.dunikey ~/.zen/secret.dunikey.astrXbian && echo "BACKUP ~/.zen/secret.dunikey.astrXbian" || rm ~/.zen/secret.dunikey; sleep 2
|
||||||
|
|
||||||
echo "CAPITAINE VOUS ETES EN POSSESSION DES CANAUX PRINCIPAUX DE LA STATION 'qo-op', 'moa', etc ..."
|
echo "CAPITAINE VOUS PRENEZ POSSESSION DE LA STATION ET SES CANAUX 'qo-op', 'moa', etc ..."
|
||||||
ln -s ~/.zen/game/players/$PLAYER/ipfs ~/.zen/ipfs && echo "$PLAYER become 'self' and can manage 'moa' & 'qo-op' channels" && sleep 1
|
ln -s ~/.zen/game/players/$PLAYER/ipfs ~/.zen/ipfs && echo "$PLAYER become IPFS 'self'" && sleep 1
|
||||||
ln -s ~/.zen/game/players/$PLAYER/secret.dunikey ~/.zen/secret.dunikey && echo "Linking your ~/.zen/secret.dunikey with Station" && sleep 1
|
ln -s ~/.zen/game/players/$PLAYER/secret.dunikey ~/.zen/secret.dunikey && echo "Linking your ~/.zen/secret.dunikey to Station" && sleep 1
|
||||||
|
|
||||||
echo "##################################################### OK"
|
echo "##################################################### OK"
|
||||||
echo "Nouvelle Identité 'self' Balise IPFS"; sleep 1
|
echo "Identité 'self' Balise IPFS"; sleep 1
|
||||||
ipfs id -f='<id>\n'
|
ipfs id -f='<id>\n'
|
||||||
echo "##################################################### OK"
|
echo "##################################################### OK"
|
||||||
echo "CAPTAIN=$PLAYER" > ~/.zen/ipfs.sync ## PLAYER IS ASTROPORT CAPTAIN NOW
|
echo "CAPTAIN=$PLAYER" > ~/.zen/ipfs.sync ## PLAYER IS ASTROPORT CAPTAIN NOW
|
||||||
|
@ -119,17 +135,19 @@ echo "=== Switching ~/.ipfs/config ==="; sleep 2
|
||||||
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID); echo $IPFSNODEID
|
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID); echo $IPFSNODEID
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "==== Astronaute keystore activated ===="; sleep 2
|
echo "==== Astronaute keystore switch ===="; sleep 2
|
||||||
|
|
||||||
[[ ! -d ~/.ipfs/keystore.astrXbian ]] && mv ~/.ipfs/keystore ~/.ipfs/keystore.astrXbian || rm ~/.ipfs/keystore
|
[[ ! -d ~/.ipfs/keystore.astrXbian ]] && mv ~/.ipfs/keystore ~/.ipfs/keystore.astrXbian || rm ~/.ipfs/keystore
|
||||||
ln -s ~/.zen/game/players/$PLAYER/keystore ~/.ipfs/keystore
|
ln -s ~/.zen/game/players/$PLAYER/keystore ~/.ipfs/keystore
|
||||||
|
|
||||||
|
|
||||||
echo "==== linking G1 Libre ID to Station ===="; sleep 2
|
echo "==== linking G1 Libre ID and Station ~/.zen/ipfs ===="; sleep 2
|
||||||
|
|
||||||
[[ ! -f ~/.zen/secret.dunikey.astrXbian ]] && mv ~/.zen/secret.dunikey ~/.zen/secret.dunikey.astrXbian || rm ~/.zen/secret.dunikey
|
[[ ! -f ~/.zen/secret.dunikey.astrXbian ]] && mv ~/.zen/secret.dunikey ~/.zen/secret.dunikey.astrXbian || rm ~/.zen/secret.dunikey
|
||||||
ln -s ~/.zen/game/players/$PLAYER/secret.dunikey ~/.zen/secret.dunikey
|
ln -s ~/.zen/game/players/$PLAYER/secret.dunikey ~/.zen/secret.dunikey
|
||||||
|
|
||||||
|
[[ ! -d ~/.zen/ipfs.astrXbian ]] && mv ~/.zen/ipfs ~/.zen/ipfs.astrXbian && echo "BACKUP ~/.zen/ipfs.astrXbian" || rm ~/.zen/ipfs
|
||||||
|
ln -s ~/.zen/game/players/$PLAYER/ipfs ~/.zen/ipfs && echo "$PLAYER ~/.zen/ipfs "
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -194,9 +194,9 @@ else
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.PLAYERNS.png" "$PLAYERNS"
|
qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.PLAYERNS.png" "/ipns/$PLAYERNS"
|
||||||
qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.MOANS.png" "$MOANS"
|
qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.MOANS.png" "/ipns/$MOANS"
|
||||||
qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.QOOPNS.png" "$QOOPNS"
|
qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.QOOPNS.png" "/ipns/$QOOPNS"
|
||||||
|
|
||||||
echo; echo "Création de vos QR codes IPNS, clefs de votre réseau IPFS."; sleep 1
|
echo; echo "Création de vos QR codes IPNS, clefs de votre réseau IPFS."; sleep 1
|
||||||
|
|
||||||
|
|
|
@ -23,18 +23,6 @@ for player in $(ls ~/.zen/game/players/); do
|
||||||
moans=$(cat ~/.zen/game/players/$player/.moans)
|
moans=$(cat ~/.zen/game/players/$player/.moans)
|
||||||
pseudo=$(cat ~/.zen/game/players/$player/.pseudo)
|
pseudo=$(cat ~/.zen/game/players/$player/.pseudo)
|
||||||
|
|
||||||
# CHECK DIFFERENCES FROM LATEST TIME CHECK
|
|
||||||
## GETTING LAST 'player_moa' ONLINE VERSION
|
|
||||||
ipfs cat /ipns/$moans > ~/.zen/game/players/$player/moa/index.html
|
|
||||||
IPUSH=$(ipfs add -Hq ~/.zen/game/players/$player/moa/index.html | tail -n 1)
|
|
||||||
|
|
||||||
# Avance la blockchain CAPTAIN pour archiver les '$player.moa.chain' des Etats modifiés
|
|
||||||
[[ $(cat ~/.zen/game/players/$CAPTAIN/moa/$player.moa.chain 2>/dev/null) != "$IPUSH" ]] &&\
|
|
||||||
echo $IPUSH > ~/.zen/game/players/$CAPTAIN/moa/$player.moa.chain && \
|
|
||||||
echo $MOATS > ~/.zen/game/players/$CAPTAIN/moa/$player.moa.ts && \
|
|
||||||
MODIF=$(cat ~/.zen/game/players/$CAPTAIN/moa/$player.moa.n) && MODIF=$((MODIF+1)) || MODIF=1 && \
|
|
||||||
echo $MODIF > ~/.zen/game/players/$CAPTAIN/moa/$player.moa.n
|
|
||||||
|
|
||||||
echo "$player 'moa' UPDATE : $MOATS $IPUSH" && \
|
echo "$player 'moa' UPDATE : $MOATS $IPUSH" && \
|
||||||
DATA="$DATA { name: '"${pseudo}"', link: '"/ipns/${moans}"', weight: "$(cat ~/.zen/game/players/$CAPTAIN/moa/$player.moa.n)", tooltip: '"${player}"' },"
|
DATA="$DATA { name: '"${pseudo}"', link: '"/ipns/${moans}"', weight: "$(cat ~/.zen/game/players/$CAPTAIN/moa/$player.moa.n)", tooltip: '"${player}"' },"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue