The following guide will walk you through creating a bitcoin full node within GKE (Google Container Engine).
By default Bitcoin ABC is used, however this can be swapped for any other node quite easily.
If you wish to run another version of bitcoind, just change the image reference in bitcoin-deployment.yml
. There are tons of images available on the Docker Hub. Better yet, build your own. =)
The source for the included image is available at: https://github.com/zquestz/docker-bitcoin
Steps:
- Add a new blank disk on GCE called
bitcoin-data
that is 200GB. You can always expand it later. - Save the following code snippets and place them in a new directory
kube
. - Change the
rpcuser
andrpcpass
values inbitcoin-secrets.yml
. They are base64 encoded. To base64 a string, just runecho -n SOMESTRING | base64
. - Run
kubectl create -f /path/to/kube
- Profit!
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: default
labels:
service: bitcoin
name: bitcoin
spec:
strategy:
type: Recreate
replicas: 1
template:
metadata:
labels:
service: bitcoin
spec:
containers:
- env:
- name: BITCOIN_RPC_USER
valueFrom:
secretKeyRef:
name: bitcoin
key: rpcuser
- name: BITCOIN_RPC_PASSWORD
valueFrom:
secretKeyRef:
name: bitcoin
key: rpcpass
image: zquestz/bitcoin-abc
name: bitcoin
volumeMounts:
- mountPath: /data
name: bitcoin-data
resources:
requests:
memory: "2Gi"
restartPolicy: Always
volumes:
- name: bitcoin-data
gcePersistentDisk:
pdName: bitcoin-data
fsType: ext4
apiVersion: v1
kind: Secret
metadata:
name: bitcoin
type: Opaque
data:
rpcuser: YWRtaW4=
rpcpass: aXRvbGR5b3V0b2NoYW5nZXRoaXM=
apiVersion: v1
kind: Service
metadata:
name: bitcoin
namespace: default
spec:
ports:
- port: 8333
targetPort: 8333
selector:
service: bitcoin
type: LoadBalancer
externalTrafficPolicy: Local
Nice! Did you have any recommendations for the VM size (2 vCPUS?, 4 vCPUs...?) and RAM ?