Staking (Testnet)

Review All Full & Pool SNs

Navigate to your testnet folder and run these commands.

Windows (Powershell)

$result = Invoke-RestMethod -Uri http://127.0.0.1:18091/json_rpc -Method Post -ContentType "application/json" -Body '{"jsonrpc":"2.0","id":"0","method":"get_service_nodes","params":{}}'; $allNodes = $result.result.service_node_states; $fullNodes = $allNodes | Where-Object { $_.total_contributed -ge $_.staking_requirement }; $poolNodes = $allNodes | Where-Object { $_.total_contributed -lt $_.staking_requirement }; Write-Host "`n========================================" -ForegroundColor Yellow; Write-Host "ALL SERVICE NODES" -ForegroundColor Green; Write-Host "========================================" -ForegroundColor Yellow; Write-Host "Total Nodes: $($allNodes.Count)" -ForegroundColor Cyan; Write-Host "Full Nodes: $($fullNodes.Count)" -ForegroundColor Green; Write-Host "Pool Nodes (Open): $($poolNodes.Count)" -ForegroundColor Magenta; Write-Host "========================================`n" -ForegroundColor Yellow; Write-Host "--- FULL NODES (Fully Funded) ---" -ForegroundColor Green; $fullNodes | ForEach-Object { $opFee = if ($_.operator_fee) { [math]::Round($_.operator_fee / 10000, 2) } else { 0 }; $lastUptime = if ($_.last_uptime_proof -gt 0) { [DateTimeOffset]::FromUnixTimeSeconds($_.last_uptime_proof).DateTime.ToString("MM/dd HH:mm") } else { "Never" }; $status = if ($_.active) { "Active" } elseif ($_.funded) { "Decomm" } else { "Await" }; [PSCustomObject]@{ Pubkey = $_.service_node_pubkey.Substring(0,16) + "..."; Status = $status; OpFee = "$opFee%"; Staked = [math]::Round($_.total_contributed / 1e9, 0); Required = [math]::Round($_.staking_requirement / 1e9, 0); Contributors = $_.contributors.Count; LastProof = $lastUptime } } | Format-Table -AutoSize; Write-Host "`n--- POOL NODES (Awaiting Contributions) ---" -ForegroundColor Magenta; $poolNodes | ForEach-Object { $opFee = if ($_.operator_fee) { [math]::Round($_.operator_fee / 10000, 2) } else { 0 }; $lastUptime = if ($_.last_uptime_proof -gt 0) { [DateTimeOffset]::FromUnixTimeSeconds($_.last_uptime_proof).DateTime.ToString("MM/dd HH:mm") } else { "Never" }; $remaining = [math]::Round(($_.staking_requirement - $_.total_contributed) / 1e9, 0); $pctFull = [math]::Round(($_.total_contributed / $_.staking_requirement) * 100, 1); [PSCustomObject]@{ Pubkey = $_.service_node_pubkey.Substring(0,16) + "..."; OpFee = "$opFee%"; Staked = [math]::Round($_.total_contributed / 1e9, 0); Required = [math]::Round($_.staking_requirement / 1e9, 0); Remaining = $remaining; PctFull = "$pctFull%"; Contributors = $_.contributors.Count; LastProof = $lastUptime } } | Format-Table -AutoSize; Write-Host "========================================`n" -ForegroundColor Yellow

Linux

curl -s http://127.0.0.1:18091/json_rpc -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":"0","method":"get_service_nodes","params":{}}' | jq -r '
  .result.service_node_states as $all |
  ($all | map(select(.total_contributed >= .staking_requirement))) as $full |
  ($all | map(select(.total_contributed < .staking_requirement))) as $pool |
  "========================================",
  "ALL SERVICE NODES",
  "========================================",
  "Total Nodes: \($all | length)",
  "Full Nodes: \($full | length)",
  "Pool Nodes (Open): \($pool | length)",
  "========================================",
  "",
  "--- FULL NODES (Fully Funded) ---",
  (["PUBKEY", "STATUS", "OP_FEE", "STAKED", "REQUIRED", "CONTRIB", "LAST_PROOF"] | @tsv),
  ($full[] | [
    .service_node_pubkey[0:16] + "...",
    (if .active then "Active" elif .funded then "Decomm" else "Await" end),
    "\((.operator_fee // 0) / 10000 | floor)%",
    ((.total_contributed // 0) / 1e9 | floor),
    ((.staking_requirement // 0) / 1e9 | floor),
    (.contributors | length),
    (if .last_uptime_proof > 0 then (.last_uptime_proof | strftime("%m/%d %H:%M")) else "Never" end)
  ] | @tsv),
  "",
  "--- POOL NODES (Awaiting Contributions) ---",
  (["PUBKEY", "OP_FEE", "STAKED", "REQUIRED", "REMAINING", "PCT_FULL", "CONTRIB", "LAST_PROOF"] | @tsv),
  ($pool[] | [
    .service_node_pubkey[0:16] + "...",
    "\((.operator_fee // 0) / 10000 | floor)%",
    ((.total_contributed // 0) / 1e9 | floor),
    ((.staking_requirement // 0) / 1e9 | floor),
    (((.staking_requirement // 0) - (.total_contributed // 0)) / 1e9 | floor),
    "\(((.total_contributed // 0) / (.staking_requirement // 1) * 100) | floor)%",
    (.contributors | length),
    (if .last_uptime_proof > 0 then (.last_uptime_proof | strftime("%m/%d %H:%M")) else "Never" end)
  ] | @tsv),
  "========================================"
' | column -t -s $'\t'

Find Pool Nodes to Stake - Via RPC (to get JSON data):

Windows (PowerShell):

Linux (Bash):

Stake on a Pool Node

Once you have a Service Node's public key (from the list above), use the wallet CLI:

Wallet CLI Command:stake <service_node_pubkey> <amount>

Example:

This stakes 10,000 XEQ on that service node.

Alternative: Stake by Percentage

This stakes 50% of the remaining amount needed.

Last updated