0

This is how I started docker run, but cardano-graphql_cardano-graphql_1 keeps restarting due to this error related with 1589369664961_init/up.sql.

DOCKER_BUILDKIT=1 \
COMPOSE_DOCKER_CLI_BUILD=1 \
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13/db-sync-snapshot-schema-13-block-7560650-x86_64.tgz \
docker-compose up -d --build &&\
docker-compose logs -f

docker ps result:

CONTAINER ID   IMAGE                                                 COMMAND                  CREATED        STATUS          PORTS                                                                       NAMES
550b5a0b3d00   inputoutput/cardano-db-sync:12.0.0                    "/nix/store/5ghw8rqx…"   18 hours ago   Up 18 hours                                                                                 cardano-graphql_cardano-db-sync-extended_1
0556554a09e6   inputoutput/cardano-graphql-hasura:6.2.0              "docker-entrypoint.s…"   18 hours ago   Up 18 hours     0.0.0.0:8090->8080/tcp, :::8090->8080/tcp                                   cardano-graphql_hasura_1
7dc02c06cf4e   inputoutput/cardano-graphql:6.2.0-mainnet             "node index.js"          18 hours ago   Up 56 seconds   0.0.0.0:3100->3100/tcp, :::3100->3100/tcp                                   cardano-graphql_cardano-graphql_1
6b1e7a19e0d6   postgres:11.5-alpine                                  "docker-entrypoint.s…"   18 hours ago   Up 18 hours     0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                   cardano-graphql_postgres_1
6c35c01400ee   cardanosolutions/cardano-node-ogmios:v5.1.0-mainnet   "bash cardano-node-o…"   18 hours ago   Up 18 hours     3000/tcp, 12788/tcp, 0.0.0.0:1337->1337/tcp, :::1337->1337/tcp, 12798/tcp   cardano-graphql_cardano-node-ogmios_1

Logs of cardano-graphql_cardano-graphql_1:

