Stacks node requires a Bitcoin node to connect to on the back-end for Proof of Transfer. You can deploy a Bitcoin node using Kotal operator like we did in this guide. In this tutorial, we will be using Bitcoin node hosted by Stacks Foundation.
Make sure Bitcoin node is fully synced before deploying your Stacks node.
Generating Miner Private Key
Don't use the following Miner private key in production!
Generate Key chain using Stacks CLI tool. Stacks CLI can be installed using:
Apply bitcoin-node-rpc-password.yaml to create the password secret:
kubectl apply -f bitcoin-node-rpc-password.yaml
Deploy Stacks Miner Node
The following manifest describes a Stacks node that syncs Stacks mainnet network: mainnet, and connects to the bitcoin node using configurations in bitcoinNode: ... for Proof of Transfer, and loading miner private key using seedPrivateKeySecretName:
Kotal operator will notice your stacks-node and will create all the necessary pods, persistent volumes, services, configmaps, and secrets neccessary.
You can fetch the deployed Stacks Node using:
kubectl get nodes.stacks
It will return an output similar to the following:
NAME NETWORK CLIENT MINER
stacks-node mainnet stacks true
Note Miner is true in the previous output 🔥
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
stacks-node-0 1/1 Running 0 1m
Get the logs of the running node:
kubectl logs -f stacks-node-0
It will return node logs similar to the following:
INFO [1649610683.233993] [testnet/stacks-node/src/main.rs:113] [main] Loading config at path /home/stacks/kotal-config/config.toml
INFO [1649610683.795606] [testnet/stacks-node/src/run_loop/neon.rs:341] [main] Start syncing Bitcoin headers, feel free to grab a cup of coffee, this can take a while
INFO [1649610686.606279] [src/burnchains/bitcoin/spv.rs:923] [main] Syncing Bitcoin headers: 0.3% (2000 out of 731294)
INFO [1649610687.625014] [src/burnchains/bitcoin/spv.rs:923] [main] Syncing Bitcoin headers: 0.5% (4000 out of 731294)
INFO [1649610688.634560] [src/burnchains/bitcoin/spv.rs:923] [main] Syncing Bitcoin headers: 0.8% (6000 out of 731294)
INFO [1649610689.677533] [src/burnchains/bitcoin/spv.rs:923] [main] Syncing Bitcoin headers: 1.1% (8000 out of 731294)
INFO [1649610690.737928] [src/burnchains/bitcoin/spv.rs:923] [main] Syncing Bitcoin headers: 1.4% (10000 out of 731294)
INFO [1649610691.745002] [src/burnchains/bitcoin/spv.rs:923] [main] Syncing Bitcoin headers: 1.6% (12000 out of 731294)
INFO [1649610692.789689] [src/burnchains/bitcoin/spv.rs:923] [main] Syncing Bitcoin headers: 1.9% (14000 out of 731294)
...
Finally you can delete the node by:
kubectl delete -f stacks.yaml
Kubernetes garbage collector will delete all the resources that has been created by Stacks Node controller.