curl -sS 'https://starknet.api.onfinality.io/public' \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"starknet_chainId","params":[]}'
Mainnet returns 0x534e5f4d41494e, which decodes to SN_MAIN. When troubleshooting a contract call, check the chain ID, the RPC version and the block identifier before changing the call payload. See the Starknet chain reference.
Use the Starknet method reference to check the transport and methods your integration needs. For a Cairo contract read, first test starknet_call at the intended block. For a subscription, verify that your client and endpoint support the required WebSocket method.