Tips & Tricks

How to get the current gas price

To get the gas price on Chiliz Chain, you can use one of the public RPC nodes.

You can request the gas price like so:

curl --location 'https://rpc.ankr.com/chiliz' 
--header 'Content-Type: application/json' 
--data '{ 
    "method": "eth_gasPrice", 
    "params": [], 
    "id": 1, 
    "jsonrpc": "2.0"
}'

How to check why a transaction failed

A transaction might fail, and you don't always know why, especially since the block explorer doesn't display the error.

To check why your transaction failed, run the following script in the terminal with the correct transaction ID:

curl --location 'https://chiliz-rpc.publicnode.com' \
--header 'Content-Type: application/json' \
--data '{
    "method": "debug_traceTransaction",
    "params": [
        "[Transaction ID]",
        {
            "tracer": "callTracer"
        }
    ],
    "id": 1,
    "jsonrpc": "2.0"
}'

Last updated