naviat
8/9/2018 - 10:07 AM

Sawtooth-Multi-Node

Sawtooth-Multi-Node

version: "2.1"

services:

  settings-tp:
    image: hyperledger/sawtooth-settings-tp:1.0
    container_name: sawtooth-settings-tp-default
    depends_on:
      - validator
    entrypoint: settings-tp -vv -C tcp://validator:4004

  intkey-tp-python:
    image: hyperledger/sawtooth-intkey-tp-python:1.0
    container_name: sawtooth-intkey-tp-python-default
    depends_on:
      - validator
    entrypoint: intkey-tp-python -vv -C tcp://validator:4004

  xo-tp-python:
    image: hyperledger/sawtooth-xo-tp-python:1.0
    container_name: sawtooth-xo-tp-python-default
    depends_on:
      - validator
    entrypoint: xo-tp-python -vv -C tcp://validator:4004

  validator:
    image: hyperledger/sawtooth-validator:1.0
    container_name: sawtooth-validator-default
    expose:
      - 4004
    ports:
      - "4004:4004"

    volumes:
      - $HOME/sawtooth/data:/var/lib/sawtooth
      - $HOME/sawtooth/keys:/root/.sawtooth/keys
    # start the validator with an empty genesis batch
    entrypoint: "bash -c \"\
        sawadm keygen && \
        test -f /root/.sawtooth/keys/genesis_key.priv || (sawtooth keygen genesis_key && \
        sawset genesis -k /root/.sawtooth/keys/genesis_key.priv && \
        sawadm genesis config-genesis.batch) && \
        sawtooth-validator -vv \
          --endpoint tcp://validator:8800 \
          --bind component:tcp://eth0:4004 \
          --bind network:tcp://eth0:8800 \
          --peers tcp://validator2:8800,tcp://validator3:8800 \
        \""

  rest-api:
    image: hyperledger/sawtooth-rest-api:1.0
    container_name: sawtooth-rest-api-default
    ports:
      - "8008:8008"
    depends_on:
      - validator
    entrypoint: sawtooth-rest-api -C tcp://validator:4004 --bind rest-api:8008


  shell:
    image: hyperledger/sawtooth-all:1.0
    container_name: sawtooth-shell-default
    depends_on:
      - rest-api
    entrypoint: "bash -c \"\
        sawtooth keygen && \
        tail -f /dev/null \
        \""

  settings-tp2:
    image: hyperledger/sawtooth-settings-tp:1.0
    container_name: sawtooth-settings-tp2-default
    depends_on:
      - validator2
    entrypoint: settings-tp -vv -C tcp://validator2:4004

  intkey-tp-python2:
    image: hyperledger/sawtooth-intkey-tp-python:1.0
    container_name: sawtooth-intkey-tp-python2-default
    depends_on:
      - validator2
    entrypoint: intkey-tp-python -vv -C tcp://validator2:4004

  xo-tp-python2:
    image: hyperledger/sawtooth-xo-tp-python:1.0
    container_name: sawtooth-xo-tp-python2-default
    depends_on:
      - validator2
    entrypoint: xo-tp-python -vv -C tcp://validator2:4004

  validator2:
    image: hyperledger/sawtooth-validator:1.0
    container_name: sawtooth-validator2-default
    expose:
      - 4004
    ports:
      - "4005:4004"
    volumes:
      - $HOME/sawtooth/data2:/var/lib/sawtooth
      - $HOME/sawtooth/keys2:/root/.sawtooth/keys
    # start the validator with an empty genesis batch
    entrypoint: "bash -c \"\
        sawadm keygen && \
        sawtooth-validator -vv \
          --endpoint tcp://validator2:8800 \
          --bind component:tcp://eth0:4004 \
          --bind network:tcp://eth0:8800 \
          --peers tcp://validator:8800,tcp://validator3:8800 \
        \""

  rest-api2:
    image: hyperledger/sawtooth-rest-api:1.0
    container_name: sawtooth-rest-api2-default
    ports:
      - "8009:8008"
    depends_on:
      - validator2
    entrypoint: sawtooth-rest-api -C tcp://validator2:4004 --bind rest-api2:8008


  settings-tp3:
    image: hyperledger/sawtooth-settings-tp:1.0
    container_name: sawtooth-settings-tp3-default
    depends_on:
      - validator3
    entrypoint: settings-tp -vv -C tcp://validator3:4004

  intkey-tp-python3:
    image: hyperledger/sawtooth-intkey-tp-python:1.0
    container_name: sawtooth-intkey-tp-python3-default
    depends_on:
      - validator3
    entrypoint: intkey-tp-python -vv -C tcp://validator3:4004

  xo-tp-python3:
    image: hyperledger/sawtooth-xo-tp-python:1.0
    container_name: sawtooth-xo-tp-python3-default
    depends_on:
      - validator3
    entrypoint: xo-tp-python -vv -C tcp://validator3:4004

  validator3:
    image: hyperledger/sawtooth-validator:1.0
    container_name: sawtooth-validator3-default
    expose:
      - 4004
    ports:
      - "4006:4004"
    volumes:
      - $HOME/sawtooth/data3:/var/lib/sawtooth
      - $HOME/sawtooth/keys3:/root/.sawtooth/keys
    # start the validator with an empty genesis batch
    entrypoint: "bash -c \"\
        sawadm keygen && \
        sawtooth-validator -vv \
          --endpoint tcp://validator3:8800 \
          --bind component:tcp://eth0:4004 \
          --bind network:tcp://eth0:8800 \
          --peers tcp://validator:8800,tcp://validator2:8800 \
        \""

  rest-api3:
    image: hyperledger/sawtooth-rest-api:1.0
    container_name: sawtooth-rest-api3-default
    ports:
      - "8010:8008"
    depends_on:
      - validator3
    entrypoint: sawtooth-rest-api -C tcp://validator3:4004 --bind rest-api3:8008