Get All Relays
Allows you to retrieve a list of relays along with their location, round-trip time (RTT), and an object representing last pool update with registered relays.
Parameter
Attribute | Description |
---|---|
bech32PoolAddress | The Cardano Pool Address, starts with pool... |
Example
import { anvil } from "@ada-anvil/sdk-client";
try {
await anvil.spo.getAllRelays({ bech32PoolAddress });
} catch {
console.log("Authentication failed");
}
Curl
ENDPOINT="https://prod.api.ada-anvil.app"
BECH32_POOL_ADDRESS="pool1n3sjq3qvu5vvcd6aud6ndcwq7r3ghmkafcg60gznlwfrk2ucxku"
API_KEY="XXXXXXX"
curl "${ENDPOINT}/spo/getAllRelays?input=%7B%22bech32PoolAddress%22%3A%22${BECH32_POOL_ADDRESS}%22%7D" \
--header "x-api-key: ${API_KEY}"
Return informations
- It returns relays by Update Id
- It returns the RTT (from the API endpoint)
- It returns the physical location
- It returns relays defined in the latest update
{
"result": {
"data": {
"relays": {
"31778": [
{
"dnsName": "pool-ca.ada-anvil.app",
"dnsSrvName": null,
"ipv4": null,
"ipv6": null,
"port": 6000,
"updateId": 31778
},
{
/* ... */
}
]
},
"rtt": [
{
"ip": "pool-ca.ada-anvil.app",
"port": 6000,
"rtt": "23"
},
{
/* ... */
}
],
"location": [
{
"range": [2925385728, 2925386751],
"country": "CA",
"region": "QC",
"eu": "0",
"timezone": "America/Toronto",
"city": "Gatineau",
"ll": [45.5856, -75.4208],
"metro": 0,
"area": 5
},
{
/* ... */
}
],
"lastEntry": [
{
"dnsName": "pool-ca.ada-anvil.app",
"dnsSrvName": null,
"ipv4": null,
"ipv6": null,
"port": 6000,
"updateId": 31778
},
{
/* ... */
}
]
}
}
}