Skip to content
Snippets Groups Projects
Commit b6eed83c authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

now showing peers in enode format

parent d1dced04
No related branches found
No related tags found
No related merge requests found
...@@ -35,12 +35,11 @@ bfaconfig node ...@@ -35,12 +35,11 @@ bfaconfig node
json_query admin_peers json_query admin_peers
numpeers=$( json_result | json_arraylength ) numpeers=$( json_result | json_arraylength )
statusfile=$( mktemp ) statusfile=$( mktemp )
cleanup "$statusfile" cleanup "${statusfile}"
( chmod 644 "${statusfile}"
echo -n "time: " echo -n "time: " > ${statusfile}
date date >> ${statusfile}
echo "total-peer-count: ${numpeers}" echo "total-peer-count: ${numpeers}" >> ${statusfile}
) > $statusfile
peercount=0 peercount=0
for idx in $( seq 0 $(( $numpeers - 1 )) ) for idx in $( seq 0 $(( $numpeers - 1 )) )
do do
...@@ -71,6 +70,7 @@ do ...@@ -71,6 +70,7 @@ do
echo "$remoteaddress" | echo "$remoteaddress" |
sed 's/^.*://' sed 's/^.*://'
) )
echo "peer: enode://${remoteid}@[${remoteip}]:${remoteport}" >> $statusfile
mkdir -p "${BFANETWORKDIR}/lastseen/${remoteid}" mkdir -p "${BFANETWORKDIR}/lastseen/${remoteid}"
if [ -r "${BFANETWORKDIR}/lastseen/${remoteid}/${remoteip}" ] if [ -r "${BFANETWORKDIR}/lastseen/${remoteid}/${remoteip}" ]
then then
...@@ -84,7 +84,6 @@ do ...@@ -84,7 +84,6 @@ do
else else
touch "${BFANETWORKDIR}/lastseen/${remoteid}/${remoteip}" touch "${BFANETWORKDIR}/lastseen/${remoteid}/${remoteip}"
fi fi
echo "peer: ${remoteid}" >> $statusfile
peercount=$(( $peercount + 1 )) peercount=$(( $peercount + 1 ))
done done
echo "valid-peer-count: ${peercount}" >> $statusfile echo "valid-peer-count: ${peercount}" >> $statusfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment