getNetwork
General information about the currently configured network. This response will contain all the information needed to successfully submit transactions to the network this node serves.
Params
(0)Result
(getNetworkResult)passphrase
stringNetwork passphrase configured for this Stellar RPC node.
protocolVersion
numberStellar Core protocol version associated with the latest ledger.
friendbotUrl
string(optional) The URL of this network's "friendbot" faucet
Examples
Example request to the getNetwork
method for a node connected to the Stellar Testnet network.
Request
- cURL
- JavaScript
- Python
- JSON
curl -X POST \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 8675309,
"method": "getNetwork"
}' \
https://soroban-testnet.stellar.org | jq
let requestBody = {
"jsonrpc": "2.0",
"id": 8675309,
"method": "getNetwork"
}
let res = await fetch('https://soroban-testnet.stellar.org', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(requestBody),
})
let json = await res.json()
console.log(json)
import json, requests
res = requests.post('https://soroban-testnet.stellar.org', json={
"jsonrpc": "2.0",
"id": 8675309,
"method": "getNetwork"
})
print(json.dumps(res.json(), indent=4))
{
"jsonrpc": "2.0",
"id": 8675309,
"method": "getNetwork"
}
Result
{
"jsonrpc": "2.0",
"id": 8675309,
"result": {
"friendbotUrl": "https://friendbot-testnet.stellar.org/",
"passphrase": "Test SDF Network ; September 2015",
"protocolVersion": 20
}
}