Streams blocks and transactions to a Pub/Sub topic.
- Create a cluster:
gcloud container clusters create bitcoin-etl-streaming \
--zone us-central1-a \
--num-nodes 1 \
--disk-size 10GB \
--machine-type custom-2-4096 \
--scopes pubsub,storage-rw,logging-write,monitoring-write,service-management,service-control,trace
- Get
kubectl
credentials:
gcloud container clusters get-credentials bitcoin-etl-streaming \
--zone us-central1-a
-
Create Pub/Sub topics "crypto_bitcoin.blocks" and "crypto_bitcoin.transactions". Put it to
overlays/bitcoin/configMap.yaml
,PUB_SUB_TOPIC_PREFIX
property. -
Create GCS bucket. Upload a text file with block number you want to start streaming from to
gs:/<your-bucket>/bitcoin-etl/streaming/last_synced_block.txt
. Put your bucket name tobase/configMap.yaml
,GCS_BUCKET
property. -
Update
overlays/bitcoin/configMap.yaml
,PROVIDER_URI
property to point to your Bitcoin node. -
Create "bitcoin-etl-app" service account with roles:
- Pub/Sub Editor
- Storage Object Creator
Download the key. Create a Kubernetes secret:
kubectl create secret generic bitcoin-etl-app-key --from-file=key.json=$HOME/Downloads/key.json
- Install kustomize https://github.com/kubernetes-sigs/kustomize/blob/master/docs/INSTALL.md.
brew install kustomize
Create the application:
kustomize build overlays/bitcoin | kubectl apply -f -
- To troubleshoot:
kubectl describe pods
kubectl describe node [NODE_NAME]