getActiveValidators
curl --request POST \
--url https://api.example.com/eth_callimport requests
url = "https://api.example.com/eth_call"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/eth_call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/eth_call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/eth_call"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/eth_call")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/eth_call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"result": "<string>"
}eth_* Methods
getActiveValidators
Get list of currently active validators
POST
eth_call
getActiveValidators
curl --request POST \
--url https://api.example.com/eth_callimport requests
url = "https://api.example.com/eth_call"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/eth_call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/eth_call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/eth_call"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/eth_call")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/eth_call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"result": "<string>"
}Overview
Queries the FenineSystem contract to get the list of currently active validators. These are validators withVALIDATED status who are participating in the network and earning rewards.
Contract Call Details
address
required
0x0000000000000000000000000000000000001000 (FenineSystem)bytes
required
Function selector:
0x9de70258 (no parameters)Response
bytes
ABI-encoded array of validator addresses. Decode as
address[].Examples
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x0000000000000000000000000000000000001000",
"data": "0x9de70258"
}, "latest"],
"id": 1
}'
const Web3 = require('web3');
const web3 = new Web3('https://rpc.fene.app');
// Method 1: Using eth_call directly
const result = await web3.eth.call({
to: '0x0000000000000000000000000000000000001000',
data: '0x9de70258'
}, 'latest');
const validators = web3.eth.abi.decodeParameter('address[]', result);
console.log('Active validators:', validators);
console.log('Total count:', validators.length);
// Method 2: Using contract instance (better)
const abi = JSON.parse(await web3.getSystemContractABI());
const contract = new web3.eth.Contract(
abi,
'0x0000000000000000000000000000000000001000'
);
const validators = await contract.methods.getActiveValidators().call();
console.log('Active validators:', validators);
const { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://rpc.fene.app');
// Get ABI and create contract
const abiJson = await provider.send('fenine_getSystemContractABI', []);
const abi = JSON.parse(abiJson);
const contract = new ethers.Contract(
'0x0000000000000000000000000000000000001000',
abi,
provider
);
const validators = await contract.getActiveValidators();
console.log('Active validators:', validators);
console.log('Total count:', validators.length);
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://rpc.fene.app'))
# Call contract
result = w3.eth.call({
'to': '0x0000000000000000000000000000000000001000',
'data': '0x9de70258'
}, 'latest')
# Decode result
validators = w3.codec.decode(['address[]'], result)[0]
print(f'Active validators: {validators}')
print(f'Total count: {len(validators)}')
Response Format
The raw response is ABI-encoded. After decoding:[
"0x1111111111111111111111111111111111111111",
"0x2222222222222222222222222222222222222222",
"0x3333333333333333333333333333333333333333"
]
Use Cases
Monitor Network Health
Monitor Network Health
const constants = await web3.getContractConstants();
const validators = await contract.methods.getActiveValidators().call();
console.log(`Active: ${validators.length} / ${constants.maxValidators}`);
if (validators.length < 3) {
console.warn('⚠️ Low validator count - network at risk');
}
Build Validator Directory
Build Validator Directory
const validators = await contract.methods.getActiveValidators().call();
// Get info for each
const directory = await Promise.all(
validators.map(async (address) => {
const info = await contract.methods.getValidatorInfo(address).call();
return {
address,
selfStake: web3.utils.fromWei(info.selfStake, 'ether'),
totalStake: web3.utils.fromWei(info.totalStake, 'ether'),
commission: info.commissionRate / 100 + '%',
delegators: info.stakerCount
};
})
);
console.table(directory);
Check if Address is Validator
Check if Address is Validator
const myAddress = '0x1234...';
const validators = await contract.methods.getActiveValidators().call();
const isValidator = validators.some(
v => v.toLowerCase() === myAddress.toLowerCase()
);
console.log('Is active validator:', isValidator);
Pagination
This method returns ALL active validators in one call. With a max of 101 validators, this is manageable. No pagination needed.
Related Methods
getValidatorInfo
Get details for specific validator
totalNetworkStake
Get total staked amount
getCurrentEpoch
Get current epoch number
⌘I