Testing Your Node

If you've followed our quick start guide, your validator node should be up and running as it connects to peers on the network. This guide is so you can test to make sure your node is configured correctly and is able to send relays.

Simulate a Relay:

The first thing you need to do is start your node using the --simulateRelay flag:

pocket start --simulateRelay

The relay object is broken down as follows:

  • chain_url: is the URL or IP of the non-native blockchain node listed in your chains.json
  • payload: The data and HMTL request that will be sent to the network.
  • data: A JSON escaped representation of the data to be sent through the network.
  • method: the HTTP request method that indicates the action that is to be performed
  • path: The location of where the data is being sent.
  • headers: Addition information your request may need in your HTTP request
{
    "chain_url": "<URL or IP of your non-native node>",
    "payload": {
        "data": "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"0x5737E23bFe3B0bE0e369d7e8600EE275eD08A86a\", \"latest\"],\"id\":1}",
        "method": "POST",
        "path": "",
        "headers": {}
    }
}

Next, send a curl request to your validator URL: http://<your node>:<your pocket rpc port>/v1/client/sim to see if you can get back a response from your node.

# curl to our validator node that is servicing ETH Rinkeby 

curl -X POST --data '{"chain_url":"HTTP://<non-native node URL>:<port>","payload":{"data":"{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"0xe7a24E61b2ec77d3663ec785d1110688d2A32ecc\", \"latest\"],\"id\":1}","method":"POST","path":"","headers":{}}}' <your node URL>:8081/v1/client/sim

🚧

Important

After you are done testing your node, do not leave the --simulateRelay on because you're giving unfiltered access to your node! When you are done, stop your node, and resume it by running: pocket start

Response types:

200 OK

This response means that your transaction has gone through and you should see a response returning the data you have requested:

"{\"id\":1,\"jsonrpc\":\"2.0\",\"result\":\"0x56bc75e2d63100000\"}"

400 Bad Request

This response means that you have one of the following:

  • incorrect parameters, meaning you don't have all of the required parameters listed in the request.
  • bad formatting in the data field

Updated 11 days ago



Testing Your Node


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.