Skip to content

Instantly share code, notes, and snippets.

@TanjinAlam
Created December 11, 2022 16:46
Show Gist options
  • Save TanjinAlam/a96db2cda41c449123bbe64cf8094f99 to your computer and use it in GitHub Desktop.
Save TanjinAlam/a96db2cda41c449123bbe64cf8094f99 to your computer and use it in GitHub Desktop.
# Copyright 2018-2020 Cargill Incorporated
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------------
version: "3.6"
volumes:
contracts-shared:
grid-shared:
gridd-alpha:
templates-shared:
cache-shared:
services:
# ---== shared services ==---
sabre-cli:
image: hyperledger/sawtooth-sabre-cli:latest
volumes:
- contracts-shared:/usr/share/scar
- grid-shared:/grid-shared
container_name: sabre-cli
stop_signal: SIGKILL
tnt-contract-builder:
image: piashtanjin/tnt-contract-builder:latest
container_name: tnt-contract-builder
volumes:
- grid-shared:/grid-shared
entrypoint: |
bash -c "
while true; do curl -s http://sawtooth-rest-api:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done;
sabre cr --create grid_track_and_trace --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre upload --filename /tmp/track_and_trace.yaml --key /grid-shared/my_key --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create a43b46 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre perm a43b46 grid_track_and_trace --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee01 grid_track_and_trace --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee05 grid_track_and_trace --key /grid-shared/my_key --read --url http://sawtooth-rest-api:8008 --wait 30
echo '---------========= track and trace contract is loaded =========---------'
"
schema-contract-builder:
image: piashtanjin/schema-contract-builder:latest
container_name: schema-contract-builder
volumes:
- grid-shared:/grid-shared
entrypoint: |
bash -c "
while true; do curl -s http://sawtooth-rest-api:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done;
sabre cr --create grid_schema --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre upload --filename /tmp/schema.yaml --key /grid-shared/my_key --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 621dee01 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee01 grid_schema --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee05 grid_schema --key /grid-shared/my_key --read --url http://sawtooth-rest-api:8008 --wait 30
echo '---------========= grid schema contract is loaded =========---------'
"
pike-contract-builder:
image: piashtanjin/pike-contract-builder:latest
container_name: pike-contract-builder
volumes:
- grid-shared:/grid-shared
entrypoint: |
bash -c "
while true; do curl -s http://sawtooth-rest-api:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done;
sabre cr --create grid_pike --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre upload --filename /tmp/pike.yaml --key /grid-shared/my_key --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 621dee05 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee05 grid_pike --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
echo '---------========= pike contract is loaded =========---------'
"
product-contract-builder:
image: piashtanjin/product-contract-builder:latest
container_name: product-contract-builder
volumes:
- grid-shared:/grid-shared
entrypoint: |
bash -c "
while true; do curl -s http://sawtooth-rest-api:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done;
sabre cr --create grid_product --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre upload --filename /tmp/product.yaml --key /grid-shared/my_key --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 621dee05 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 621dee01 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 621dee02 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee05 grid_product --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee01 grid_product --key /grid-shared/my_key --read --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee02 grid_product --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
echo '---------========= grid_product contract is loaded =========---------'
"
location-contract-builder:
image: piashtanjin/location-contract-builder:latest
container_name: location-contract-builder
volumes:
- grid-shared:/grid-shared
entrypoint: |
bash -c "
while true; do curl -s http://sawtooth-rest-api:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done;
sabre cr --create grid_location --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre upload --filename /tmp/location.yaml --key /grid-shared/my_key --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 621dee04 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee05 grid_location --key /grid-shared/my_key --read --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee01 grid_location --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee04 grid_location --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
echo '---------========= grid_location contract is loaded =========---------'
"
purchase-order-contract-builder:
image: piashtanjin/purchase-order-contract-builder:latest
container_name: purchase-order-contract-builder
volumes:
- grid-shared:/grid-shared
entrypoint: |
bash -c "
while true; do curl -s http://sawtooth-rest-api:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done;
sabre cr --create grid_purchase_order --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre upload --filename /tmp/purchase_order.yaml --key /grid-shared/my_key --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 621dee06 --key /grid-shared/my_key --owner $$(cat /grid-shared/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee05 grid_purchase_order --key /grid-shared/my_key --read --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 621dee06 grid_purchase_order --key /grid-shared/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
echo '---------========= grid_purchase_order contract is loaded =========---------'
"
sawtooth-validator:
image: hyperledger/sawtooth-validator:latest
volumes:
- grid-shared:/grid-shared
container_name: sawtooth-validator
expose:
- 4004
- 8800
- 5050
ports:
- "4004:4004"
# start the validator with an empty genesis batch
command: |
bash -c "
if [ ! -f /etc/sawtooth/keys/validator.priv ]; then
sawadm keygen &&
sawtooth keygen my_key &&
cp /root/.sawtooth/keys/my_key.* /grid-shared &&
sawset genesis -k /root/.sawtooth/keys/my_key.priv &&
sawset proposal create \
-k /root/.sawtooth/keys/my_key.priv \
sawtooth.swa.administrators=$$(cat /grid-shared/my_key.pub) \
sawtooth.consensus.algorithm.name=Devmode \
sawtooth.consensus.algorithm.version=0.1 \
-o config.batch &&
sawset proposal create \
-k /root/.sawtooth/keys/my_key.priv \
sawtooth.swa.administrators=$$(cat /grid-shared/my_key.pub) \
-o sabre-admin.batch
sawadm genesis config-genesis.batch config.batch sabre-admin.batch
fi;
sawtooth-validator -vv \
--endpoint tcp://sawtooth-validator:8800 \
--bind component:tcp://eth0:4004 \
--bind network:tcp://eth0:8800 \
--bind consensus:tcp://eth0:5050
"
stop_signal: SIGKILL
sawtooth-rest-api:
image: hyperledger/sawtooth-rest-api:latest
container_name: sawtooth-rest-api
ports:
- "8008:8008"
depends_on:
- sawtooth-validator
command: |
bash -c "
sawtooth-rest-api -v --connect tcp://sawtooth-validator:4004 --bind sawtooth-rest-api:8008
"
stop_signal: SIGKILL
sawtooth-settings-tp:
image: hyperledger/sawtooth-settings-tp:latest
container_name: sawtooth-settings-tp
expose:
- 4004
command: settings-tp -v -C tcp://sawtooth-validator:4004
stop_signal: SIGKILL
sabre-tp:
image: hyperledger/sawtooth-sabre-tp:0.8
container_name: sawtooth-sabre-tp
depends_on:
- sawtooth-validator
entrypoint: sawtooth-sabre -vv --connect tcp://sawtooth-validator:4004
sawtooth-client:
image: hyperledger/sawtooth-shell:latest
container_name: sawtooth-shell
depends_on:
- sawtooth-validator
command: |
bash -c "
sawtooth keygen &&
tail -f /dev/null
"
stop_signal: SIGKILL
devmode-rust:
image: hyperledger/sawtooth-devmode-engine-rust:nightly
container_name: sawtooth-devmode-engine-rust
depends_on:
- sawtooth-validator
command: |
devmode-engine-rust -vv --connect tcp://sawtooth-validator:5050
stop_signal: SIGKILL
# # pbft-0:
# # image: hyperledger/sawtooth-pbft-engine:nightly
# # container_name: sawtooth-pbft-engine-default-0
# # depends_on:
# # - sawtooth-validator
# # command: pbft-engine -vv --connect tcp://sawtooth-validator:5050
# # stop_signal: SIGKILL
# # ---== alpha node ==---
db-alpha:
image: postgres
container_name: db-alpha
hostname: db-alpha
restart: always
expose:
- 5432
ports:
- 5532:5432
environment:
POSTGRES_USER: grid
POSTGRES_PASSWORD: grid_example
POSTGRES_DB: grid
gridd-alpha:
image: gridd
container_name: gridd-alpha
hostname: gridd-alpha
build:
context: ../..
dockerfile: daemon/Dockerfile
args:
- REPO_VERSION=${REPO_VERSION}
- CARGO_ARGS= --features experimental
volumes:
- contracts-shared:/usr/share/scar
- grid-shared:/grid-shared
- gridd-alpha:/etc/grid/keys
- cache-shared:/var/cache/grid
expose:
- 8080
ports:
- "8080:8080"
environment:
GRID_DAEMON_KEY: "alpha-agent"
GRID_DAEMON_ENDPOINT: "http://gridd-alpha:8080"
entrypoint: |
bash -c "
# we need to wait for the db to have started.
until PGPASSWORD=grid_example psql -h db-alpha -U grid -c '\q' > /dev/null 2>&1; do
>&2 echo \"Database is unavailable - sleeping\"
sleep 1
done
grid keygen --skip && \
grid keygen --system --skip && \
grid -vv database migrate \
-C postgres://grid:grid_example@db-alpha/grid &&
gridd -vv -b 0.0.0.0:8080 -k root -C tcp://sawtooth-validator:4004 \
--database-url postgres://grid:grid_example@db-alpha/grid
"
# # ---== beta node ==---
# db-beta:
# image: postgres
# container_name: db-beta
# hostname: db-beta
# restart: always
# expose:
# - 5432
# environment:
# POSTGRES_USER: grid
# POSTGRES_PASSWORD: grid_example
# POSTGRES_DB: grid
# gridd-beta:
# image: gridd
# container_name: gridd-beta
# hostname: gridd-beta
# build:
# context: ../..
# dockerfile: daemon/Dockerfile
# args:
# - REPO_VERSION=${REPO_VERSION}
# - CARGO_ARGS= --features experimental
# volumes:
# - contracts-shared:/usr/share/scar
# - gridd-beta:/etc/grid/keys
# - cache-shared:/var/cache/grid
# expose:
# - 8080
# ports:
# - "8081:8080"
# environment:
# GRID_DAEMON_KEY: "beta-agent"
# GRID_DAEMON_ENDPOINT: "http://gridd-beta:8080"
# entrypoint: |
# bash -c "
# # we need to wait for the db to have started.
# until PGPASSWORD=grid_example psql -h db-beta -U grid -c '\q' > /dev/null 2>&1; do
# >&2 echo \"Database is unavailable - sleeping\"
# sleep 1
# done
# grid keygen --skip && \
# grid keygen --system --skip && \
# grid -vv database migrate \
# -C postgres://grid:grid_example@db-beta/grid &&
# gridd -vv -b 0.0.0.0:8080 -C tcp://sawtooth-validator:4004 \
# -k root \
# --database-url postgres://grid:grid_example@db-beta/grid
# "
# sawtooth-validator:
# image: hyperledger/sawtooth-validator:latest
# volumes:
# - grid-shared:/grid-shared
# container_name: sawtooth-validator
# expose:
# - 4004
# - 8800
# - 5050
# ports:
# - "4004:4004"
# # start the validator with an empty genesis batch
# command: |
# bash -c "
# if [ ! -f /etc/sawtooth/keys/validator.priv ]; then
# sawadm keygen &&
# sawtooth keygen my_key &&
# cp /root/.sawtooth/keys/my_key.* /grid-shared &&
# sawset genesis -k /root/.sawtooth/keys/my_key.priv &&
# sawset proposal create \
# -k /root/.sawtooth/keys/my_key.priv \
# sawtooth.consensus.algorithm.name=Devmode \
# sawtooth.consensus.algorithm.version=0.1 \
# -o config.batch &&
# sawset proposal create \
# -k /root/.sawtooth/keys/my_key.priv \
# sawtooth.swa.administrators=$$(cat /grid-shared/my_key.pub) \
# -o sabre-admin.batch
# sawadm genesis config-genesis.batch config.batch sabre-admin.batch
# fi;
# sawtooth-validator -vv \
# --endpoint tcp://sawtooth-validator:8800 \
# --bind component:tcp://eth0:4004 \
# --bind network:tcp://eth0:8800 \
# --bind consensus:tcp://eth0:5050
# "
# stop_signal: SIGKILL
# # sawtooth-validator:
# # image: hyperledger/sawtooth-validator:latest
# # volumes:
# # - grid-shared:/grid-shared
# # container_name: sawtooth-validator
# # expose:
# # - 4004
# # - 8800
# # - 5050
# # ports:
# # - "4004:4004"
# # # start the validator with an empty genesis batch
# # command: |
# # bash -c "
# # if [ ! -f /etc/sawtooth/keys/validator.priv ]; then
# # sawadm keygen &&
# # sawtooth keygen my_key &&
# # cp /root/.sawtooth/keys/my_key.* /grid-shared &&
# # sawset genesis -k /root/.sawtooth/keys/my_key.priv &&
# # sawset proposal create \
# # -k /root/.sawtooth/keys/my_key.priv \
# # sawtooth.consensus.algorithm.name=pbft \
# # sawtooth.consensus.algorithm.version=1.0 \
# # sawtooth.consensus.pbft.members=\\['\"'$$(cat /grid-shared/my_key.pub)'\"'] \
# # sawtooth.swa.administrators=$$(cat /grid-shared/my_key.pub) \
# # sawtooth.publisher.max_batches_per_block=1200 \
# # -o sabre-admin.batch
# # -o config.batch
# # sawadm genesis config-genesis.batch sabre-admin.batch
# # fi &&
# # if [ ! -e /var/lib/sawtooth/genesis.batch ]; then
# # sawadm genesis config-genesis.batch config.batch
# # fi &&
# # if [ ! -e /root/.sawtooth/keys/my_key.priv ]; then
# # sawtooth keygen my_key
# # fi &&
# # sawtooth-validator -vv \
# # --endpoint tcp://sawtooth-validator:8800 \
# # --bind component:tcp://eth0:4004 \
# # --bind network:tcp://eth0:8800 \
# # --bind consensus:tcp://eth0:5050 \
# # --scheduler parallel \
# # --peering static \
# # --maximum-peer-connectivity 10000
# # "
# # stop_signal: SIGKILL
# # sawtooth-validator:
# # image: hyperledger/sawtooth-validator:latest
# # container_name: sawtooth-validator
# # expose:
# # - 4004
# # - 5050
# # - 8800
# # ports:
# # - "4004:4004"
# # volumes:
# # - grid-shared:/grid-shared
# # command: |
# # bash -c "
# # if [ -e /grid-shared/validators/sawtooth-validator.priv ]; then
# # cp /grid-shared/validators/sawtooth-validator.pub /etc/sawtooth/keys/validator.pub
# # cp /grid-shared/validators/sawtooth-validator.priv /etc/sawtooth/keys/validator.priv
# # fi &&
# # if [ ! -e /etc/sawtooth/keys/validator.priv ]; then
# # sawadm keygen
# # mkdir -p /grid-shared/validators || true
# # cp /etc/sawtooth/keys/validator.pub /grid-shared/validators/sawtooth-validator.pub
# # cp /etc/sawtooth/keys/validator.priv /grid-shared/validators/sawtooth-validator.priv
# # fi &&
# # if [ ! -e config-genesis.batch ]; then
# # sawset genesis -k /etc/sawtooth/keys/validator.priv -o config-genesis.batch
# # fi &&
# # if [ ! -e config.batch ]; then
# # sawset proposal create \
# # -k /etc/sawtooth/keys/validator.priv \
# # sawtooth.swa.administrators=$$(cat /grid-shared/validators/sawtooth-validator.pub) \
# # sawtooth.consensus.algorithm.name=pbft \
# # sawtooth.consensus.algorithm.version=1.0 \
# # sawtooth.identity.allowed_keys=$$(cat /pbft-shared/validators/validator-0.pub) \
# # sawtooth.swa.administrators=$$(cat /pbft-shared/validators/validator-0.pub) \
# # sawtooth.consensus.pbft.members=\\['\"'$$(cat /grid-shared/validators/sawtooth-validator.pub)'\"'] \
# # sawtooth.publisher.max_batches_per_block=1200 \
# # -o config.batch
# # fi &&
# # if [ ! -e /var/lib/sawtooth/genesis.batch ]; then
# # sawadm genesis config-genesis.batch config.batch
# # fi &&
# # if [ ! -e /root/.sawtooth/keys/my_key.priv ]; then
# # sawtooth keygen my_key
# # fi &&
# # sawtooth-validator -vv \
# # --endpoint tcp://validator-0:8800 \
# # --bind component:tcp://eth0:4004 \
# # --bind consensus:tcp://eth0:5050 \
# # --bind network:tcp://eth0:8800 \
# # --scheduler parallel \
# # --peering static \
# # --maximum-peer-connectivity 10000
# # "
# # validator-1:
# # image: hyperledger/sawtooth-validator:nightly
# # container_name: sawtooth-validator-1
# # expose:
# # - 4004
# # - 8800
# # - 5050
# # # ports:
# # # - "4004:4004"
# # volumes:
# # - grid-shared:/grid-shared
# # # start the validator with an empty genesis batch
# # command: |
# # bash -c "
# # if [ -e /grid-shared/validators/validator-1.priv ]; then
# # cp /grid-shared/validators/validator-1.pub /etc/sawtooth/keys/validator.pub
# # cp /grid-shared/validators/validator-1.priv /etc/sawtooth/keys/validator.priv
# # fi &&
# # if [ ! -e /etc/sawtooth/keys/validator.priv ]; then
# # sawadm keygen
# # mkdir -p /grid-shared/validators || true
# # cp /etc/sawtooth/keys/validator.pub /grid-shared/validators/validator-1.pub
# # cp /etc/sawtooth/keys/validator.priv /grid-shared/validators/validator-1.priv
# # fi &&
# # sawtooth keygen my_key &&
# # sawtooth-validator -vv \
# # --endpoint tcp://validator-1:8800 \
# # --bind component:tcp://eth0:4004 \
# # --bind consensus:tcp://eth0:5050 \
# # --bind network:tcp://eth0:8800 \
# # --scheduler parallel \
# # --peering static \
# # --maximum-peer-connectivity 10000 \
# # --peers tcp://sawtooth-validator:8800
# # "
# # sawtooth-validator2:
# # image: hyperledger/sawtooth-validator:latest
# # volumes:
# # - grid-shared:/grid-shared
# # container_name: sawtooth-validator-2
# # expose:
# # - 4004
# # - 8800
# # - 5050
# # # ports:
# # # - "4002:4004"
# # # start the validator with an empty genesis batch
# # command: |
# # bash -c "
# # if [ ! -f /grid-shared/my_key2.priv ]; then
# # cp /grid-shared/my_key2.pub /etc/sawtooth/key/validator2.pub
# # cp /grid-shared/my_key2.priv /etc/sawtooth/key/validator2.priv
# # fi &&
# # if [ ! -e /etc/sawtooth/keys/validator2.priv ]; then
# # sawadm keygen
# # mkdir /grid-shared || true
# # cp /etc/sawtooth/keys/validator2.pub /grid-shared/validator-2.pub
# # cp /etc/sawtooth/keys/validator2.priv /grid-shared/validator-2.priv
# # fi &&
# # sawtooth keygen my_key2 &&
# # sawtooth-validator -vv \
# # --endpoint tcp://sawtooth-validator2:8800 \
# # --bind component:tcp://eth0:4004 \
# # --bind network:tcp://eth0:8800 \
# # --bind consensus:tcp://eth0:5050 \
# # --scheduler parallel \
# # --peering static \
# # --maximum-peer-connectivity 10000 \
# # --peers tcp://sawtooth-validator:8800 \
# # --peers tcp://sawtooth-validator1:8800
# # "
# # stop_signal: SIGKILL
# # sawtooth-validator3:
# # image: hyperledger/sawtooth-validator:latest
# # volumes:
# # - grid-shared:/grid-shared
# # container_name: sawtooth-validator-3
# # expose:
# # - 4004
# # - 8800
# # - 5050
# # # ports:
# # # - "4001:4004"
# # # start the validator with an empty genesis batch
# # command: |
# # bash -c "
# # if [ ! -f /grid-shared/my_key3.priv ]; then
# # cp /grid-shared/my_key3.pub /etc/sawtooth/key/validator3.pub
# # cp /grid-shared/my_key3.priv /etc/sawtooth/key/validator3.priv
# # fi &&
# # if [ ! -e /etc/sawtooth/keys/validator3.priv ]; then
# # sawadm keygen
# # mkdir /grid-shared || true
# # cp /etc/sawtooth/keys/validator3.pub /grid-shared/validator-3.pub
# # cp /etc/sawtooth/keys/validator3.priv /grid-shared/validator-3.priv
# # fi &&
# # sawtooth keygen my_key3 &&
# # sawtooth-validator -vv \
# # --endpoint tcp://sawtooth-validator3:8800 \
# # --bind component:tcp://eth0:4004 \
# # --bind network:tcp://eth0:8800 \
# # --bind consensus:tcp://eth0:5050 \
# # --scheduler parallel \
# # --peering static \
# # --maximum-peer-connectivity 10000 \
# # --peers tcp://sawtooth-validator:8800 \
# # --peers tcp://sawtooth-validator1:8800 \
# # --peers tcp://sawtooth-validator2:8800
# # "
# # stop_signal: SIGKILL
# # sawtooth-validator4:
# # image: hyperledger/sawtooth-validator:latest
# # volumes:
# # - grid-shared:/grid-shared
# # container_name: sawtooth-validator-4
# # expose:
# # - 4004
# # - 8800
# # - 5050
# # # ports:
# # # - "4005:4004"
# # # start the validator with an empty genesis batch
# # command: |
# # bash -c "
# # if [ ! -f /grid-shared/my_key4.priv ]; then
# # cp /grid-shared/my_key4.pub /etc/sawtooth/key/validator4.pub
# # cp /grid-shared/my_key4.priv /etc/sawtooth/key/validator4.priv
# # fi &&
# # if [ ! -e /etc/sawtooth/keys/validator4.priv ]; then
# # sawadm keygen
# # mkdir /grid-shared || true
# # cp /etc/sawtooth/keys/validator4.pub /grid-shared/validator-4.pub
# # cp /etc/sawtooth/keys/validator4.priv /grid-shared/validator-4.priv
# # fi &&
# # sawtooth keygen my_key4 &&
# # sawtooth-validator -vv \
# # --endpoint tcp://sawtooth-validator4:8800 \
# # --bind component:tcp://eth0:4004 \
# # --bind network:tcp://eth0:8800 \
# # --bind consensus:tcp://eth0:5050 \
# # --scheduler parallel \
# # --peering static \
# # --maximum-peer-connectivity 10000
# # --peers tcp://sawtooth-validator:8800
# # --peers tcp://sawtooth-validator1:8800
# # --peers tcp://sawtooth-validator2:8800
# # --peers tcp://sawtooth-validator3:8800
# # "
# # stop_signal: SIGKILL
# # sawtooth-rest-api:
# # image: hyperledger/sawtooth-rest-api:nightly
# # container_name: sawtooth-rest-api
# # ports:
# # - "8008:8008"
# # depends_on:
# # - sawtooth-validator
# # command: |
# # bash -c "
# # sawtooth-rest-api -v --connect tcp://sawtooth-validator:4004 --bind sawtooth-validator:8008
# # "
# # stop_signal: SIGKILL
# rest-api-0:
# image: hyperledger/sawtooth-rest-api:nightly
# container_name: sawtooth-rest-api-default-0
# expose:
# - 8008
# command: |
# bash -c "
# sawtooth-rest-api \
# --connect tcp://sawtooth-validator:4004 \
# --bind rest-api-0:8008
# "
# stop_signal: SIGKILL
# # sawtooth-rest-api1:
# # image: hyperledger/sawtooth-rest-api:latest
# # container_name: sawtooth-rest-api-1
# # ports:
# # - "1111:8008"
# # depends_on:
# # - sawtooth-validator
# # command: |
# # bash -c "
# # sawtooth-rest-api1 -v --connect tcp://sawtooth-validator1:4004 --bind sawtooth-validator1:8008
# # "
# # stop_signal: SIGKILL
# # sawtooth-rest-api2:
# # image: hyperledger/sawtooth-rest-api:latest
# # container_name: sawtooth-rest-api-2
# # ports:
# # - "1112:8008"
# # depends_on:
# # - sawtooth-validator
# # command: |
# # bash -c "
# # sawtooth-rest-api2 -v --connect tcp://sawtooth-validator2:4004 --bind sawtooth-validator2:8008
# # "
# # stop_signal: SIGKILL
# # sawtooth-rest-api3:
# # image: hyperledger/sawtooth-rest-api:latest
# # container_name: sawtooth-rest-api-3
# # ports:
# # - "1113:8008"
# # depends_on:
# # - sawtooth-validator
# # command: |
# # bash -c "
# # sawtooth-rest-api3 -v --connect tcp://sawtooth-validator3:4004 --bind sawtooth-validator3:8008
# # "
# # stop_signal: SIGKILL
# # sawtooth-rest-api4:
# # image: hyperledger/sawtooth-rest-api:latest
# # container_name: sawtooth-rest-api-4
# # ports:
# # - "1114:8008"
# # depends_on:
# # - sawtooth-validator
# # command: |
# # bash -c "
# # sawtooth-rest-api4 -v --connect tcp://sawtooth-validator4:4004 --bind sawtooth-validator4:8008
# # "
# # stop_signal: SIGKILL
# sawtooth-settings-tp:
# image: hyperledger/sawtooth-settings-tp:latest
# container_name: sawtooth-settings-tp
# expose:
# - 4004
# command: settings-tp -v -C tcp://sawtooth-validator:4004
# stop_signal: SIGKILL
# sawtooth-settings-tp-1:
# image: hyperledger/sawtooth-settings-tp:latest
# container_name: sawtooth-settings-tp-1
# expose:
# - 4004
# command: settings-tp -v -C tcp://validator-1::4004
# stop_signal: SIGKILL
# # sabre-tp:
# # image: hyperledger/sawtooth-sabre-tp:0.8
# # container_name: sawtooth-sabre-tp
# # depends_on:
# # - sawtooth-validator
# # entrypoint: sawtooth-sabre -vv --connect tcp://sawtooth-validator:4004
# sawtooth-client:
# image: hyperledger/sawtooth-shell:nightly
# container_name: sawtooth-shell
# volumes:
# - grid-shared:/grid-shared
# depends_on:
# - sawtooth-validator
# command: |
# bash -c "
# sawtooth keygen &&
# tail -f /dev/null
# "
# stop_signal: SIGKILL
# # pbft-0:
# # image: hyperledger/sawtooth-pbft-engine:nightly
# # container_name: sawtooth-pbft-engine-default-0
# # depends_on:
# # - sawtooth-validator
# # command: pbft-engine -vv --connect tcp://sawtooth-validator:5050
# # stop_signal: SIGKILL
# # pbft-1:
# # image: hyperledger/sawtooth-pbft-engine:nightly
# # container_name: sawtooth-pbft-engine-default-1
# # command: pbft-engine -vv --connect tcp://validator-1:5050
# # stop_signal: SIGKILL
# # pbft-2:
# # image: hyperledger/sawtooth-pbft-engine:nightly
# # container_name: sawtooth-pbft-engine-default-2
# # command: pbft-engine -vv --connect tcp://sawtooth-validator2:5050
# # stop_signal: SIGKILL
# # pbft-3:
# # image: hyperledger/sawtooth-pbft-engine:nightly
# # container_name: sawtooth-pbft-engine-default-3
# # command: pbft-engine -vv --connect tcp://sawtooth-validator3:5050
# # stop_signal: SIGKILL
# # pbft-4:
# # image: hyperledger/sawtooth-pbft-engine:nightly
# # container_name: sawtooth-pbft-engine-default-4
# # command: pbft-engine -vv --connect tcp://sawtooth-validator4:5050
# # stop_signal: SIGKILL
# devmode-rust:
# image: hyperledger/sawtooth-devmode-engine-rust:nightly
# container_name: sawtooth-devmode-engine-rust
# depends_on:
# - sawtooth-validator
# command: |
# devmode-engine-rust -vv --connect tcp://sawtooth-validator:5050
# stop_signal: SIGKILL
# # devmode-engine:
# # image: hyperledger/sawtooth-devmode-engine-rust:chime
# # container_name: sawtooth-devmode-engine-rust-default
# # depends_on:
# # - sawtooth-validator
# # entrypoint: devmode-engine-rust -C tcp://sawtooth-validator:5050
# # ---== alpha node ==---
# # db-alpha:
# # image: postgres
# # container_name: db-alpha
# # hostname: db-alpha
# # restart: always
# # expose:
# # - 5432
# # environment:
# # POSTGRES_USER: grid
# # POSTGRES_PASSWORD: grid_example
# # POSTGRES_DB: grid
# # gridd-alpha:
# # image: gridd
# # container_name: gridd-alpha
# # hostname: gridd-alpha
# # build:
# # context: ../..
# # dockerfile: daemon/Dockerfile
# # args:
# # - REPO_VERSION=${REPO_VERSION}
# # - CARGO_ARGS= --features experimental
# # volumes:
# # - contracts-shared:/usr/share/scar
# # - grid-shared:/grid-shared
# # - gridd-alpha:/etc/grid/keys
# # - cache-shared:/var/cache/grid
# # expose:
# # - 8080
# # ports:
# # - "8080:8080"
# # environment:
# # GRID_DAEMON_KEY: "alpha-agent"
# # GRID_DAEMON_ENDPOINT: "http://gridd-alpha:8080"
# # entrypoint: |
# # bash -c "
# # # we need to wait for the db to have started.
# # until PGPASSWORD=grid_example psql -h db-alpha -U grid -c '\q' > /dev/null 2>&1; do
# # >&2 echo \"Database is unavailable - sleeping\"
# # sleep 1
# # done
# # grid keygen --skip && \
# # grid keygen --system --skip && \
# # grid -vv database migrate \
# # -C postgres://grid:grid_example@db-alpha/grid &&
# # gridd -vv -b 0.0.0.0:8080 -k root -C tcp://sawtooth-validator:4004 \
# # --database-url postgres://grid:grid_example@db-alpha/grid
# # "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment