Skip to content

Instantly share code, notes, and snippets.

@kmahyyg
Created April 2, 2021 16:55
Show Gist options
  • Select an option

  • Save kmahyyg/6b5eb6554e3dc15cc751a668ef62f4ec to your computer and use it in GitHub Desktop.

Select an option

Save kmahyyg/6b5eb6554e3dc15cc751a668ef62f4ec to your computer and use it in GitHub Desktop.
hyperledger sawtooth working with minikube v1.18.1 and k8s v1.20.2 on docker v20.10.3 (Linux amd64)
---
apiVersion: v1
kind: List
items:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: sawtooth-0
spec:
replicas: 1
selector:
matchLabels:
name: sawtooth-0
template:
metadata:
labels:
name: sawtooth-0
spec:
containers:
- name: sawtooth-intkey-tp-python
image: hyperledger/sawtooth-intkey-tp-python:chime
command:
- bash
args:
- -c
- "intkey-tp-python -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-poet-engine
image: hyperledger/sawtooth-poet-engine:chime
command:
- bash
args:
- -c
- "if [ ! -f /poet-shared/poet-enclave-measurement ]; then \
poet enclave measurement >> /poet-shared/poet-enclave-measurement; \
fi && \
if [ ! -f /poet-shared/poet-enclave-basename ]; then \
poet enclave basename >> /poet-shared/poet-enclave-basename; \
fi && \
if [ ! -f /poet-shared/simulator_rk_pub.pem ]; then \
cp /etc/sawtooth/simulator_rk_pub.pem /poet-shared; \
fi && \
while [ ! -f /poet-shared/validator-0/keys/validator.priv ]; do \
echo 'waiting for validator key'; \
sleep 1; \
done && \
cp -a /poet-shared/validator-0/keys /etc/sawtooth && \
poet registration create -k /etc/sawtooth/keys/validator.priv -o /poet-shared/poet.batch && \
poet-engine -C tcp://$HOSTNAME:5050 --component tcp://$HOSTNAME:4004"
volumeMounts:
- name: poet-shared-0
mountPath: "/poet-shared"
- name: sawtooth-poet-validator-registry-tp
image: hyperledger/sawtooth-poet-validator-registry-tp:chime
command:
- bash
args:
- -c
- "poet-validator-registry-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-rest-api
image: hyperledger/sawtooth-rest-api:chime
ports:
- name: api
containerPort: 8008
command:
- bash
args:
- -c
- "sawtooth-rest-api -C tcp://$HOSTNAME:4004"
- name: sawtooth-settings-tp
image: hyperledger/sawtooth-settings-tp:chime
command:
- bash
args:
- -c
- "settings-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-shell
image: hyperledger/sawtooth-shell:chime
command:
- bash
args:
- -c
- "sawtooth keygen && tail -f /dev/null"
- name: sawtooth-validator
image: hyperledger/sawtooth-validator:chime
ports:
- name: tp
containerPort: 4004
- name: consensus
containerPort: 5050
- name: validators
containerPort: 8800
command:
- bash
args:
- -c
- "if [ ! -e /etc/sawtooth/keys/validator.priv ]; then \
sawadm keygen; \
fi && \
mkdir -p /poet-shared/validator-0 || true && \
cp -a /etc/sawtooth/keys /poet-shared/validator-0 && \
while [ ! -f /poet-shared/poet-enclave-measurement ]; do \
echo 'waiting for poet-enclave-measurement'; \
sleep 1; \
done && \
while [ ! -f /poet-shared/poet-enclave-basename ]; do \
echo 'waiting for poet-enclave-basename'; \
sleep 1; \
done && \
while [ ! -f /poet-shared/poet.batch ]; do \
echo 'waiting for poet.batch'; \
sleep 1; \
done && \
if [ ! -e /root/.sawtooth/keys/my_key.priv ]; then \
sawtooth keygen my_key; \
fi && \
cp /poet-shared/poet.batch / && \
if [ ! -e config-genesis.batch ]; then \
sawset genesis -k /root/.sawtooth/keys/my_key.priv -o config-genesis.batch; \
fi && \
if [ ! -e config.batch ]; then \
sawset proposal create \
-k /root/.sawtooth/keys/my_key.priv \
sawtooth.consensus.algorithm.name=PoET \
sawtooth.consensus.algorithm.version=0.1 \
sawtooth.poet.report_public_key_pem=\"$(cat /poet-shared/simulator_rk_pub.pem)\" \
sawtooth.poet.valid_enclave_measurements=$(cat /poet-shared/poet-enclave-measurement) \
sawtooth.poet.valid_enclave_basenames=$(cat /poet-shared/poet-enclave-basename) \
sawtooth.poet.initial_wait_time=15 \
sawtooth.poet.target_wait_time=15 \
sawtooth.publisher.max_batches_per_block=200 \
sawtooth.poet.key_block_claim_limit=100000 \
sawtooth.poet.ztest_minimum_win_count=100000 \
-o config.batch; \
fi && \
if [ ! -e /var/lib/sawtooth/genesis.batch ]; then \
sawadm genesis config-genesis.batch config.batch poet.batch; \
fi && \
sawtooth-validator -vv \
--endpoint tcp://$SAWTOOTH_0_SERVICE_HOST:8800 \
--bind component:tcp://eth0:4004 \
--bind consensus:tcp://eth0:5050 \
--bind network:tcp://eth0:8800 \
--peers tcp://$SAWTOOTH_1_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_2_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_3_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_4_SERVICE_HOST:8800"
volumeMounts:
- name: poet-shared-0
mountPath: "/poet-shared"
- name: sawtooth-xo-tp-python
image: hyperledger/sawtooth-xo-tp-python:chime
command:
- bash
args:
- -c
- "xo-tp-python -vv -C tcp://$HOSTNAME:4004"
volumes:
- name: poet-shared-0
hostPath:
path: /minikube/data/poetshare0
type: Directory
- apiVersion: v1
kind: Service
metadata:
name: sawtooth-0
spec:
type: ClusterIP
selector:
name: sawtooth-0
ports:
- name: "4004"
protocol: TCP
port: 4004
targetPort: 4004
- name: "5050"
protocol: TCP
port: 5050
targetPort: 5050
- name: "8008"
protocol: TCP
port: 8008
targetPort: 8008
- name: "8080"
protocol: TCP
port: 8080
targetPort: 8080
- name: "8800"
protocol: TCP
port: 8800
targetPort: 8800
- apiVersion: apps/v1
kind: Deployment
metadata:
name: sawtooth-1
spec:
replicas: 1
selector:
matchLabels:
name: sawtooth-1
template:
metadata:
labels:
name: sawtooth-1
spec:
containers:
- name: sawtooth-intkey-tp-python
image: hyperledger/sawtooth-intkey-tp-python:chime
command:
- bash
args:
- -c
- "intkey-tp-python -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-poet-engine
image: hyperledger/sawtooth-poet-engine:chime
command:
- bash
args:
- -c
- "while [ ! -f /poet-shared/validator-1/keys/validator.priv ]; do \
echo 'waiting for validator key'; \
sleep 1; \
done && \
cp -a /poet-shared/validator-1/keys /etc/sawtooth && \
poet-engine -C tcp://$HOSTNAME:5050 --component tcp://$HOSTNAME:4004"
volumeMounts:
- name: poet-shared-1
mountPath: "/poet-shared"
- name: sawtooth-poet-validator-registry-tp
image: hyperledger/sawtooth-poet-validator-registry-tp:chime
command:
- bash
args:
- -c
- "poet-validator-registry-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-rest-api
image: hyperledger/sawtooth-rest-api:chime
ports:
- name: api
containerPort: 8008
command:
- bash
args:
- -c
- "sawtooth-rest-api -C tcp://$HOSTNAME:4004"
- name: sawtooth-settings-tp
image: hyperledger/sawtooth-settings-tp:chime
command:
- bash
args:
- -c
- "settings-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-shell
image: hyperledger/sawtooth-shell:chime
command:
- bash
args:
- -c
- "sawtooth keygen && tail -f /dev/null"
- name: sawtooth-validator
image: hyperledger/sawtooth-validator:chime
ports:
- name: tp
containerPort: 4004
- name: consensus
containerPort: 5050
- name: validators
containerPort: 8800
command:
- bash
args:
- -c
- "sawadm keygen && \
mkdir -p /poet-shared/validator-1 || true && \
cp -a /etc/sawtooth/keys /poet-shared/validator-1 && \
sawtooth keygen my_key && \
sawtooth-validator -vv \
--endpoint tcp://$SAWTOOTH_1_SERVICE_HOST:8800 \
--bind component:tcp://eth0:4004 \
--bind consensus:tcp://eth0:5050 \
--bind network:tcp://eth0:8800 \
--peers tcp://$SAWTOOTH_0_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_2_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_3_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_4_SERVICE_HOST:8800"
volumeMounts:
- name: poet-shared-1
mountPath: "/poet-shared"
- name: sawtooth-xo-tp-python
image: hyperledger/sawtooth-xo-tp-python:chime
command:
- bash
args:
- -c
- "xo-tp-python -vv -C tcp://$HOSTNAME:4004"
volumes:
- name: poet-shared-1
hostPath:
path: /minikube/data/poetshare1
type: Directory
- apiVersion: v1
kind: Service
metadata:
name: sawtooth-1
spec:
type: ClusterIP
selector:
name: sawtooth-1
ports:
- name: "4004"
protocol: TCP
port: 4004
targetPort: 4004
- name: "5050"
protocol: TCP
port: 5050
targetPort: 5050
- name: "8008"
protocol: TCP
port: 8008
targetPort: 8008
- name: "8080"
protocol: TCP
port: 8080
targetPort: 8080
- name: "8800"
protocol: TCP
port: 8800
targetPort: 8800
- apiVersion: apps/v1
kind: Deployment
metadata:
name: sawtooth-2
spec:
replicas: 1
selector:
matchLabels:
name: sawtooth-2
template:
metadata:
labels:
name: sawtooth-2
spec:
containers:
- name: sawtooth-intkey-tp-python
image: hyperledger/sawtooth-intkey-tp-python:chime
command:
- bash
args:
- -c
- "intkey-tp-python -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-poet-engine
image: hyperledger/sawtooth-poet-engine:chime
command:
- bash
args:
- -c
- "while [ ! -f /poet-shared/validator-2/keys/validator.priv ]; do \
echo 'waiting for validator key'; \
sleep 1; \
done && \
cp -a /poet-shared/validator-2/keys /etc/sawtooth && \
poet-engine -C tcp://$HOSTNAME:5050 --component tcp://$HOSTNAME:4004"
volumeMounts:
- name: poet-shared-2
mountPath: "/poet-shared"
- name: sawtooth-poet-validator-registry-tp
image: hyperledger/sawtooth-poet-validator-registry-tp:chime
command:
- bash
args:
- -c
- "poet-validator-registry-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-rest-api
image: hyperledger/sawtooth-rest-api:chime
ports:
- name: api
containerPort: 8008
command:
- bash
args:
- -c
- "sawtooth-rest-api -C tcp://$HOSTNAME:4004"
- name: sawtooth-settings-tp
image: hyperledger/sawtooth-settings-tp:chime
command:
- bash
args:
- -c
- "settings-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-shell
image: hyperledger/sawtooth-shell:chime
command:
- bash
args:
- -c
- "sawtooth keygen && tail -f /dev/null"
- name: sawtooth-validator
image: hyperledger/sawtooth-validator:chime
ports:
- name: tp
containerPort: 4004
- name: consensus
containerPort: 5050
- name: validators
containerPort: 8800
command:
- bash
args:
- -c
- "sawadm keygen && \
mkdir -p /poet-shared/validator-2 || true && \
cp -a /etc/sawtooth/keys /poet-shared/validator-2 && \
sawtooth keygen my_key && \
sawtooth-validator -vv \
--endpoint tcp://$SAWTOOTH_2_SERVICE_HOST:8800 \
--bind component:tcp://eth0:4004 \
--bind consensus:tcp://eth0:5050 \
--bind network:tcp://eth0:8800 \
--peers tcp://$SAWTOOTH_0_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_1_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_3_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_4_SERVICE_HOST:8800"
volumeMounts:
- name: poet-shared-2
mountPath: "/poet-shared"
- name: sawtooth-xo-tp-python
image: hyperledger/sawtooth-xo-tp-python:chime
command:
- bash
args:
- -c
- "xo-tp-python -vv -C tcp://$HOSTNAME:4004"
volumes:
- name: poet-shared-2
hostPath:
path: /minikube/data/poetshare2
type: Directory
- apiVersion: v1
kind: Service
metadata:
name: sawtooth-2
spec:
type: ClusterIP
selector:
name: sawtooth-2
ports:
- name: "4004"
protocol: TCP
port: 4004
targetPort: 4004
- name: "5050"
protocol: TCP
port: 5050
targetPort: 5050
- name: "8008"
protocol: TCP
port: 8008
targetPort: 8008
- name: "8080"
protocol: TCP
port: 8080
targetPort: 8080
- name: "8800"
protocol: TCP
port: 8800
targetPort: 8800
- apiVersion: apps/v1
kind: Deployment
metadata:
name: sawtooth-3
spec:
replicas: 1
selector:
matchLabels:
name: sawtooth-3
template:
metadata:
labels:
name: sawtooth-3
spec:
containers:
- name: sawtooth-intkey-tp-python
image: hyperledger/sawtooth-intkey-tp-python:chime
command:
- bash
args:
- -c
- "intkey-tp-python -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-poet-engine
image: hyperledger/sawtooth-poet-engine:chime
command:
- bash
args:
- -c
- "while [ ! -f /poet-shared/validator-3/keys/validator.priv ]; do \
echo 'waiting for validator key'; \
sleep 1; \
done && \
cp -a /poet-shared/validator-3/keys /etc/sawtooth && \
poet-engine -C tcp://$HOSTNAME:5050 --component tcp://$HOSTNAME:4004"
volumeMounts:
- name: poet-shared-3
mountPath: "/poet-shared"
- name: sawtooth-poet-validator-registry-tp
image: hyperledger/sawtooth-poet-validator-registry-tp:chime
command:
- bash
args:
- -c
- "poet-validator-registry-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-rest-api
image: hyperledger/sawtooth-rest-api:chime
ports:
- name: api
containerPort: 8008
command:
- bash
args:
- -c
- "sawtooth-rest-api -C tcp://$HOSTNAME:4004"
- name: sawtooth-settings-tp
image: hyperledger/sawtooth-settings-tp:chime
command:
- bash
args:
- -c
- "settings-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-shell
image: hyperledger/sawtooth-shell:chime
command:
- bash
args:
- -c
- "sawtooth keygen && tail -f /dev/null"
- name: sawtooth-validator
image: hyperledger/sawtooth-validator:chime
ports:
- name: tp
containerPort: 4004
- name: consensus
containerPort: 5050
- name: validators
containerPort: 8800
command:
- bash
args:
- -c
- "sawadm keygen && \
mkdir -p /poet-shared/validator-3 || true && \
cp -a /etc/sawtooth/keys /poet-shared/validator-3 && \
sawtooth keygen my_key && \
sawtooth-validator -vv \
--endpoint tcp://$SAWTOOTH_3_SERVICE_HOST:8800 \
--bind component:tcp://eth0:4004 \
--bind consensus:tcp://eth0:5050 \
--bind network:tcp://eth0:8800 \
--peers tcp://$SAWTOOTH_0_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_1_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_2_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_4_SERVICE_HOST:8800"
volumeMounts:
- name: poet-shared-3
mountPath: "/poet-shared"
- name: sawtooth-xo-tp-python
image: hyperledger/sawtooth-xo-tp-python:chime
command:
- bash
args:
- -c
- "xo-tp-python -vv -C tcp://$HOSTNAME:4004"
volumes:
- name: poet-shared-3
hostPath:
path: /minikube/data/poetshare3
type: Directory
- apiVersion: v1
kind: Service
metadata:
name: sawtooth-3
spec:
type: ClusterIP
selector:
name: sawtooth-3
ports:
- name: "4004"
protocol: TCP
port: 4004
targetPort: 4004
- name: "5050"
protocol: TCP
port: 5050
targetPort: 5050
- name: "8008"
protocol: TCP
port: 8008
targetPort: 8008
- name: "8080"
protocol: TCP
port: 8080
targetPort: 8080
- name: "8800"
protocol: TCP
port: 8800
targetPort: 8800
- apiVersion: apps/v1
kind: Deployment
metadata:
name: sawtooth-4
spec:
replicas: 1
selector:
matchLabels:
name: sawtooth-4
template:
metadata:
labels:
name: sawtooth-4
spec:
containers:
- name: sawtooth-intkey-tp-python
image: hyperledger/sawtooth-intkey-tp-python:chime
command:
- bash
args:
- -c
- "intkey-tp-python -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-poet-engine
image: hyperledger/sawtooth-poet-engine:chime
command:
- bash
args:
- -c
- "while [ ! -f /poet-shared/validator-4/keys/validator.priv ]; do \
echo 'waiting for validator key'; \
sleep 1; \
done && \
cp -a /poet-shared/validator-4/keys /etc/sawtooth && \
poet-engine -C tcp://$HOSTNAME:5050 --component tcp://$HOSTNAME:4004"
volumeMounts:
- name: poet-shared-4
mountPath: "/poet-shared"
- name: sawtooth-poet-validator-registry-tp
image: hyperledger/sawtooth-poet-validator-registry-tp:chime
command:
- bash
args:
- -c
- "poet-validator-registry-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-rest-api
image: hyperledger/sawtooth-rest-api:chime
ports:
- name: api
containerPort: 8008
command:
- bash
args:
- -c
- "sawtooth-rest-api -C tcp://$HOSTNAME:4004"
- name: sawtooth-settings-tp
image: hyperledger/sawtooth-settings-tp:chime
command:
- bash
args:
- -c
- "settings-tp -vv -C tcp://$HOSTNAME:4004"
- name: sawtooth-shell
image: hyperledger/sawtooth-shell:chime
command:
- bash
args:
- -c
- "sawtooth keygen && tail -f /dev/null"
- name: sawtooth-validator
image: hyperledger/sawtooth-validator:chime
ports:
- name: tp
containerPort: 4004
- name: consensus
containerPort: 5050
- name: validators
containerPort: 8800
command:
- bash
args:
- -c
- "sawadm keygen && \
mkdir -p /poet-shared/validator-4 || true && \
cp -a /etc/sawtooth/keys /poet-shared/validator-4 && \
sawtooth keygen my_key && \
sawtooth-validator -vv \
--endpoint tcp://$SAWTOOTH_4_SERVICE_HOST:8800 \
--bind component:tcp://eth0:4004 \
--bind consensus:tcp://eth0:5050 \
--bind network:tcp://eth0:8800 \
--peers tcp://$SAWTOOTH_0_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_1_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_2_SERVICE_HOST:8800 \
--peers tcp://$SAWTOOTH_3_SERVICE_HOST:8800"
volumeMounts:
- name: poet-shared-4
mountPath: "/poet-shared"
- name: sawtooth-xo-tp-python
image: hyperledger/sawtooth-xo-tp-python:chime
command:
- bash
args:
- -c
- "xo-tp-python -vv -C tcp://$HOSTNAME:4004"
volumes:
- name: poet-shared-4
hostPath:
path: /minikube/data/poetshare4
type: Directory
- apiVersion: v1
kind: Service
metadata:
name: sawtooth-4
spec:
type: ClusterIP
selector:
name: sawtooth-4
ports:
- name: "4004"
protocol: TCP
port: 4004
targetPort: 4004
- name: "5050"
protocol: TCP
port: 5050
targetPort: 5050
- name: "8008"
protocol: TCP
port: 8008
targetPort: 8008
- name: "8080"
protocol: TCP
port: 8080
targetPort: 8080
- name: "8800"
protocol: TCP
port: 8800
targetPort: 8800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment