Querying the blockchain

To start an instance of cardano-db-sync we are going to use Docker as manager and deployment of this instance. Before continuing make sure you have Docker installed.
First we uninstall possible old versions of Docker:
sudo apt-get remove docker docker-engine docker.io containerd runcUpdate the package repository:
Install the necessary packages for the repositories over https:
Add the official Docker GPG key:
Verify the key:
Set up the stable Docker repository.
Finally we update the repo (to get the most recent version) and install it.
Install cardano-db-sync
Download the source code of cardano-db-sync project:
Lets check the configuration with which the new environment will be launch:
My personal configuration is as follows:
If we look at the configuration we see that Docker is going to use the postgres_db, postgres_password and postgres_user credentials. It will look for them in the /home/cardano/cardano-db-sync/config/secrets folder. The default repository brings these files under the suffix * _example, we just have to replace or duplicate the examples.
Remember change the password.
Before running Docker we need to add our user to the docker group:
Start the instance with the log messages activated:
With this we have started a cardano-node services, the postgresql database, and the cardano-db-sync tool. We can access these services through the default port: 5432.
A more optimal execution
We are going to use tmux to run docker in the background and show the machine status live.
Create the script that starts the service in the background:
Create the script that executes docker:
Create the script that ends the service associated with the "cardano-db-sync" session.
Add execution permissions to the scripts:
Finally, start the service:
Once started we can launch queries to the address localhost: 5432.
List all the containers:
Delete a specific container by its ID:
Terminate all instances:
Relaunch the instances:
Support our work delegating to Ada Booster.
Última actualización