Skip to content

Instantly share code, notes, and snippets.

@yourbuddyconner
Created December 27, 2019 01:07
Show Gist options
  • Save yourbuddyconner/d9ebd3076f1cf6edd7b177cd1b9828aa to your computer and use it in GitHub Desktop.
Save yourbuddyconner/d9ebd3076f1cf6edd7b177cd1b9828aa to your computer and use it in GitHub Desktop.
An example deployment of a Coda SNARK Worker. Works out of the box on GKE.
apiVersion: apps/v1
kind: Deployment
metadata:
name: snark-worker-one
namespace: coda-testnet
labels:
app: snark-worker-one
spec:
replicas: 1
selector:
matchLabels:
app: snark-worker-one
template:
metadata:
labels:
app: snark-worker-one
testnet: rising-phoenix
role: snark-worker
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '10004'
prometheus.io/path: '/metrics'
spec:
containers:
- name: coda
resources:
limits:
memory: 10.5Gi
requests:
memory: 6Gi
image: codaprotocol/coda-daemon:0.0.11-beta4
command: ["coda"]
args: [ "daemon",
"-log-level", "Info",
"-config-directory", "~/.coda-config",
"-client-port", "$(DAEMON_CLIENT_PORT)",
"-rest-port", "$(DAEMON_REST_PORT)",
"-external-port", "$(DAEMON_EXTERNAL_PORT)",
"-discovery-port", "$(DAEMON_DISCOVERY_PORT)",
"-metrics-port", "$(DAEMON_METRICS_PORT)",
"-run-snark-worker", "$(CODA_SNARK_KEY)",
"-snark-worker-fee", "$(CODA_SNARK_FEE)",
"-peer", "/dns4/peer1-$(CODA_TESTNET).o1test.net/tcp/8303/ipfs/12D3KooWHMmfuS9DmmK9eH4GC31arDhbtHEBQzX6PwPtQftxzwJs",
"-peer", "/dns4/peer2-$(CODA_TESTNET).o1test.net/tcp/8303/ipfs/12D3KooWAux9MAW1yAdD8gsDbYHmgVjRvdfYkpkfX7AnyGvQaRPF",
"-peer", "/dns4/peer3-$(CODA_TESTNET).o1test.net/tcp/8303/ipfs/12D3KooWCZA4pPWmDAkQf6riDQ3XMRN5k99tCsiRhBAPZCkA8re7"]
env:
- name: DAEMON_REST_PORT
value: "8304"
- name: DAEMON_CLIENT_PORT
value: "8301"
- name: DAEMON_METRICS_PORT
value: "10004"
- name: DAEMON_EXTERNAL_PORT
value: "10005"
- name: DAEMON_DISCOVERY_PORT
value: "10006"
- name: CODA_TESTNET
value: "rising-phoenix"
- name: CODA_SNARK_KEY
value: "<PUBLIC_KEY>"
- name: CODA_SNARK_FEE
value: "2"
ports:
- containerPort: 10005
hostPort: 10005
protocol: TCP
- containerPort: 10006
hostPort: 10006
protocol: TCP
imagePullPolicy: Always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment