OnFinality offers the following endpoints to connect to your dedicated node:

  • RPC

  • P2P (Peer to Peer)

  • Metrics

The endpoints can all be found in the “API Endpoints” menu on the details page of your dedicated node.

If your node is a Parachain there will be separate endpoints available for the Relay Chain, titled “…Relay”.

Access to the RPC and Metrics endpoints is secured by the API key found at the end of the provided urls, e.g.

https://node-6918055161278474376.jm.onfinality.io/rpc?apikey=9130619d-ard2-4aad-8df4-f9fm4e3f8533

Keep your API Key safe and private, it cannot be regenerated without recreating the node.

RPC

OnFinality exposes HTTP and Websocket access to your dedicated node's Substrate RPC endpoint.

The Polkadot Node Interaction guide includes the standard RPC methods you’ll find across most substrate based networks, but for the complete method set and instructions we recommend network specific documentation.

Certain methods require the --rpc-methods = unsafe launch argument, see Dedicated Node Launch Arguments for more information

P2P (Peer to Peer)

The address which peers can use to connect to your node, for example as a bootnode via the --bootnodes=... argument.

The P2P Internal address can only be reached by other OnFinality-hosted nodes in the same region. When wanting to connect two nodes nodes hosted in the same OnFinality region, it is strongly suggested to use the P2P Internal address for superior performance.

Metrics

The Prometheus Metrics endpoint exposes information such as the block height or number of peers connected to your node.

The substrate tutorial Visualizing Node Metrics has a step-by-step guide to connecting the metrics endpoint to your chosen visualisation tool using Prometheus. The example prometheus configurations below will also be helpful.

Example Prometheus Configurations
Stand Alone (Solo Chain) Node

Connect prometheus to a stand alone (or “solo chain”) Dedicated Node

This example was taken from a node with metrics URL
https://node-{{nodeID}}.lh.onfinality.io/node/metrics?apikey={{apiKey}}

Prometheus.yml:

global:
  # scrape_interval:     15s # By default, scrape targets every 15 seconds.
​
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'substrate_node'
​
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    scheme: 'https'
    metrics_path: '/node/metrics'
​
    # Override the global default and scrape targets from this job every 5 seconds.
    # ** NOTE: you want to have this *LESS THAN* the block time in order to ensure
    # ** that you have a data point for every block!
    scrape_interval: 5s
​
    params:
      apikey: ['{{apiKey}}']
​
    static_configs:
      - targets: ['node-{{nodeID}}.lh.onfinality.io']
YAML

Parachain

Connect Prometheus to both the Dedicated Node’s Relay Chain and Parachain metrics endpoints.

This example was taken from a node with the following metrics urls

Metrics
https://node-{{nodeID}}.lh.onfinality.io/para/metrics?apikey={{apiKey}}

Metrics Relay

https://node-{{nodeID}}.lh.onfinality.io/relay/metrics?apikey={{apiKey}}

Prometheus.yml:

global:
  # scrape_interval:     15s # By default, scrape targets every 15 seconds.
​
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'parachain'
​
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    scheme: 'https'
    metrics_path: '/para/metrics'
​
    # Override the global default and scrape targets from this job every 5 seconds.
    # ** NOTE: you want to have this *LESS THAN* the block time in order to ensure
    # ** that you have a data point for every block!
    scrape_interval: 5s
​
    params:
      apikey: ['{{apiKey}}']
​
    static_configs:
      - targets: ['node-{{nodeID}}.lh.onfinality.io']
​
  - job_name: 'relaychain'
​
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    scheme: 'https'
    metrics_path: '/relay/metrics'
​
    # Override the global default and scrape targets from this job every 5 seconds.
    # ** NOTE: you want to have this *LESS THAN* the block time in order to ensure
    # ** that you have a data point for every block!
    scrape_interval: 5s
​
    params:
      apikey: ['{{apiKey}}']
​
    static_configs:
      - targets: ['node-{{nodeID}}.lh.onfinality.io']
YAML
Multiple Nodes

Connect Prometheus to multiple nodes simultaneously

This example was taken from 3 nodes with the following URLs

Parachain Node
Metrics
https://node-{{node1ID}}.jm.onfinality.io/para/metrics?apikey={{apiKey1}}

Metrics Relay
https://node-{{node1ID}}.jm.onfinality.io/relay/metrics?apikey={{apiKey1}}

Solo Chain Node 1

https://node-{{node2ID}}.jm.onfinality.io/node/metrics?apikey={{apiKey2}}

Solo Chain Node 2

https://node-{{node3ID}}.jm.onfinality.io/node/metrics?apikey={{apiKey3}}

Prometheus.yml

global:
  scrape_interval: 15s # By default, scrape targets every 15 seconds.
​
scrape_configs:
  - job_name: 'parachain1'
​
    scheme: 'https'
    metrics_path: '/para/metrics'
    scrape_interval: 5s
    params:
      apikey: 
        - {{apiKey1}}
    static_configs:
      - targets: 
        - node-{{node1ID}}.jm.onfinality.io
​
  - job_name: 'relaychain1'
​
    scheme: 'https'
    metrics_path: '/relay/metrics'
    scrape_interval: 5s
    params:
      apikey: 
        - {{apiKey1}}
    static_configs:
      - targets: 
        - node-{{node1ID}}.jm.onfinality.io
​
  - job_name: 'solochain1'
​
    scheme: 'https'
    metrics_path: '/node/metrics'
    scrape_interval: 5s
    params:
      apikey: 
        - {{apiKey2}}
    static_configs:
      - targets: 
        - node-{{node2ID}}.jm.onfinality.io
​
  - job_name: 'solochain2'
​
    scheme: 'https'
    metrics_path: '/node/metrics'
    scrape_interval: 5s
    params:
      apikey: 
        - {{apiKey3}}
    static_configs:
      - targets: 
        - node-{{node3ID}}.jm.onfinality.io
YAML

Enabling the Metrics Endpoint

To enable the metrics endpoint add --prometheus-external to your node’s Launch Arguments, following the instructions under the Metrics tab

After saving the Launch Arguments the metrics endpoint will be available within a few minutes.

FAQ

Can I connect to my node via SSH?

No, for security reasons direct SSH connection is not provided. You can communicate with your node via the user interface in the app or via the RPC endpoint.

Does OnFinality support SideCar?

We don’t currently support the Substrate SideCar API, but watch this space!

Can I reset my nodes API Key?

No, this can only be achieved by terminating and recreating the node

Related Articles