TransWikia.com

How to run nodeos consistently even when dirty flag is set?

EOS.IO Asked by Tigran Sahakyan on August 20, 2021

Here is my chain of invocation

npm run compose:up -> ./start_compose.sh -> docker-compose -f compose.yml up

package.json

...
"compose:up": "concurrently -n "DOCKER" "cd packages && ./start-compose.sh --build",
...

start_compose.sh

...
docker-compose -f docker-compose.dev.yml up
...

docker-compose.dev.yml

...
  eosio-live:
    image: my-eosio:dev
    container_name: eosio-live
    tty: true
    build:
      context: ./eosio-live/
      dockerfile: dev.Dockerfile
    ports:
      - '5555:5555'
      - '8888:8888'
    networks:
      - dev-local-network
    volumes:
      - ./eosio-live/:/eosio
    restart: unless-stopped
...

dev.Dockerfile

FROM eostudio/eos:v2.0.5

ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

CMD ["/bin/bash", "-c", "exec nodeos -e -p eosio --plugin eosio::http_plugin --plugin eosio::chain_plugin --plugin eosio::chain_api_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --data-dir /eosio/data --config-dir /eosio/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --http-validate-host=false --max-transaction-time=200 --disable-replay-opts --contracts-console --filter-on=* --filter-out=eosio:onblock: >> /eosio/nodeos.log 2>&1 " ]

When I stop Docker containers by Ctrl+C, dirty flag is set.
I tried to add —hard-replay-blockchain option, but it causes problem for the very first run when there is no data/DB.

I tried --replay-blockchain, it does not resolve dirty flag.

Does anyone know any option/solution to the dirty flag that works for the first, second and further runs ?

One Answer

my solution is to propagate SIGINT to the child process in start_compose.sh bash script using trap and wait.
Look at this

Answered by Tigran Sahakyan on August 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP