Skip to Content
MCN Blockchain

First RPC request

Check the chain ID and read the current execution height over HTTPS.

Check the chain ID

Send a JSON-RPC 2.0 POST with the JSON content type.

curl --fail-with-body -sS https://rpc.mcnblockchain.com \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
{"jsonrpc":"2.0","id":1,"result":"0x915"}

Read the execution head

curl --fail-with-body -sS https://rpc.mcnblockchain.com \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":2,"method":"eth_blockNumber","params":[]}'

Decode the hex quantity before comparing heights. Treat HTTP errors, transport errors, and the JSON-RPC error field independently. For monitoring, record the requested method, duration, and error code. Keep signing data and credentials out of logs.

See JSON-RPC reference for method behavior and the finality guide for crediting deposits.

On this page