forked from axiom-team/astroport
G1SSB id ipfs ID swarm matching
This commit is contained in:
parent
1fd7fa2b3c
commit
a5f4de87bc
|
@ -19,10 +19,12 @@ scuttlebutt() {
|
|||
cd ~/.ssb_astroport
|
||||
|
||||
### 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
|
||||
# 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:
|
||||
npm -g install fraction/oasis#semver:
|
||||
npm -g install ssb-cli@latest
|
||||
|
||||
# Move node_modules with ssb-server (why do I have to do that? crazy heavy crappy wonderful node.js )
|
||||
ssbSERVER=$(which ssb-server)
|
||||
|
|
|
@ -31,7 +31,7 @@ echo $timebar
|
|||
##################################################################
|
||||
|
||||
##################################################################
|
||||
# MONITOR INPUT TX
|
||||
# MONITOR INPUT TX (TODO: DEBUG)
|
||||
[[ $(($minute % 5)) == 0 ]] && $MY_PATH/g1_MONITOR_zen.sh "5 minutes"
|
||||
##################################################################
|
||||
|
||||
|
|
|
@ -35,6 +35,16 @@ _|_| | __) __)\/\//--\| \| | | \|_| | \|___)| |
|
|||
|
||||
'
|
||||
|
||||
# GET /tmp/ssb-friends.json to choose SWARM peers
|
||||
self=$(sbotc whoami | jq -r .id)
|
||||
sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$self"'", "content":{"type":"contact"}}}}]}' | jq -r '.value?.content?.contact' > /tmp/ssb-friends.json || rm -f /tmp/ssb-friends.json
|
||||
|
||||
for SSBFRIEND in $(cat /tmp/ssb-friends.json); do
|
||||
#echo "Searching $SSBFRIEND"
|
||||
INSWARM=$(grep -Rwl "$SSBFRIEND" ~/.zen/ipfs_swarm/.Qm*/G1SSB/_ssb.whoami | tail -n 1 | cut -f 4 -d '/')
|
||||
[[ $INSWARM ]] && echo $INSWARM && TRYME=$(~/.zen/ipfs_swarm/$INSWARM/tryme.addr) && echo $TRYME
|
||||
done
|
||||
|
||||
# GET IPNS published wallets from ALL SWARM NODES ## TODO: IF NODES are MISSING, check ./wallets_swarm/.QmNODES...
|
||||
ipfs get --output=$HOME/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
|
||||
count=1
|
||||
|
|
|
@ -97,6 +97,14 @@ _|_| | __) (_|(_|(_|
|
|||
echo "$ssbpub" > ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_ssb.whoami
|
||||
echo "$g1pub" > ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.pubkey
|
||||
|
||||
# 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
|
||||
|
||||
ipfs id | jq -r .Addresses[] | tail -n 1 > ~/.zen/ipfs/.${ipfsnodeid}/tryme.addr
|
||||
|
||||
IWALLETS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
|
||||
NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS)
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ echo $timestamp
|
|||
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)
|
||||
bootstrap=$(cat ~/.zen/ipfs/.${ipfsnodeid}/Addresses | tail -n 1)
|
||||
|
||||
echo "
|
||||
$author
|
||||
|
|
Loading…
Reference in New Issue