I have followed the instructions bo build both the cardano-node and cardano-db-sync in the same folder.
I managed to fully sync the node, which is running when attempting to use dbsync.
When I try to follow the instructions to launch db-sync
PGPASSFILE=config/pgpass-mainnet cabal run cardano-db-sync -- \
--config config/mainnet-config.yaml \
--socket-path ../cardano-node/state-node-mainnet/node.socket \
--state-dir ledger-state/
--schema-dir schema/
I get the following error
[db-sync-node.Subscription:Error:51] [2022-03-09 21:22:29.03 UTC] Identity Connection Attempt Exception, destination LocalAddress "../cardano-node/state-node-mainnet/node.socket" exception: Network.Socket.connect: <socket: 22>: does not exist (Connection refused)
[db-sync-node.ErrorPolicy:Warning:6] [2022-03-09 21:22:29.03 UTC] IP LocalAddress "../cardano-node/state-node-mainnet/node.socket" ErrorPolicySuspendPeer (Just (ConnectionExceptionTrace Network.Socket.connect: <socket: 22>: does not exist (Connection refused))) 20s 20s
When I copy the lines from the postgresql setup command that seems to answer my issue:
~/cardano/cardano-db-sync$ PGPASSFILE=config/pgpass-mainnet scripts/postgresql-setup.sh --createdb
this error message is more telling
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "cexplorer" does not exist
I must admit I installed postgresql via sudo apt-get install
and I don't know how to proceed properly from there. Do I have to set up a new datbase called cexplorer
? should I create a new user for postgresql? for linux? should I edit permissions (i get a permission 600?
After running PGPASSFILE=config/pgpass-mainnet psql cexplorer
i got the following error
WARNING: password file "config/pgpass-mainnet" has group or world access; permissions should be u=rw (0600) or less
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "cexplorer" does not exist
The documentation is so comprehensive and well done!, I don't understand why this very specific part is not in it (or I am not able to jauge my own incompetence;) )
edit: removed "mainnet" from the db-sync call parameters. Failing to find the .sql file from the restored snapshot lead the psql database to revert to genesis. --state-dir ledger-state/mainnet(wrong)