Deploy Polkadot Node

Deploy Polkadot Node

The following manifest describes a Polkadot node that syncs Polkadot relay chain network: polkadot, enables HTTP JSON-RPC server rpc: true on custom port rpcPort: 8888, and uses Parity Polkadot client:

kind: Node
  name: polkadot-node
  network: polkadot
  rpc: true
  rpcPort: 8888

Apply polkadot.yaml manifest:

kubectl apply -f polkadot.yaml

Kotal operator will notice your polkadot-node and will create all the necessary pods, persistent volumes, services, configmaps, and secrets neccessary.

You can fetch the deployed Polkadot Node using:

kubectl get nodes.polkadot

It will return an output similar to the following:

polkadot-node    polkadot    fasle

Fetch Node Logs

Get the pods that has been created by Kotal for the node:

kubectl get pods

It will return an output similar to the following:

NAME                  READY   STATUS    RESTARTS   AGE
polkadot-node-0       1/1     Running   0          1m

Get the logs of the running node:

kubectl logs -f polkadot-node-0

It will return node logs similar to the following:

2021-10-17 22:15:12 Parity Polkadot
2021-10-17 22:15:12 ✌️  version 0.9.11-bfd38ed62-x86_64-linux-gnu
2021-10-17 22:15:12 ❤️  by Parity Technologies <>, 2017-2021
2021-10-17 22:15:12 📋 Chain specification: Polkadot
2021-10-17 22:15:12 🏷 Node name: polkadot-node
2021-10-17 22:15:12 👤 Role: FULL
2021-10-17 22:15:12 💾 Database: RocksDb at /polkadot/kotal-data/chains/polkadot/db/full
2021-10-17 22:15:12 ⛓  Native runtime: polkadot-9110 (parity-polkadot-0.tx8.au0)
2021-10-17 22:15:12 🔨 Initializing Genesis block/state (state: 0x29d0…4e17, header-hash: 0x91b1…90c3)
2021-10-17 22:15:12 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2021-10-17 22:15:13 ⏱  Loaded block-time = 6s from block 0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3
2021-10-17 22:15:13 👶 Creating empty BABE epoch changes on what appears to be first startup.
2021-10-17 22:15:13 🏷 Local node identity is: 12D3KooWRo3vvfgPdsJ44tXu1Y2GeFNmC9ror2HsdJjvSjEcfZdw
2021-10-17 22:15:13 📦 Highest known block at #0
2021-10-17 22:15:13 Listening for new connections on
2021-10-17 22:15:13 🔍 Discovered new external address for our node: /ip4/
2021-10-17 22:15:18 ⚙️  Syncing, target=#7304424 (1 peers), best: #64 (0x4983…1114), finalized #0 (0x91b1…90c3), ⬇ 37.0kiB/s ⬆ 17.6kiB/s

Call JSON-RPC Method

Forward localhost:8888 calls to the node pod because rpcPort: 8888:

kubectl port-forward polkadot-node-0 8888

In another terminal window call eth_getBlock JSON-RPC method to get the latest synced block:

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "chain_getBlock", "params": []}'

You will get JSON result similar to the following:

  "jsonrpc": "2.0",
  "result": {
    "block": {
      "extrinsics": [
      "header": {
        "digest": {
          "logs": [
        "extrinsicsRoot": "0xd9c14a96f36005ef6487ff56cb4722ff64afa3535cb1464c988767084094566c",
        "number": "0xba7",
        "parentHash": "0xcfb74aa6750036482897f63806191b3b14447186e45f69c43fcb72e02b57871f",
        "stateRoot": "0x5116aa11f10b1b1ce7c05ea85de08238b7db4c2c485bc88a9167e3b0a153368b"
    "justifications": null
  "id": 1

Finally you can delete the node by:

kubectl delete -f polkadot.yaml "polkadot-node" deleted

Kubernetes garbage collector will delete all the resources that has been created by Kotal Polkadot Node controller.

Last updated