Persistant FHEVM native blockchain

Hi,
I wonder if it’s possible to have a persistant fhevm native blockchain, based on the docker compose at fhevm-devops release 0.5.x ?
I’ve played around with the docker-compose file, fhevm-devops/docker-compose/docker-compose-full.yml especially with the fhevm validator container :

fhevm-validator:
    environment:
      - TFHE_EXECUTOR_CONTRACT_ADDRESS=0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c
    image: ghcr.io/zama-ai/ethermint-dev-node:v0.5.1-2
    ports:
      - "26656-26657:26656-26657"
      - "8545-8546:8545-8546"
    volumes:
      - $PWD/network-fhe-keys:/network-fhe-keys:Z
      - ../setup.sh:/config/setup.sh:Z
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: "curl -s -H \"Connection: Upgrade\" -H \"Upgrade: websocket\"  http://localhost:8546"
      interval: 5s
      timeout: 3s
      retries: 5
      start_period: 20s

I’m no expert in docker, I’ve tried to create a persistant volume for the fhevm-validator image (mirroring /root/.ethermintd in the container, that’s where the validator store blockchain data) but it fails on second startup (when I try to restart the fhevm-native chain where it stopped).

- $PWD/blockchain_data:/root/.ethermintd:Z # Added volume mapping for blockchain data

It looks like the docker image of the validator is setup to execute genesis at startup.
I’ve also tried to play with setup.sh and even removing it from the docker image, by commenting the line

 - ../setup.sh:/config/setup.sh:Z

In the docker compose, the fhevm-validator still fails at startup.

I’m maybe missing something, but I feel like this repo was not meant to be persistant, it’s better for dev purpose to start on a fresh setup everytime you restart the docker containers.
However I wanted to know if it’s possible.

PS : I know the fhevm-devops repo 0.5.x is “deprecated” and that it will be probably easier to achieve persistance using a classic EVM L1 and the coprocessor docker, but I’m still interested in FHEVM-native blockchain.

Thanks !

Hello!
This image is for dev purpose but you can try with ethermint-node v0.5.1-2 instead.

Thank you very much, looks like this image is fine for what I want.

I was able to restart block mining at a non 0 height.

The process is a bit sketchy at the moment :
I’m starting a clean environment with the dev node image, it starts at genesis.
When this original chain, started with the dev node image, is stopped, I switch with the image you provided me before restarting it.
The new validator then starts well and does its job by resuming at a non 0 block height.

For the moment I’m not able to use the faucet on the non-dev node image (after restarting the chain).

INFO: global keys aren't initialized automatically (FHEVM_GO_KEYS_DIR env variable not set)

I’ll try to pass some environment variables to the container or make it execute a script before starting the validator.

I’m looking into it and will come back here if I need further help.
Thanks again for sharing this image !