Skip to content

Commit

Permalink
chore: 🤖 node stake amount
Browse files Browse the repository at this point in the history
  • Loading branch information
heldrida committed Oct 17, 2023
1 parent f460f4a commit 5d9e99d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/node_details
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,21 @@ nodePubKey=$(echo "$keys" | sed -n '1p' | cut -d : -f 2 | xargs)
consensusPubKey=$(echo "$keys" | sed -n '1p' | cut -d : -f 2 | xargs)
ipAddr=$(curl -sw '\n' ifconfig.me || curl -sw '\n' ident.me)
# TODO: Show if stake
# hasStake=$(curl -X POST \
# "$defaultRPCUrl" \
# -H 'Content-Type: application/json' \
# -d "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"flk_get_node_info\",\"params\":[\"$nodePubKey\"]}")
hasStake=$(curl -X POST \
"$defaultRPCUrl" \
-H 'Content-Type: application/json' \
-d "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"flk_get_node_info\",\"params\":[\"$nodePubKey\"]}" | grep -Eo '"staked"[^,]*' | grep -Eo '[^:]*$' | cut -d "\"" -f 2)

echo "🤖 Your server details are the following"
echo
echo "The Node Public Key is $nodePubKey"
echo "The Consensus Public Key is $consensusPubKey"
echo "The Node Server IP address is $ipAddr"

if $hasStake; then
echo "The Node staked amount is $hasStake"
fi

echo
echo "Learn more by checking our guides at https://docs.fleek.network"
echo "✨ That's all!"

0 comments on commit 5d9e99d

Please sign in to comment.