{"name":"cardano-graphql","hostname":"7dc02c06cf4e","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2022-08-03T06:59:29.716Z","v":0}
{"name":"cardano-graphql","hostname":"7dc02c06cf4e","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2022-08-03T06:59:30.152Z","v":0}
{"name":"cardano-graphql","hostname":"7dc02c06cf4e","pid":1,"level":50,"msg":"Command failed: /usr/local/bin/hasura --skip-update-check --project /app/packages/api-cardano-db-hasura/hasura/project --endpoint http://hasura:8080 migrate apply --up all\ntime=\"2022-08-03T07:02:58Z\" level=fatal msg=\"apply failed: [postgres-error] query execution failed ($.args[0].args)\\r\\nFile: '1589369664961_init/up.sql'\\r\\n{\\n    \\\"check_metadata_consistency\\\": false,\\n    \\\"sql\\\": \\\"\\\\nCREATE VIEW \\\\\\\"AdaPots\\\\\\\" AS\\\\n  SELECT\\\\n    epoch_no AS \\\\\\\"epochNo\\\\\\\",\\\\n    deposits,\\\\n    fees,\\\\n    reserves,\\\\n    rewards,\\\\n    slot_no AS \\\\\\\"slotNo\\\\\\\",\\\\n    treasury,\\\\n    utxo\\\\nFROM ada_pots;\\\\n\\\\nCREATE TABLE IF NOT EXISTS \\\\\\\"Asset\\\\\\\" (\\\\n    \\\\\\\"assetId\\\\\\\" BYTEA PRIMARY KEY,\\\\n    \\\\\\\"assetName\\\\\\\" BYTEA,\\\\n    \\\\\\\"decimals\\\\\\\" INT,\\\\n    \\\\\\\"description\\\\\\\" VARCHAR(500),\\\\n    \\\\\\\"fingerprint\\\\\\\" CHAR(44),\\\\n    \\\\\\\"firstAppearedInSlot\\\\\\\" INT,\\\\n    \\\\\\\"logo\\\\\\\" VARCHAR(65536),\\\\n    \\\\\\\"metadataHash\\\\\\\" CHAR(40),\\\\n    \\\\\\\"name\\\\\\\" VARCHAR(50),\\\\n    \\\\\\\"policyId\\\\\\\" BYTEA,\\\\n    \\\\\\\"ticker\\\\\\\" VARCHAR(9),\\\\n    \\\\\\\"url\\\\\\\" VARCHAR(250)\\\\n);\\\\n\\\\nCREATE VIEW \\\\\\\"Block\\\\\\\" AS\\\\n SELECT (COALESCE(( SELECT sum((tx.fee)::bigint) AS sum\\\\n           FROM tx\\\\n          WHERE (tx.block_id = block.id)), (0)::NUMERIC))::bigint AS fees,\\\\n    block.hash,\\\\n    block.block_no AS \\\\\\\"number\\\\\\\",\\\\n    block.op_cert AS \\\\\\\"opCert\\\\\\\",\\\\n    previous_block.hash AS \\\\\\\"previousBlockHash\\\\\\\",\\\\n    next_block.hash AS \\\\\\\"nextBlockHash\\\\\\\",\\\\n    jsonb_build_object('major', block.proto_major, 'minor', block.proto_minor) AS \\\\\\\"protocolVersion\\\\\\\",\\\\n    block.size,\\\\n    block.tx_count AS \\\\\\\"transactionsCount\\\\\\\",\\\\n    block.epoch_no AS \\\\\\\"epochNo\\\\\\\",\\\\n    block.\\\\\\\"time\\\\\\\" AS \\\\\\\"forgedAt\\\\\\\",\\\\n    block.epoch_slot_no AS \\\\\\\"slotInEpoch\\\\\\\",\\\\n    block.slot_no AS \\\\\\\"slotNo\\\\\\\",\\\\n    slot_leader.id AS \\\\\\\"slot_leader_id\\\\\\\",\\\\n    slot_leader.pool_hash_id AS \\\\\\\"pool_hash_id\\\\\\\",\\\\n    block.vrf_key As \\\\\\\"vrfKey\\\\\\\"\\\\n   FROM (((block\\\\n     LEFT JOIN block previous_block ON ((block.previous_id = previous_block.id)))\\\\n     LEFT JOIN block next_block ON ((next_block.previous_id = block.id)))\\\\n     LEFT JOIN slot_leader ON ((block.slot_leader_id = slot_leader.id)));\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"Cardano\\\\\\\" AS\\\\n SELECT block.block_no AS \\\\\\\"tipBlockNo\\\\\\\",\\\\n    block.epoch_no AS \\\\\\\"currentEpochNo\\\\\\\"\\\\n   FROM block\\\\n  WHERE (block.block_no IS NOT NULL)\\\\n  ORDER BY block.block_no DESC\\\\n LIMIT 1;\\\\n \\\\nCREATE VIEW \\\\\\\"Collateral\\\\\\\" AS\\\\nSELECT\\\\n  source_tx_out.address,\\\\n  source_tx_out.value,\\\\n  tx.hash AS \\\\\\\"txHash\\\\\\\",\\\\n  source_tx.hash AS \\\\\\\"sourceTxHash\\\\\\\",\\\\n  collateral_tx_in.tx_out_index AS \\\\\\\"sourceTxIndex\\\\\\\",\\\\n  source_tx_out.id AS source_tx_out_id\\\\nFROM\\\\n  tx\\\\nJOIN collateral_tx_in\\\\n  ON collateral_tx_in.tx_in_id = tx.id\\\\nJOIN tx_out AS source_tx_out\\\\n  ON collateral_tx_in.tx_out_id = source_tx_out.tx_id\\\\n  AND collateral_tx_in.tx_out_index = source_tx_out.index\\\\nJOIN tx AS source_tx\\\\n  ON source_tx_out.tx_id = source_tx.id;\\\\n\\\\nCREATE VIEW \\\\\\\"Delegation\\\\\\\" AS\\\\nSELECT\\\\n  delegation.id AS \\\\\\\"id\\\\\\\",\\\\n  stake_address.view AS \\\\\\\"address\\\\\\\",\\\\n  delegation.redeemer_id AS \\\\\\\"redeemerId\\\\\\\",\\\\n  delegation.tx_id AS \\\\\\\"tx_id\\\\\\\",\\\\n  pool_hash_id AS \\\\\\\"pool_hash_id\\\\\\\"\\\\nFROM delegation\\\\nJOIN stake_address on delegation.addr_id = stake_address.id;\\\\n\\\\nCREATE VIEW \\\\\\\"Epoch\\\\\\\" AS\\\\nSELECT\\\\n  epoch.fees AS \\\\\\\"fees\\\\\\\",\\\\n  epoch.out_sum AS \\\\\\\"output\\\\\\\",\\\\n  epoch.no AS \\\\\\\"number\\\\\\\",\\\\n  epoch_param.nonce AS \\\\\\\"nonce\\\\\\\",\\\\n  epoch.tx_count AS \\\\\\\"transactionsCount\\\\\\\",\\\\n  epoch.start_time AS \\\\\\\"startedAt\\\\\\\",\\\\n  epoch.end_time AS \\\\\\\"lastBlockTime\\\\\\\",\\\\n  epoch.blk_count AS \\\\\\\"blocksCount\\\\\\\"\\\\nFROM epoch\\\\n  LEFT JOIN epoch_param on epoch.no = epoch_param.epoch_no;\\\\n\\\\nCREATE VIEW \\\\\\\"ShelleyEpochProtocolParams\\\\\\\" AS\\\\nSELECT\\\\n  epoch_param.influence AS \\\\\\\"a0\\\\\\\",\\\\n  epoch_param.coins_per_utxo_word AS \\\\\\\"coinsPerUtxoWord\\\\\\\",\\\\n  epoch_param.collateral_percent AS \\\\\\\"collateralPercent\\\\\\\",\\\\n  cost_model.costs AS \\\\\\\"costModels\\\\\\\",\\\\n  epoch_param.decentralisation AS \\\\\\\"decentralisationParam\\\\\\\",\\\\n  epoch_param.max_collateral_inputs AS \\\\\\\"maxCollateralInputs\\\\\\\",\\\\n  epoch_param.max_epoch AS \\\\\\\"eMax\\\\\\\",\\\\n  epoch_param.epoch_no AS \\\\\\\"epoch_no\\\\\\\",\\\\n  epoch_param.entropy AS \\\\\\\"extraEntropy\\\\\\\",\\\\n  epoch_param.key_deposit AS \\\\\\\"keyDeposit\\\\\\\",\\\\n  epoch_param.max_block_size AS \\\\\\\"maxBlockBodySize\\\\\\\",\\\\n  epoch_param.max_block_ex_mem AS \\\\\\\"maxBlockExMem\\\\\\\",\\\\n  epoch_param.max_block_ex_steps AS \\\\\\\"maxBlockExSteps\\\\\\\",\\\\n  epoch_param.max_bh_size AS \\\\\\\"maxBlockHeaderSize\\\\\\\",\\\\n  epoch_param.max_tx_ex_mem AS \\\\\\\"maxTxExMem\\\\\\\",\\\\n  epoch_param.max_tx_ex_steps AS \\\\\\\"maxTxExSteps\\\\\\\",\\\\n  epoch_param.max_tx_size AS \\\\\\\"maxTxSize\\\\\\\",\\\\n  epoch_param.max_val_size AS \\\\\\\"maxValSize\\\\\\\",\\\\n  epoch_param.min_fee_a AS \\\\\\\"minFeeA\\\\\\\",\\\\n  epoch_param.min_fee_b AS \\\\\\\"minFeeB\\\\\\\",\\\\n  epoch_param.min_pool_cost AS \\\\\\\"minPoolCost\\\\\\\",\\\\n  epoch_param.min_utxo_value AS \\\\\\\"minUTxOValue\\\\\\\",\\\\n  epoch_param.optimal_pool_count AS \\\\\\\"nOpt\\\\\\\",\\\\n  epoch_param.pool_deposit AS \\\\\\\"poolDeposit\\\\\\\",\\\\n  epoch_param.price_mem AS \\\\\\\"priceMem\\\\\\\",\\\\n  epoch_param.price_step AS \\\\\\\"priceStep\\\\\\\",\\\\n  jsonb_build_object('major', epoch_param.protocol_major, 'minor', epoch_param.protocol_major) AS \\\\\\\"protocolVersion\\\\\\\",\\\\n  epoch_param.monetary_expand_rate AS \\\\\\\"rho\\\\\\\",\\\\n  epoch_param.treasury_growth_rate AS \\\\\\\"tau\\\\\\\"\\\\nFROM epoch_param\\\\nJOIN cost_model\\\\n  ON epoch_param.cost_model_id = cost_model.id;\\\\n\\\\nCREATE VIEW \\\\\\\"Redeemer\\\\\\\" AS\\\\nSELECT\\\\n  redeemer.fee AS \\\\\\\"fee\\\\\\\",\\\\n  redeemer.id AS \\\\\\\"id\\\\\\\",\\\\n  redeemer.index AS \\\\\\\"index\\\\\\\",\\\\n  redeemer.purpose AS \\\\\\\"purpose\\\\\\\",\\\\n  redeemer.script_hash AS \\\\\\\"scriptHash\\\\\\\",\\\\n  redeemer.tx_id AS \\\\\\\"txId\\\\\\\",\\\\n  redeemer.unit_mem AS \\\\\\\"unitMem\\\\\\\",\\\\n  redeemer.unit_steps AS \\\\\\\"unitSteps\\\\\\\"\\\\nFROM redeemer;\\\\n\\\\nCREATE VIEW \\\\\\\"Reward\\\\\\\" AS\\\\nSELECT\\\\n  reward.amount,\\\\n  stake_address.view AS \\\\\\\"address\\\\\\\",\\\\n  reward.earned_epoch AS \\\\\\\"earnedInEpochNo\\\\\\\",\\\\n  reward.pool_id AS pool_hash_id,\\\\n  reward.spendable_epoch AS \\\\\\\"receivedInEpochNo\\\\\\\",\\\\n  reward.type AS \\\\\\\"type\\\\\\\"\\\\nFROM reward\\\\nJOIN stake_address on reward.addr_id = stake_address.id;\\\\n\\\\nCREATE VIEW \\\\\\\"Script\\\\\\\" AS\\\\nSELECT\\\\n  script.hash AS \\\\\\\"hash\\\\\\\",\\\\n  script.serialised_size AS \\\\\\\"serialisedSize\\\\\\\",\\\\n  script.type AS \\\\\\\"type\\\\\\\",\\\\n  script.tx_id AS \\\\\\\"txId\\\\\\\"\\\\nFROM script;\\\\n\\\\nCREATE VIEW \\\\\\\"SlotLeader\\\\\\\" AS\\\\nSELECT\\\\n  slot_leader.hash AS \\\\\\\"hash\\\\\\\",\\\\n  slot_leader.id AS \\\\\\\"id\\\\\\\",\\\\n  slot_leader.description AS \\\\\\\"description\\\\\\\",\\\\n  slot_leader.pool_hash_id AS \\\\\\\"pool_hash_id\\\\\\\"\\\\nFROM slot_leader;\\\\n\\\\nCREATE VIEW \\\\\\\"StakeDeregistration\\\\\\\" AS\\\\nSELECT\\\\n  stake_deregistration.id AS \\\\\\\"id\\\\\\\",\\\\n  stake_address.view AS \\\\\\\"address\\\\\\\",\\\\n  stake_deregistration.redeemer_id AS \\\\\\\"redeemerId\\\\\\\",\\\\n  stake_deregistration.tx_id AS \\\\\\\"tx_id\\\\\\\"\\\\nFROM stake_deregistration\\\\nJOIN stake_address on stake_deregistration.addr_id = stake_address.id;\\\\n\\\\nCREATE VIEW \\\\\\\"StakePool\\\\\\\" AS\\\\nWITH\\\\n  latest_block_times AS (\\\\n    SELECT pool.hash_id, max(block.time) AS blockTime\\\\n    FROM pool_update AS pool\\\\n    JOIN tx ON pool.registered_tx_id = tx.id\\\\n    JOIN block ON tx.block_id = block.id\\\\n    group by pool.hash_id\\\\n)\\\\nSELECT\\\\n  pool.fixed_cost AS \\\\\\\"fixedCost\\\\\\\",\\\\n  pool_hash.hash_raw AS \\\\\\\"hash\\\\\\\",\\\\n  pool_hash.view AS \\\\\\\"id\\\\\\\",\\\\n  pool.hash_id AS \\\\\\\"hash_id\\\\\\\",\\\\n  pool.id AS \\\\\\\"update_id\\\\\\\",\\\\n  pool.margin AS \\\\\\\"margin\\\\\\\",\\\\n  pool_metadata_ref.hash AS \\\\\\\"metadataHash\\\\\\\",\\\\n  block.block_no AS \\\\\\\"blockNo\\\\\\\",\\\\n  pool.registered_tx_id AS \\\\\\\"updated_in_tx_id\\\\\\\",\\\\n  pool.pledge AS \\\\\\\"pledge\\\\\\\",\\\\n  stake_address.view AS \\\\\\\"rewardAddress\\\\\\\",\\\\n  pool_metadata_ref.url AS \\\\\\\"url\\\\\\\"\\\\nFROM pool_update AS pool\\\\n  LEFT JOIN pool_metadata_ref ON pool.meta_id = pool_metadata_ref.id\\\\n  INNER JOIN tx ON pool.registered_tx_id = tx.id\\\\n  INNER JOIN latest_block_times ON latest_block_times.hash_id = pool.hash_id\\\\n  INNER JOIN block ON tx.block_id = block.id AND latest_block_times.blockTime = block.time\\\\n  JOIN stake_address on pool.reward_addr = stake_address.hash_raw\\\\n  JOIN pool_hash on pool_hash.id = pool.hash_id;\\\\n\\\\nCREATE VIEW \\\\\\\"StakePoolOwner\\\\\\\" AS\\\\nSELECT\\\\n  stake_address.hash_raw as \\\\\\\"hash\\\\\\\",\\\\n  pool_owner.pool_hash_id as \\\\\\\"pool_hash_id\\\\\\\"\\\\nFROM pool_owner\\\\n  LEFT JOIN stake_address ON pool_owner.addr_id = stake_address.id;\\\\n\\\\nCREATE VIEW \\\\\\\"StakePoolRetirement\\\\\\\" AS\\\\nSELECT\\\\n  retiring_epoch as \\\\\\\"inEffectFrom\\\\\\\",\\\\n  announced_tx_id as \\\\\\\"tx_id\\\\\\\",\\\\n  hash_id AS \\\\\\\"pool_hash_id\\\\\\\"\\\\nFROM pool_retire;\\\\n\\\\nCREATE VIEW \\\\\\\"StakeRegistration\\\\\\\" AS\\\\nSELECT\\\\n  stake_registration.id AS \\\\\\\"id\\\\\\\",\\\\n  stake_address.view AS \\\\\\\"address\\\\\\\",\\\\n  stake_registration.tx_id AS \\\\\\\"tx_id\\\\\\\"\\\\nFROM stake_registration\\\\nJOIN stake_address on stake_registration.addr_id = stake_address.id;\\\\n\\\\nCREATE VIEW \\\\\\\"ActiveStake\\\\\\\" AS\\\\nSELECT\\\\n  stake_address.view AS \\\\\\\"address\\\\\\\",\\\\n  amount AS \\\\\\\"amount\\\\\\\",\\\\n  epoch_no as \\\\\\\"epochNo\\\\\\\",\\\\n  epoch_stake.id AS \\\\\\\"id\\\\\\\",\\\\n  pool_hash.hash_raw AS \\\\\\\"stakePoolHash\\\\\\\",\\\\n  pool_hash.view AS \\\\\\\"stakePoolId\\\\\\\"\\\\nFROM epoch_stake\\\\nJOIN pool_hash\\\\n  ON pool_hash.id = epoch_stake.pool_id\\\\nJOIN stake_address on epoch_stake.addr_id = stake_address.id;\\\\n\\\\nCREATE VIEW \\\\\\\"TokenMint\\\\\\\" AS\\\\nSELECT\\\\n  CAST(CONCAT(multi_asset.policy, RIGHT(CONCAT(E'\\\\\\\\\\\\\\\\', multi_asset.name), -3)) as BYTEA) as \\\\\\\"assetId\\\\\\\",\\\\n  multi_asset.name AS \\\\\\\"assetName\\\\\\\",\\\\n  multi_asset.policy AS \\\\\\\"policyId\\\\\\\",\\\\n  quantity,\\\\n  tx_id\\\\nFROM ma_tx_mint\\\\nJOIN multi_asset\\\\n  ON ma_tx_mint.ident = multi_asset.id;\\\\n\\\\nCREATE VIEW \\\\\\\"TokenInOutput\\\\\\\" AS\\\\nSELECT\\\\n  CAST(CONCAT(policy, RIGHT(CONCAT(E'\\\\\\\\\\\\\\\\', name), -3)) as BYTEA) as \\\\\\\"assetId\\\\\\\",\\\\n  name as \\\\\\\"assetName\\\\\\\",\\\\n  policy AS \\\\\\\"policyId\\\\\\\",\\\\n  quantity,\\\\n  tx_out_id\\\\nFROM ma_tx_out\\\\nJOIN multi_asset\\\\n  ON ma_tx_out.ident = multi_asset.id;\\\\n\\\\nCREATE VIEW \\\\\\\"Transaction\\\\\\\" AS\\\\nSELECT\\\\n  block.hash AS \\\\\\\"blockHash\\\\\\\",\\\\n  tx.block_index AS \\\\\\\"blockIndex\\\\\\\",\\\\n  tx.deposit AS \\\\\\\"deposit\\\\\\\",\\\\n  COALESCE(tx.fee, 0) AS fee,\\\\n  tx.hash,\\\\n  tx.id,\\\\n  block.time AS \\\\\\\"includedAt\\\\\\\",\\\\n  tx.invalid_before AS \\\\\\\"invalidBefore\\\\\\\",\\\\n  tx.invalid_hereafter AS \\\\\\\"invalidHereafter\\\\\\\",\\\\n  tx.script_size AS \\\\\\\"scriptSize\\\\\\\",\\\\n  tx.size,\\\\n  CAST(COALESCE((SELECT SUM(\\\\\\\"value\\\\\\\") FROM tx_out WHERE tx_id = tx.id), 0) AS bigint) AS \\\\\\\"totalOutput\\\\\\\",\\\\n  tx.valid_contract AS \\\\\\\"validContract\\\\\\\"\\\\nFROM\\\\n  tx\\\\nINNER JOIN block\\\\n  ON block.id = tx.block_id;\\\\n\\\\nCREATE VIEW \\\\\\\"TransactionInput\\\\\\\" AS\\\\nSELECT\\\\n  source_tx_out.address,\\\\n  tx_in.redeemer_id AS \\\\\\\"redeemerId\\\\\\\",\\\\n  source_tx_out.value,\\\\n  tx.hash AS \\\\\\\"txHash\\\\\\\",\\\\n  source_tx.hash AS \\\\\\\"sourceTxHash\\\\\\\",\\\\n  tx_in.tx_out_index AS \\\\\\\"sourceTxIndex\\\\\\\",\\\\n  source_tx_out.id AS source_tx_out_id\\\\nFROM\\\\n  tx\\\\nJOIN tx_in\\\\n  ON tx_in.tx_in_id = tx.id\\\\nJOIN tx_out AS source_tx_out\\\\n  ON tx_in.tx_out_id = source_tx_out.tx_id\\\\n  AND tx_in.tx_out_index = source_tx_out.index\\\\nJOIN tx AS source_tx\\\\n  ON source_tx_out.tx_id = source_tx.id;\\\\n\\\\nCREATE VIEW \\\\\\\"TransactionOutput\\\\\\\" AS\\\\nSELECT\\\\n  address,\\\\n  tx_out.address_has_script AS \\\\\\\"addressHasScript\\\\\\\",\\\\n  value,\\\\n  tx.hash AS \\\\\\\"txHash\\\\\\\",\\\\n  tx_out.id,\\\\n  index\\\\nFROM tx\\\\nJOIN tx_out\\\\n  ON tx.id = tx_out.tx_id;\\\\n\\\\nCREATE VIEW \\\\\\\"Utxo\\\\\\\" AS SELECT\\\\n  address,\\\\n  tx_out.address_has_script AS \\\\\\\"addressHasScript\\\\\\\",\\\\n  value,\\\\n  tx.hash AS \\\\\\\"txHash\\\\\\\",\\\\n  tx_out.id,\\\\n  index\\\\nFROM tx\\\\nJOIN tx_out\\\\n  ON tx.id = tx_out.tx_id\\\\nLEFT OUTER JOIN tx_in\\\\n  ON tx_out.tx_id = tx_in.tx_out_id\\\\n  AND tx_out.index = tx_in.tx_out_index\\\\nWHERE tx_in.tx_in_id IS NULL;\\\\n\\\\nCREATE VIEW \\\\\\\"Withdrawal\\\\\\\" AS\\\\nSELECT\\\\n  withdrawal.amount AS \\\\\\\"amount\\\\\\\",\\\\n  withdrawal.id AS \\\\\\\"id\\\\\\\",\\\\n  stake_address.view \\\\\\\"address\\\\\\\",\\\\n  withdrawal.redeemer_id AS \\\\\\\"redeemerId\\\\\\\",\\\\n  withdrawal.tx_id AS \\\\\\\"tx_id\\\\\\\"\\\\nFROM withdrawal\\\\nJOIN stake_address on withdrawal.addr_id = stake_address.id;\\\\n\\\\nCREATE INDEX idx_block_hash\\\\n    ON block(hash);\\\\n\\\\nCREATE INDEX idx_multi_asset_name\\\\n    ON multi_asset(name);\\\\n\\\\nCREATE INDEX idx_multi_asset_policy\\\\n    ON multi_asset(policy);\\\\n\\\\nCREATE INDEX idx_reward_type\\\\n    ON reward(type);\\\\n\\\\nCREATE INDEX idx_tx_hash\\\\n    ON tx(hash);\\\\n\\\\nCREATE INDEX idx_tx_in_consuming_tx\\\\n   ON tx_in(tx_out_id);\\\\n\\\\nCREATE INDEX idx_tx_out_tx\\\\n    ON tx_out(tx_id);\\\\n\\\\nCREATE function utxo_set_at_block(\\\\\\\"hash\\\\\\\" hash32type)\\\\nRETURNS SETOF \\\\\\\"TransactionOutput\\\\\\\" AS $$\\\\n  SELECT\\\\n    \\\\\\\"TransactionOutput\\\\\\\".address,\\\\n    \\\\\\\"TransactionOutput\\\\\\\".\\\\\\\"addressHasScript\\\\\\\",\\\\n    \\\\\\\"TransactionOutput\\\\\\\".value,\\\\n    \\\\\\\"TransactionOutput\\\\\\\".\\\\\\\"txHash\\\\\\\",\\\\n    \\\\\\\"TransactionOutput\\\\\\\".\\\\\\\"id\\\\\\\",\\\\n    \\\\\\\"TransactionOutput\\\\\\\".index\\\\n  FROM tx\\\\n  JOIN tx_out\\\\n    ON tx.id = tx_out.tx_id\\\\n  JOIN \\\\\\\"TransactionOutput\\\\\\\"\\\\n    ON tx.hash = \\\\\\\"TransactionOutput\\\\\\\".\\\\\\\"txHash\\\\\\\"\\\\n  LEFT OUTER JOIN tx_in\\\\n    ON tx_out.tx_id = tx_in.tx_out_id\\\\n    AND tx_out.index = tx_in.tx_out_index\\\\n  WHERE tx_in.tx_in_id IS NULL\\\\n  AND tx.block_id \\\\u003c= (SELECT id FROM block WHERE hash = \\\\\\\"hash\\\\\\\")\\\\n$$ LANGUAGE SQL stable;\\\\n\\\\n\\\"\\n}\\r\\n[42703] FatalError: column epoch_param.coins_per_utxo_word does not exist\"\n","time":"2022-08-03T07:02:58.766Z","v":0}

1 Answer 1

2

It looks like you are restoring a db-sync 13 snapshot while your db-sync version is 12. For the moment there don't seem to be anymore snapshots for db-sync 12.

My guess is that if you remove the snapshot option and have it sync from scratch it will just work - but this will probably take a few days.

I wouldn't suggest using version 13 just yet since there are no compatible downstream components for this just yet. Maybe if you wait a few days for the official releases that would become an option.

2
  • That makes sense but when I let db-sync get sync via genesis it takes too much time. Byron era goes smooth but when it reaches to Shelly era it takes 1 day to move from epoch 287 to 288.
    – korimusk
    Commented Aug 4, 2022 at 6:36
  • How much IOPS does your machine have? This slow syncing sounds like you need higher performing storage. For db-sync the requirement is at least 60.000 IOPS, but higher is better of course. If you have lower IOPS you'll see: - syncing be slow - falling behind the tip (even if you ever catch up) Commented Aug 5, 2022 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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