Skip to content

Get Network Id

Returns the CHAIN_ID of the specified network. This is represented as a String.

See table below for the CHAIN_ID for different chains:

Chain(s) CHAIN_ID
Zilliqa mainnet 1
Developer testnet 333
Isolated server 222

NOTE: CHAIN_ID from 2 to 9 are reserved for Zilliqa Core use.

Example Request

curl -d '{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "GetNetworkId",
    "params": [""]
}' -H "Content-Type: application/json" -X POST ""
const NetworkId = await;
public class App {
    public static void main(String[] args) throws IOException {
        HttpProvider client = new HttpProvider("");
        Rep<String> networkId = client.getNetworkId();
        System.out.println(new Gson().toJson(networkId));
from pyzil.zilliqa import chain
from pyzil.zilliqa.api import ZilliqaAPI

network_id = chain.active_chain.api.GetNetworkId()

# OR
new_api = ZilliqaAPI(endpoint="")
network_id = new_api.GetNetworkId()
func GetNetworkId() {
    provider := NewProvider("")
    response := provider.GetNetworkId()
    result, _ := json.Marshal(response)

Example Response

  "id": "1",
  "jsonrpc": "2.0",
  "result": "1"

HTTP Request

Chain(s) URL(s)
Zilliqa mainnet
Developer testnet
Local testnet http://localhost:4201/
Isolated server


Parameter Type Required Description
id string Required "1"
jsonrpc string Required "2.0"
method string Required "GetNetworkId"
params string Required Empty string ""