Blockchain Queries

The following endpoints are available only on testnet

Since blockchains are public-facing computers and storage systems, you can access chain data with a simple query. Here's how to access MRTR blockchain data.

We'll be using the eth_getBlockByNumber endpoint to get the latest block, but you can see a full list of commands in the Available Endpoints page.

Request type: POST

Endpoint: http://34.133.215.87:8545

Body:

{
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_getBlockByNumber',
    params: ['latest', false],
 }

Using Postman

If you don't have it already, you can download postman here to easily test API endpoints.

Using Axios

const nodeUrl = 'http://34.133.215.87:8545'

await axios
  .post(nodeUrl, {
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_getBlockByNumber',
    params: ['latest', false],
  })
  .then((res) => {
    console.log('MRTR BLOCK DATA: ', res.data.result)
  })
  .catch((err) => {
    console.log('err: ', err.response)
    return err
  })

You can replace nodeUrl with any active RPC endpoint, find a full list in our block explorer TODOEXPLORERLINKHERE

Last updated