Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add subnet-evm v0.6.12 changes #1945

Merged
merged 3 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/docs/api-reference/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"keystore-api",
"metrics-api",
"avalanche-go-configs-flags",
"---Avalanche Subnets---",
"---Avalanche L1s---",
"subnet-evm-api",
"---Miscellaneous---",
"standards",
Expand Down
62 changes: 62 additions & 0 deletions content/docs/api-reference/subnet-evm-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,65 @@ curl -X POST --data '{
}
}
```

## `validators_getCurrentValidators`

This API retrieves the list of current validators for the Subnet/L1. It provides detailed information about each validator, including their ID, status, weight, connection, and uptime.

URL: `http://<server-uri>/ext/bc/<blockchainID>/validators`

**Signature:**

```bash
validators_getCurrentValidators([nodeIDs]) -> {validators: []Validator}
```

**Example Call:**

```bash
{
"jsonrpc": "2.0",
"method": "validators.getCurrentValidators",
"params": {
"nodeIDs": []
},
"id": 1
}
```

- `nodeIDs` is an optional parameter that specifies the node IDs of the validators to retrieve. If omitted, all validators are returned.

**Example Response:**

```json
{
"jsonrpc": "2.0",
"result": {
"validators": [
{
"validationID": "nESqWkcNXihfdZESS2idWbFETMzatmkoTCktjxG1qryaQXfS6",
"nodeID": "NodeID-P7oB2McjBGgW2NXXWVYjV8JEDFoW9xDE5",
"weight": 20,
"startTimestamp": 1732025492,
"isActive": true,
"isL1Validator": false,
"isConnected": true,
"uptimeSeconds": 36
"uptimePercentage": 100,
}
]
},
"id": 1
}
```

- validationID: (string) Unique identifier for the validation. This returns validation ID for L1s, AddSubnetValidator txID for Subnets.
- nodeID: (string) Node identifier for the validator.
- weight: (integer) The weight of the validator, often representing stake.
- startTimestamp: (integer) UNIX timestamp for when validation started.
- isActive: (boolean) Indicates if the validator is active. This returns true if this is L1 validator and has enough continuous subnet staking fees in P-Chain.
It always return true for subnet validators.
- isL1Validator: (boolean) Indicates if the validator is a L1 validator or a subnet validator.
- isConnected: (boolean) Indicates if the validator node is currently connected to the callee node.
- uptimeSeconds: (integer) The number of seconds the validator has been online.
- uptimePercentage: (float) The percentage of time the validator has been online.
Loading
Loading