aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-03-24 20:01:25 +0200
committerkaotisk <kaotisk@arching-kaos.org>2025-03-24 20:01:25 +0200
commit50502ec2b41733ba5f152cbde457f6cb66e588c6 (patch)
tree65910e044516acfac1be3546affef3347fe0984c
parent28651943c355c510883cd3d022c7b0130fcfe56f (diff)
downloadarching-kaos-tools-50502ec2b41733ba5f152cbde457f6cb66e588c6.tar.gz
arching-kaos-tools-50502ec2b41733ba5f152cbde457f6cb66e588c6.tar.bz2
arching-kaos-tools-50502ec2b41733ba5f152cbde457f6cb66e588c6.zip
[stellar] Updated dirs where info is storedHEADorigin/masterorigin/HEADmaster
- Added more debug info for _ak_ipfs error messages - If configuration is unreachable for node_info, don't output it - Fixes broken peering showcase
-rwxr-xr-xlib/_ak_ipfs6
-rwxr-xr-xlib/_ak_network2
-rwxr-xr-xlib/_ak_network_stellar43
3 files changed, 24 insertions, 27 deletions
diff --git a/lib/_ak_ipfs b/lib/_ak_ipfs
index eb4ee31..d904645 100755
--- a/lib/_ak_ipfs
+++ b/lib/_ak_ipfs
@@ -116,7 +116,7 @@ function _ak_ipfs_scanner(){
function _ak_ipfs_add(){
if [ -z $1 ] || [ ! -n "$1" ]
then
- _ak_log_error "no argument given"
+ _ak_log_error "_ak_ipfs_add: no argument given"
exit 1
fi
# Receives a file
@@ -132,7 +132,7 @@ function _ak_ipfs_add(){
function _ak_ipfs_block_stat(){
if [ -z $1 ] || [ ! -n "$1" ]
then
- _ak_log_error "no argument given"
+ _ak_log_error "_ak_ipfs_block_stat: no argument given"
exit 1
fi
_ak_ipfs block stat "$1"
@@ -256,7 +256,7 @@ function _ak_ipfs_get(){
function _ak_ipfs_cat(){
if [ -z $1 ] || [ ! -n "$1" ]
then
- _ak_log_error "no argument given"
+ _ak_log_error "_ak_ipfs_cat: no argument given"
exit 1
fi
if [ ! -f $AK_IPFS_ARTIFACTS/$1 ]
diff --git a/lib/_ak_network b/lib/_ak_network
index 0c0fc6f..a7ef4fc 100755
--- a/lib/_ak_network
+++ b/lib/_ak_network
@@ -55,7 +55,7 @@ function _ak_network_show_peers(){
* ) _ak_log_error "Unknown network $1";exit 1;;
esac
else
- (_ak_network_stellar_show_peers; _ak_network_cjdns_show_peers; _ak_network_yggdrasil_show_peers; _ak_network_ipfs_show_peers) | \
+ (_ak_network_stellar_show_peers; _ak_network_cjdns_show_peers; _ak_network_yggdrasil_show_peers; _ak_network_incoming_show_peers) | \
jq -j | \
sed -e 's/]\[/,/g' | \
jq
diff --git a/lib/_ak_network_stellar b/lib/_ak_network_stellar
index 04ce29b..5d739ec 100755
--- a/lib/_ak_network_stellar
+++ b/lib/_ak_network_stellar
@@ -19,6 +19,15 @@
###
source $AK_LIBDIR/_ak_log
source $AK_LIBDIR/_ak_ipfs
+source $AK_LIBDIR/_ak_script
+
+stellarPeersDir="$AK_ZPEERSDIR/stellar"
+_ak_check_and_create_dir $stellarPeersDir
+
+stellarParticipants="$stellarPeersDir/trustlines"
+_ak_let_there_be_file $stellarParticipants
+stellarParticipantsOnline="$stellarPeersDir/configured.trustlines"
+_ak_let_there_be_file $stellarParticipantsOnline
function _ak_network_stellar_show_ids(){
i=0
@@ -73,24 +82,8 @@ function _ak_network_stellar_scan(){
tempdir=`_ak_make_temp_directory`
tempfile="$tempdir/tmp"
tempaddr="$tempdir/tmpaddr"
- stellarParticipants="$AK_WORKDIR/stellar-network-participants"
- stellarParticipantsOnline="$AK_WORKDIR/stellar-network-participants-online"
- if [ ! -f "$stellarParticipants" ]
- then
- touch $stellarParticipants
- fi
- if [ ! -f "$stellarParticipantsOnline" ]
- then
- touch $stellarParticipantsOnline
- fi
- if [ ! -f "$tempdir" ]
- then
- touch $tempdir
- fi
- if [ ! -f "$tempaddr" ]
- then
- touch $tempaddr
- fi
+ _ak_let_there_be_file $tempdir
+ _ak_let_there_be_file $tempaddr
if [ ! -z $1 ] && [ "$1" == "-l" ] && [ ! -z $2 ]
then
limit=$2
@@ -135,8 +128,6 @@ function _ak_network_stellar_scan(){
}
function _ak_network_stellar_show_peers(){
- stellarParticipants="$AK_WORKDIR/stellar-network-participants"
- stellarParticipantsOnline="$AK_WORKDIR/stellar-network-participants-online"
if [ -f "${stellarParticipantsOnline}" ]
then
(
@@ -150,10 +141,16 @@ function _ak_network_stellar_show_peers(){
fi
counter=$(( $counter + 1 ))
akConfigHash="$(_ak_ipfs_name_resolve /ipns/$akConfig|cut -d '/' -f 3)"
- printf '{"stellar":{"address":"%s","config":"%s"},"node_info":%s}' \
+ printf '{"stellar":{"address":"%s","config":"%s"}' \
"$stellarAddress" \
- "$akConfig" \
- "$(_ak_ipfs_cat $akConfigHash)"
+ "$akConfig"
+ if [ -n "$akConfigHash" ]
+ then
+ printf ',"node_info":%s}' \
+ "$(_ak_ipfs_cat $akConfigHash)"
+ else
+ printf '}'
+ fi
done
printf ']'
) | sed -e 's/\[]//g' #| jq