Blockdaemon Documentation
How to Connect to Polkadot
It’s easy to connect to your Polkadot infrastructure via RPC or WebSocket.
If you haven’t already configured any Polkadot infrastructure, visit the Polkadot marketplace page to learn more about Blockdaemon’s Polkadot options.
Once you have purchased your Blockdaemon Polkadot infrastructure, Your Blockdaemon Technical Account Manager (TAM) will send you the necessary access credentials. There are multiple ways to use these to connect to your node/cluster.
In this guide, we will cover the following simple methods of connection to your infrastructure:
- Polkadot HTTP RPC Connection via cURL
- Polkadot Connection via Websocket
- Polkadot Connection via Sidecar API
Polkadot HTTP RPC Connection via cURL
Step 1 – Your TAM will send you the following access credentials:
- Your Unique Endpoint URL
- Your Unique Auth Token
Please Note: These are one-time view, so make sure to copy them.
Step 2 – Add your access credentials to a cURL request.
curl curl -H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_AUTH_TOKEN" \
-d '{"id":1, "jsonrpc":"2.0", "method": "YOUR_RPC_METHOD"}' \
https://YOUR_ENDPOINT_URL/http-rpc
- Replace
YOUR_ENDPOINT_URL
with the Endpoint URL sent by your Blockdaemon TAM - Replace
YOUR_AUTH_TOKEN
with the Auth Token sent by your Blockdaemon TAM - Replace
YOUR_RPC_METHOD
with your chosen RPC method
Polkadot Connection via WebSocket
Step 1 – Your TAM will send you the following access credentials:
- Your Unique Endpoint URL
- Your Unique Auth Token
Please Note: These are one-time view, so make sure to copy them.
Step 2 – Add your access credentials to a websockets connection request:
wscat -H "X-Auth-Token: YOUR_AUTH_TOKEN" -c wss://YOUR_ENDPOINT_URL/websocket
-
- Replace
YOUR_ENDPOINT_URL
with the Endpoint URL sent by your Blockdaemon TAM - Replace
YOUR_AUTH_TOKEN
with the Auth Token sent by your Blockdaemon TAM
- Replace
Polkadot Connection via Sidecar API
Step 1 – Your TAM will send you the following access credentials:
- Your Unique Endpoint URL
- Your Unique Auth Token
Please Note: These are one-time view, so make sure to copy them.
Step 2 – Add your access credentials to a cURL request:
curl -X GET -H 'Content-Type: application/json' -H 'X-Auth-Token: YOUR_AUTH_TOKEN' 'https://YOUR_ENDPOINT_URL/YOUR_SIDECAR_ENDPOINT'
-
- Replace
YOUR_ENDPOINT_URL
with the Endpoint URL sent by your Blockdaemon TAM - Replace
YOUR_AUTH_TOKEN
with the Auth Token sent by your Blockdaemon TAM - Replace
YOUR_SIDECAR_ENDPOINT
with your chosen REST endpoint
- Replace