Linux - Cardano DB Sync Installation
Komplett Uleedung fir Cardano DB Sync op Debian 12 ze installéieren mat PostgreSQL-Datebank a NIX-Paketmanager, inklusiv Service-Konfiguratioun
Setup Schrëtt
Install PostgreSQL
Installation and configuration of PostgreSQL database for Cardano DB Sync.
Install PostgreSQL and additional extensions
sudo apt install postgresql postgresql-contribEnable PostgreSQL service for automatic startup
sudo systemctl enable postgresqlStart PostgreSQL service
sudo systemctl start postgresqlSetup Database
Creating database user and database with appropriate permissions.
Connect to PostgreSQL console as postgres user
sudo -u postgres psqlCreate Cardano database user with password
CREATE USER cardano WITH PASSWORD 'PASSWORD';Use a strong, secure password
Create Cardano Explorer database
CREATE DATABASE cexplorer OWNER cardano;Grant all privileges for the database
GRANT ALL PRIVILEGES ON DATABASE cexplorer TO cardano;Clone Repository and Install DB Sync
Cloning the official Cardano DB Sync repository from GitHub and installation with NIX.
Switch to cardano user account
sudo -i -u cardanoClone Cardano DB Sync repository
git clone https://github.com/IntersectMBO/cardano-db-sync.gitChange to cardano-db-sync directory
cd cardano-db-sync/List available version tags
git tag | sort -VSwitch to specific version tag
git switch -d tags/13.6.0.5Install Cardano DB Sync with NIX
nix profile install .This installation may take some time
Database Authentication
Setting up PostgreSQL authentication with .pgpass file.
Create PostgreSQL password file
Set file permissions for security
chmod 600 ~/cardano-config/.pgpassSystem Integration
Creating system-wide symbolic links for Cardano DB Sync.
Create system-wide symbolic link
sudo ln -sf /home/cardano/.nix-profile/bin/cardano-db-sync /usr/local/bin/cardano-db-syncSystemd Service
Configuring systemd service for automatic startup and management.
Create systemd service configuration file
Reload systemd for new service
sudo systemctl daemon-reloadEnable service for automatic startup
sudo systemctl enable cardano-db-syncStart Cardano DB Sync service
sudo systemctl start cardano-db-syncMonitoring
Checking service status and setting up log monitoring.
Check service status
sudo systemctl status cardano-db-syncFollow service logs in real-time
journalctl -u cardano-db-sync -fZousätzlech Tipps
Nëtzlech Kommandoen an Tipps fir besser Gestioun
Synchronization Status
Query metadata table for synchronization status
sudo -u postgres psql -d cexplorer -c "SELECT * FROM meta;"Troubleshooting
Restart Cardano DB Sync service
sudo systemctl restart cardano-db-syncDisk Space
Check available disk space
df -h /home/cardano/Zousätzlech Ressourcen
Offiziell Dokumentatioun an hëllefräich Linken