BloqNodes Setup
Nodes is one of the core services of Bloq. In this tutorial you will learn how to set up and start using a Bloq node on your network of choice.
Before you can create a new node, you first need to set up your Bloq account. If you have not done so, please refer to the corresponding guide.
In order to create a new node you must always use Bloq Console. We also provide the Command Line Interface (CLI) and the REST API where you can perform some other actions like retrieve node info or stop a running node.
Use the Bloq Console to Create a New Node
Log into Bloq Console to spin up a new node. You can pick among different chains and networks and you can customize the performance, the region, and the authentication type.
Once you finish with the configuration, choose the billing plan that fits best and select your payment method.
After your payment is confirmed, you will see your new node in the Nodes View and you will be able to access it.
Use the CLI to check your node info
Open the terminal and make sure that you have a valid session. If not, you can start one running bcl login
.
The CLI has the nodes
command which lets you list, remove or get info about your nodes. You can run bcl nodes info
to retrieve your node information:
Use the REST API to check your node info
Retrieving the node information using the REST API requires more steps than the CLI (which automates the whole authentication process). Aside from authentication, the CLI provides the same capabilities as the REST API.
As previously stated, a valid pair of client keys is required prior to using the service. The client keys let you generate your access and refresh tokens. The access token
grants you access to the Nodes Service, but for security reasons, the access token
is a short term token (expires after one hour). When the access token
expires, you can use the refresh token
(expires after one year but could be revoked) to get a new valid access token
.
Generate the access
and refresh
tokens.
access
and refresh
tokens.The first step is to use the client keys to generate access and refresh tokens. In this step you will request access directly to our Accounts Service.
Code Sample
Response
To check how to renew your access token check this section
Check Node Info and PublicIpAddress
PublicIpAddress
Code Sample
Response
TIP
IP is the URL that you are going to use to connect and access your node.
At the moment, the supported chains are btc, btctestnet, bch, bchtestnet, ltc, eth, and ethropsten.
Accessing your Node
In addition to the Bloq Console, CLI, and REST API, nodes may also be accessed via interfaces supported by their chain. These include REST, JSON RPC, and WebSocket RPC. Please see the Blockchain Node API section for more information.
Accessing your BTC / BCH / LTC Node
Mainnet and testnet Bloq nodes on Bitcoin, Bitcoin Cash, and Litecoin (mainnet only) are all accessible through REST and JSON RPC interfaces. To access your node, you must use the proper IP
port corresponding to the node's chain:
REST Code Sample
JSON RPC Code Sample
Response
Accessing Your ETH
Mainnet and Ropsten testnet Ethereum nodes are accessible through JSON and WebSocket RPC interfaces. ETH nodes do not support REST interface. To access your node, you must use the proper IP
port corresponding to the node's chain. There is a different port required for JSON RPC
and WebSocket RPC
commands:
JSON RPC Code Sample
Response
Accessing Your Avalanche Node
Mainnet and testnet nodes are accessible through a JSON RPC interface. Avalanche nodes listen on the following ports:
JSON RPC Code Sample
Response
TIP
Your
NodeUser
andNodePassword
are hexadecimal strings that are accessible through CLI or REST commands above, as well as through the Console website.This username/password pair is unique for each node, and separate from your Bloq username and password.
You now have everything you need to create and request data from your nodes. For more information, please refer to the Nodes Service Technical Reference.
Last updated