I tried to spin up a graphql environment from snapshot, but I failed. From genesis no problem, but it will take uncountable days to sync to 100%. So I tried to start with a snapshot.
This is how I start it:
#!/bin/bash
DOCKER_BUILDKIT=1 \
COMPOSE_DOCKER_CLI_BUILD=1 \
CHAIN_FOLLOWER_START_SLOT=23068800 \
CHAIN_FOLLOWER_START_ID=a650a3f398ba4a9427ec8c293e9f7156d81fd2f7ca849014d8d2c1156c359b3a \
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.4/db-sync-snapshot-schema-13.4-block-10717727-x86_64.tgz \
docker compose up -d --build
docker-compose.yml (just cardano-db-syn part)
cardano-db-sync:
platform: linux/x86_64
image: ghcr.io/intersectmbo/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.3.0.0}
command: [
"--config", "/config/cardano-db-sync/config.json",
"--socket-path", "/node-ipc/node.socket"
]
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
- RESTORE_SNAPSHOT=${RESTORE_SNAPSHOT:-}
- RESTORE_RECREATE_DB=Y
depends_on:
- cardano-node
- postgres
secrets:
- postgres_password
- postgres_user
- postgres_db
volumes:
- ./config/network/${NETWORK:-mainnet}:/config
- /workspace/db-sync-sync/:/var/lib/cexplorer
- /workspace/cardano-node-sync/socket:/node-ipc
restart: on-failure
stop_signal: SIGINT
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
Error from cardano-db-sync container:
Downloading snapshot https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.4/db-sync-snapshot-schema-13.4-block-10717727-x86_64.tgz
db-sync-snapshot-schema-13.4-block-10717727-x86_64.tgz: OK
ERROR: cannot drop objects owned by role graphql because they are required by the database system
What do I have to do to ensure that the sync runs smoothly and I don’t get any more errors?