Linux - Installation de Cardano DB Sync
Guide complet pour installer Cardano DB Sync sur Debian 12 avec base de données PostgreSQL et gestionnaire de paquets NIX, incluant la configuration du service
Notes Importantes
Veuillez noter ces points importants avant l'installation
Nœud Cardano
Un Nœud Cardano en fonctionnement est requis pour DB Sync
Espace Disque
Au moins 700 Go d'espace disque libre (Nœud Cardano: 203 Go, DB Sync: 10 Go, PostgreSQL: 438 Go)
Mémoire RAM
Au moins 48 Go de RAM (Nœud Cardano: 24 Go, DB Sync: 21 Go, Système: 3 Go)
Temps de Synchronisation
La synchronisation initiale peut prendre plusieurs jours
Accès Root
Accès root ou permission sudo requis
Étapes d'Installation
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 postgresqlConnect 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;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
Create PostgreSQL password file
Set file permissions for security
chmod 600 ~/cardano-config/.pgpassCreate system-wide symbolic link
sudo ln -sf /home/cardano/.nix-profile/bin/cardano-db-sync /usr/local/bin/cardano-db-syncCreate 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-syncCheck service status
sudo systemctl status cardano-db-syncFollow service logs in real-time
journalctl -u cardano-db-sync -fConseils Supplémentaires
Commandes et conseils utiles pour une meilleure gestion
Ressources Supplémentaires
Documentation officielle et liens utiles
Installation de Cardano DB Sync Terminée !
Votre Cardano DB Sync fonctionne maintenant et synchronise les données blockchain dans la base de données PostgreSQL. Surveillez régulièrement les logs et la progression de la synchronisation.