0

We are using docker-compose with persistent volume to start sawtooth-validator with sawtooth-pbft and other TPs .We are using a persistent volume for the same , so that it can be used for backup. Here is our yaml for the same

validator:
    build: validator/.
    image: hyperledger/sawtooth-validator:1.1.5
    container_name: sawtooth-validator
    expose:
      - 4004
      - 5050
      - 8800
    volumes:
      - volume1:/var/lib/sawtooth/
      - keys:/etc/sawtooth/keys
    ports:
      - "8800:8800"
    command: |
      bash -c "        
        sawtooth-validator -vv \
      "

Now when we start the docker-compose with the -d (docker-compose up -d )option, it doesn't take any new transactions. But if we do the same without the -d option (docker-compose up) it works fine . What may be the cause of the issue ? why docker-compose behaves differently with -d option?

To me , It looks like the validator is not able to get validate the new incoming blocks say x beacause it is not able to get the block x-1 from the persistent volume in the detached mode ? Which it is able to do in the normal mode. Is there some permission difference between detached mode and normal mode?

1 Answers1

0

My validator code:

  validator:
    image: hyperledger/sawtooth-validator:1.1
    container_name: validator
    expose:
      - 4004
    ports:
      - "4004:4004"
    entrypoint: |
      bash -c "
        if [ ! -f /etc/sawtooth/keys/validator.priv ]; then
          sawadm keygen &&
          sawtooth keygen my_key &&
          sawset genesis -k /root/.sawtooth/keys/my_key.priv &&
          sawadm genesis config-genesis.batch
        fi;
        sawtooth-validator -v \
          --endpoint tcp://validator:8800 \
          --bind component:tcp://eth0:4004 \
          --bind network:tcp://eth0:8800 \
          --bind consensus:tcp://eth0:5050
      "
    volumes:
      - ./database/bcdata/data:/var/lib/sawtooth
      - ./database/bcdata/keys:/etc/sawtooth/keys
      - ./database/bcdata/userKeys:/root/.sawtooth/keys
      - ./database/bcdata/logs:/var/log/sawtooth

Hope this works for you ;)