Skip to main content

How to use the chain proxy

When you register a new chain, Orchestrate automatically creates a proxy to the Blockchain node, through which all the node's JSON-RPC methods are available.

tip

See the API Methods Reference of Hyperledger Besu for details of all RPC methods.

Execute a JSON-RPC request through the Chain proxy

Prerequisites

Query the node using the Orchestrate Gateway API by sending a POST request to the proxy/chains/{CHAIN_UUID}, where {CHAIN_UUID} is the uuid of the registered chain.

curl --location --request POST 'http://chain-registry:8081/{chain-UUID}' --header 'Content-Type: application/json' --data-raw '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1", false],"id":1}'

How to use the chain proxy cache

Use the chain proxy cache to reduce the amount of calls to the same RPC endpoints. The cache is useful if you have multiple tenants and chains pointing to the same RPC endpoints. Read more on how to configure it here.

The cache covers calls to the following RPC methods:

  • eth_getBlockByNumber
  • eth_getTransactionReceipt

To skip the cache when making requests to the chain proxy, append the X-Cache-Control=no-cache header as follows:

curl -X POST -H "Content-Type: application/json"  -H "X-Cache-Control=no-cache" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params": ....}' {{ORCHESTRATE_GATEWAY_API_URL}}/{{CHAIN_UUID}}