swarm.key & gif
This commit is contained in:
parent
45a40859b5
commit
415d4aa814
|
@ -21,6 +21,8 @@ scuttlebutt() {
|
|||
### Install module in ~/.ssb_astroport/node_modules
|
||||
npm install sodium-native ssb-backlinks ssb-ws ssb-links ssb-query ssb-secret-blob ssb-private
|
||||
npm install -g ssb-server
|
||||
### Install oasis webclient (could replace ssb-server, TODO: try it)
|
||||
# npm -g install fraction/oasis#semver:
|
||||
|
||||
# Move node_modules with ssb-server (why do I have to do that? crazy heavy crappy wonderful node.js )
|
||||
ssbSERVER=$(which ssb-server)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 332 KiB |
Binary file not shown.
After Width: | Height: | Size: 634 KiB |
|
@ -32,7 +32,7 @@ DELAY="$1"
|
|||
|
||||
IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||
[[ $IPFSNODEID == "" ]] && echo "$USER Please Install IPFS !!" && exit 1
|
||||
[[ ! -d ~/.zen/g1_TX_inputs ]] && mkdir -p ~/.zen/g1_TX_inputs # Directory containing G1 blockchain incoming TX Scan
|
||||
[[ ! -d ~/.zen/cache/g1_TX_inputs ]] && mkdir -p ~/.zen/cache/g1_TX_inputs # Directory containing G1 blockchain incoming TX Scan
|
||||
[[ ! -d ~/.zen/ipfs ]] && mkdir -p ~/.zen/ipfs # Directory where NODE store SMS & other Channel Wallets
|
||||
[[ ! -d ~/.zen/ipfs_swarm ]] && mkdir -p ~/.zen/ipfs_swarm # Local copy of all SSB friends IPFS Nodes published ipfs
|
||||
|
||||
|
@ -103,11 +103,11 @@ if [[ $DELAYUNIT != "minutes" && $DELAYUNIT != "minute" ]]; then
|
|||
# GET TX HASH
|
||||
TXhash=$(cat /tmp/g1_TX.scan.txt | jq -r '.history.received[].hash' | head -n $line | tail -n 1 )
|
||||
# IT IS A NEW TX?
|
||||
if [[ ! -f ~/.zen/g1_TX_inputs/zen.$TXhash ]]; then
|
||||
if [[ ! -f ~/.zen/cache/g1_TX_inputs/zen.$TXhash ]]; then
|
||||
# GET LAST TX ISSUER
|
||||
ISSUER=$(cat /tmp/g1_TX.scan.txt | jq -r '.history.received[].issuers[0]' | head -n $line | tail -n 1)
|
||||
[[ $ISSUER == $NODE_G1PUBKEY ]] && ((line++)) && continue ## TX/OUT CONTINUE
|
||||
echo $ISSUER > ~/.zen/g1_TX_inputs/zen.$TXhash
|
||||
echo $ISSUER > ~/.zen/cache/g1_TX_inputs/zen.$TXhash
|
||||
# GET OUTPUTS AND MAKE ZEN=G1*100 SUM
|
||||
ZEN=$(cat /tmp/g1_TX.scan.txt | jq -r '.history.received[].outputs[]' | grep $NODE_G1PUBKEY | head -n $line | tail -n 1 | cut -d ':' -f 1)
|
||||
# GET COMMENT
|
||||
|
@ -145,11 +145,11 @@ else
|
|||
while [[ $line -le $TXnb ]]; do
|
||||
TXhash=$(cat /tmp/g1_TX.scan.txt | jq -r '.history.pending[].hash' | head -n $line | tail -n 1)
|
||||
# IT IS A NEW TX/IN?
|
||||
if [[ ! -f ~/.zen/g1_TX_inputs/zen.$TXhash ]]; then
|
||||
if [[ ! -f ~/.zen/cache/g1_TX_inputs/zen.$TXhash ]]; then
|
||||
# GET LAST RX ISSUER
|
||||
ISSUER=$(cat /tmp/g1_TX.scan.txt | jq -r '.history.pending[].issuers[0]' | head -n $line | tail -n 1)
|
||||
[[ $ISSUER == $NODE_G1PUBKEY ]] && ((line++)) && continue ## TX/OUT CONTINUE
|
||||
echo $ISSUER > ~/.zen/g1_TX_inputs/zen.$TXhash
|
||||
echo $ISSUER > ~/.zen/cache/g1_TX_inputs/zen.$TXhash
|
||||
# GET OUTPUTS AND MAKE ZEN SUM
|
||||
ZEN=$(cat /tmp/g1_TX.scan.txt | jq -r '.history.pending[].outputs[]' | grep $NODE_G1PUBKEY | head -n $line | tail -n 1 | cut -d ':' -f 1)
|
||||
# GET COMMENT
|
||||
|
|
|
@ -69,7 +69,7 @@ $ssbpub
|
|||
|
||||
-- sbot publish --
|
||||
"
|
||||
sbot publish --type about --about $ssbpub --description "Welcome to [Astroport](https://astroport.com) G1SSB/IPFS Station [$ipfsnodeid](http://localhost:8080/ipns/$ipfsnodeid)" --name "$USER@$(cat /etc/hostname)" --image "$id"
|
||||
sbot publish --type about --about $ssbpub --description "[Astroport](https://astroport.com) Station [$ipfsnodeid](http://localhost:8080/ipns/$ipfsnodeid) - G1 Wallet $g1pub" --name "$USER@$(cat /etc/hostname)" --image "$id"
|
||||
|
||||
echo "
|
||||
_ _
|
||||
|
|
|
@ -46,6 +46,8 @@ https://tube.p2p.legal/videos/watch/ef319fdd-caf1-4e03-ba22-91c456e94f73
|
|||
"timestamp": 1585068290213
|
||||
}
|
||||
'
|
||||
# CACHE
|
||||
[[ ! -d ~/.zen/cache/ssb_contact ]] && mkdir -p ~/.zen/cache/ssb_contact
|
||||
|
||||
self=$(sbotc whoami | jq -r .id) || exit 1
|
||||
g1self=$(echo $self | cut -d '@' -f 2 | cut -d '.' -f 1 | base64 -d | base58)
|
||||
|
@ -56,37 +58,51 @@ while read -r msg
|
|||
do
|
||||
|
||||
autofollow=$(printf %s "$msg" | jq .value.content.autofollow)
|
||||
[[ ! $autofollow ]] && echo "I am NOT the Pub" && printf %s "$msg" | jq && continue
|
||||
|
||||
[[ ! $autofollow ]] && echo "I am NOT the PUB" && continue
|
||||
timestamp=$(printf %s "$msg" | jq .value.timestamp)
|
||||
|
||||
echo "
|
||||
___ _______ _ _ ___ ____
|
||||
| |\ |\ /| ||_ / / \|\ || /\ / |
|
||||
_|_| \| \/_|_ ||_ \_\_/| \||/--\\_ | RECEIVED
|
||||
|
||||
|
||||
$timestamp
|
||||
"
|
||||
author=$(printf %s "$msg" | jq -r .value.author)
|
||||
[[ "$author" == "$self" ]] && echo "Message from myself" && continue
|
||||
g1author=$(printf %s "$msg" | jq -r .value.author | cut -d '@' -f 2 | cut -d '.' -f 1 | base64 -d | base58)
|
||||
|
||||
# Crypt, ipfs store, send
|
||||
if [[ -f ~/.ipfs/swarm.key ]]; then
|
||||
|
||||
ipfsnodeid=$(ipfs id -f='<id>\n')
|
||||
mkdir -p ~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}
|
||||
mkdir -p ~/.zen/ipfs/.${ipfsnodeid}/CONTACT/${g1author}
|
||||
|
||||
file=~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}/ipfs_swarm.key.crypt
|
||||
# PUBLISH swarm.key.crypt to IPFS, so PUB can push new swam.key to our CONTACT
|
||||
file=~/.zen/ipfs/.${ipfsnodeid}/CONTACT/${g1author}/ipfs_swarm.key.crypt
|
||||
|
||||
$MY_PATH/tools/natools.py encrypt -p ${g1author} -i ~/.ipfs/swarm.key -o ${file}
|
||||
cp ${file} ~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}/
|
||||
|
||||
# IPFS Node PUBLISH Adresses so Pub can become bootstrap for ${g1author}
|
||||
ipfs id | jq -r .Addresses[] > ~/.zen/ipfs/.${ipfsnodeid}/Addresses
|
||||
# IPFS Node PUBLISH AgentVersion & repo.stat
|
||||
ipfs id | jq -r .AgentVersion > ~/.zen/ipfs/.${ipfsnodeid}/AgentVersion
|
||||
ipfs repo stat > ~/.zen/ipfs/.${ipfsnodeid}/repo.stat
|
||||
|
||||
boostrap=$(cat ~/.zen/ipfs/.${ipfsnodeid}/Addresses | tail -n 1)
|
||||
|
||||
echo "
|
||||
$author
|
||||
|
||||
\|/ \|/ \|/
|
||||
/|\ /|\ /|\ cyphering swarmkey
|
||||
|
||||
IPFS
|
||||
~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}/ipfs_swarm.key.crypt
|
||||
~/.zen/ipfs/.${ipfsnodeid}/CONTACT/${g1author}/ipfs_swarm.key.crypt
|
||||
|
||||
PUBLISH IPFS
|
||||
http://localhost:8080/ipns/
|
||||
"
|
||||
ipfs name publish --quieter /ipfs/$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
|
||||
|
||||
name=${file##*/}
|
||||
id="$(sbotc blobs.add < "$file")"
|
||||
|
@ -109,7 +125,6 @@ FROM.G1_${g1self}
|
|||
FROM.IPFS_${ipfsnodeid}
|
||||
|
||||
"
|
||||
|
||||
sbotc publish '{"type":"post","text":"#astroport-swarmkey = ['"$name"']('"$id"') TO.SSB_${author} TO.G1_${g1author} +++ FROM.SSB_${self_name} FROM.G1_${g1self} FROM.IPFS_${ipfsnodeid}","mentions":[{"link":"'"$id"'","name":"'"$name"'","size":'"$size"',"type":"'"$type"'"}]}'
|
||||
|
||||
fi
|
||||
|
|
|
@ -14,13 +14,13 @@ echo '
|
|||
############# '$MY_PATH/$ME'
|
||||
########################################################################
|
||||
# ex: ./'$ME'
|
||||
# SURVEY received #astroport-swarmkey and inject it to IPFS
|
||||
# SURVEY received #astroport-swarmkey and copy it to IPFS
|
||||
######################################################################## _ _ _ _ _
|
||||
___ _ _ __
|
||||
| |_)|_(_ _ _.._._ _ | _
|
||||
_|_| | __) _>\/\/(_|| | | ||<(/_\/
|
||||
/
|
||||
|
||||
USED ONLY ONCE... Next swarm.key change will use ipfs.
|
||||
'
|
||||
|
||||
self=$(sbotc whoami | jq -r .id) || exit 1
|
||||
|
@ -30,7 +30,7 @@ self_name=$(sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$self"
|
|||
ipfsnodeid=$(ipfs id -f='<id>\n')
|
||||
[[ ! $ipfsnodeid ]] && echo "ERROR ipfs id" && exit 1
|
||||
|
||||
messages=$(sbotc backlinks.read '{"query":[{"$filter":{"dest":"#test","value":{"content":{"type":"post"}}}}]}')
|
||||
messages=$(sbotc backlinks.read '{"query":[{"$filter":{"dest":"#astroport-swarmkey","value":{"content":{"type":"post"}}}}]}')
|
||||
while read -r msg
|
||||
do
|
||||
|
||||
|
|
|
@ -243,6 +243,9 @@ echo "${J}" > ~/.zen/tag/${AAH}/_ipns
|
|||
# INDEXING ZenTag to SWARM
|
||||
mkdir -p ~/.zen/ipfs/.$ipfsnodeid/TAG/${J}
|
||||
echo "${AA}" > ~/.zen/ipfs/.$ipfsnodeid/TAG/${J}/_tag.uid
|
||||
# TODO add METADATA
|
||||
# echo "" > ~/.zen/ipfs/.$ipfsnodeid/TAG/${J}/_tag.metadata.json
|
||||
|
||||
IWALLETS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
|
||||
NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS)
|
||||
|
||||
|
|
Loading…
Reference in New Issue