Setup local Docker EOS "nodeos" container. Process running fine.

docker run \
--name nodeos -d -p 8888:8888 \
--network eosdev \
-v /tmp/eosio/work:/work \
-v /tmp/eosio/data:/mnt/dev/data \
-v /tmp/eosio/config:/mnt/dev/config \
eosio/eos-dev \
/bin/bash -c \
"nodeos -e -p eosio \
--plugin eosio::producer_plugin \
--plugin eosio::history_plugin \
--plugin eosio::chain_api_plugin \
--plugin eosio::history_api_plugin \
--plugin eosio::http_plugin \
-d /mnt/dev/data \
--config-dir /mnt/dev/config \
--http-server-address=0.0.0.0:8888 \
--access-control-allow-origin=* \
--contracts-console \
--http-validate-host=false"

Container is created and running fine.

I want to replay the blockchain as changed the config in the container.

Having difficulty to use --replay-blockchain with docker start <container_id> command because container is already created and I do not want to re-create the container but still want to replay the blockchain.

If you posted the error, it would help.

You may need to hard replay:

docker run \
  --name nodeos -d -p 8888:8888 \
  --network eosdev \
  -v /tmp/eosio/work:/work \
  -v /tmp/eosio/data:/mnt/dev/data \
  -v /tmp/eosio/config:/mnt/dev/config \
  eosio/eos-dev \
/bin/bash -c \
  "nodeos -e -p eosio \
    --plugin eosio::producer_plugin \
    --plugin eosio::history_plugin \
    --plugin eosio::chain_api_plugin \
    --plugin eosio::history_api_plugin \
    --plugin eosio::http_plugin \
    -d /mnt/dev/data \
    --config-dir /mnt/dev/config \
    --http-server-address=0.0.0.0:8888 \
    --access-control-allow-origin=* \
    --contracts-console \
    --http-validate-host=false
    --hard-replay-blockchain"

If hard replay does not work, you may need to delete all blocks.

See differences:

  --replay-blockchain                   clear chain state database and replay
                                        all blocks
  --hard-replay-blockchain              clear chain state database, recover as
                                        many blocks as possible from the block
                                        log, and then replay those blocks
  --delete-all-blocks                   clear chain state database and block
                                        log
  • Thats helps, my issues is, I already have container created which I created without above flags. Now I want to use --reply-blockchain flag. I guess it more docker related then EOS – VJV Dec 6 at 16:37
  • You can just use the docker command I provided, it has the replay command at the end. – Nat Dec 6 at 22:50
  • You need to understand, your docker command will create a new container. I know this solution. I want to reply the blockchain which is already running in existing container. – VJV Dec 7 at 6:38
  • Ah I see. According to the docker docs, you would run docker stop [OPTIONS] CONTAINER [CONTAINER...] or docker stop nodeos to stop running the container. This is also how docker is handled in github.com/EOSIO/eosio-project-demux-example docker stop eosio_blog_container. To restart, the demux example says to run docker run --rm --name [CONTAINER] -d..., you can see here: github.com/EOSIO/eosio-project-demux-example/blob/master/… – Nat Dec 7 at 11:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.