As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [cardano-db-sync]

For questions about cardano-db-sync, one of the core Cardano components, which provides a convenient way to find and query historical information from the Cardano blockchain through the use of a Structured Query Language (SQL) relational database.

Filter by
Sorted by
Tagged with
1 vote
0 answers
17 views

Is there a standart way to sync off-chain metadata (assets, tokens, mints) like cardano-db-sync does with on-chain data (epochs, blocks etc)?

I have running cardano-node-ogmios:v5.6.0_1.35.5 in couple with cardano-db-sync:13.1.0.0 (docker-compose.yml) and looking for the solution to sync off-chain assets localy. Is there any standart ...
Denis Akimov's user avatar
0 votes
0 answers
12 views

Transaction collateral inputs for specified transaction hash

In cardano-db-sync, how would you go about returning all transaction collateral inputs for a given transaction hash? Similar to the interesting queries documented here I thought that something like ...
ADA Capital - ADACT's user avatar
0 votes
0 answers
9 views

How to get all NFT that are added in last 24 hours in a address using SQL?

the attached queries give me all the assets in a particular address but i wish to get only nfts that are added in last 24 hours SELECT multi_asset.name::text, encode(decode(substring(concat(...
Hafiz Arsam Rahmaan's user avatar
0 votes
2 answers
31 views

Detailed upgrade instructions for latest db-sync release 13.1

I was wondering if anyone knows where I can find the detailed upgrade instructions for db-sync 13.1. I’m current on the previous release and think the upgrade shouldn’t be too difficult, but I can ...
Nicholas's user avatar
0 votes
2 answers
65 views

Guarantee not dispensing native assets to a Franken address

As I understand it, a "mangled" address can be used to spoof ownership of a wallet who's stake address is NOT of a wallet controlled by the one doing the spoofing. Put another way: I can use ...
RelevantData's user avatar
1 vote
1 answer
31 views

Column does not exist when querying Rosetta endpoint

I'm currently running cardano-node version 1.35.0 and rosetta-server 1.8.2. The node is synced and I have blocks in postgres, however each query to rosetta throws an error: curl -vvv -X POST 'http://&...
relik's user avatar
  • 111
3 votes
1 answer
34 views

Track incoming payment of an address using cardano-db-sync

I have a cardano-node with cardano-db-sync installed. In this node, I also have a separate database named CDT, and a web UI to connect to this CDT database. I defined an address named addr1xxxxxx ...
cdt's user avatar
  • 121
0 votes
0 answers
28 views

Possible inconsistence data in db-sync

I've this query on Preprod: SELECT ENCODE(TX.HASH, 'hex') as tx_hash, TX_OUT.INDEX, TX_OUT.ADDRESS_HAS_SCRIPT, ENCODE(TX_OUT.DATA_HASH,'hex') AS DATUM_HASH, SCRIPT.ID as script_id, ...
leobelizquierdo's user avatar
0 votes
1 answer
62 views

How to decode the datum stored across records in the tx_metadata table for a given tx

For a given tx - where a contract has been used, outputs have been stored in the tx_metadata table - in this case key/value pairs where the values of keys 0 through 10, when appended together to form ...
RelevantData's user avatar
0 votes
0 answers
50 views

Decode the cbor datum in tx_metadata

I cannot find a way using an available nuget package, to decode the cbor data stored in tx_metadata for a given transaction. cbor.me does convert it to an object but even there I cannot find how to ...
RelevantData's user avatar
0 votes
0 answers
19 views

How to properly interpret Bytestrings (TxMetadata)

In the TxMetadata caradano wallet spec there is this: { "bytes": HEX-STRING } The value must be base16-encoded (a hex string). So, given this from a transaction: "fields": [ { &...
RelevantData's user avatar
1 vote
1 answer
57 views

tx_metadata: How to interpret a CBOR string

In the document: https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/tx-metadata.md We are told: "JSON strings are represented as CBOR strings" How can I interpret ...
RelevantData's user avatar
1 vote
1 answer
18 views

When is valid_contract column in tx table true and a contract?

In the schema descriptions for cardano-db-sync, the valid_contract column description is as follows (link below): "False if the contract is invalid. True if the contract is valid or there is no ...
RelevantData's user avatar
1 vote
3 answers
57 views

Running db-sync on a separate machine from node on same LAN

I currently have cardano-node and db-sync running on the same machine. The machine has a max RAM capacity of 32 GB and this is barely enough. Instead of buying a new machine that supports 64 GB RAM, I ...
RelevantData's user avatar
0 votes
3 answers
39 views

db-sync "Killed" sometimes. Why?

I have cardano-node and db-sync running just fine, latest versions. Every now and then though, db-sync stops and message in console says "Killed". This was not the case before the Vasil HF. ...
RelevantData's user avatar
0 votes
1 answer
31 views

cardano-db-sync different tx, same hash?

I'm listening for new records added on block table and have noticed that sometimes two blocks are added almost at the same time with basically the same info except for block hash (maybe a slot battle/...
leobelizquierdo's user avatar
1 vote
2 answers
52 views

How to calculate ADA balance at a prior point in time?

I'm trying to calculate the ADA balance at a prior point in time using DB-Sync. What I did was first work out what the last tx.ID number of the 10th May 22 was, which in my version of the db is ...
Reddspark's user avatar
  • 273
0 votes
1 answer
54 views

Downtime when upgrading or restarting a node

I run not only Cardano nodes but also Ethereum and other nodes. I think the downtime is longer when upgrading or restarting a Cardano node compared to other nodes. Downtime here is the time between ...
Satish's user avatar
  • 5
3 votes
2 answers
71 views

How to get number of delegators of a pool?

Using cardano-db-sync, I want to get the number of delegators given a pool_id. For example, this pool has 22 delegators. https://cardanoscan.io/pool/...
cdt's user avatar
  • 121
1 vote
1 answer
111 views

How to get all assets of a certain addresss using SQL on Cexplorer

It seems like a simple question, but I was struggling to find the answer. I am trying to get information of Cardano blockchain from cexplorer database. Given an address such as '...
cdt's user avatar
  • 121
0 votes
2 answers
35 views

How to view binarydata in cexplorer?

When running sql script to view data on Cexplorer database, many times,I see binary data. for example, multi_asset.name, multi_asset.policy in the following query. Is there any way to view these data ...
cdt's user avatar
  • 121
0 votes
2 answers
75 views

Get list of holders of a token using Cardano-cli or Cardano-DB-Sync or Ogmios

I am trying to find a way using either Cardano-cli, Ogmios, or Cardano-DB-Sync to get a list of token holders (addresses) for a particularly token, ideally in JSON format. What is the best way to do ...
Barney Chambers's user avatar
1 vote
1 answer
39 views

Cardano-graphql doesn't return sync percentage

when I first started It was returning the sync percentage, and the logs of cardano-graphql was like this: {"name":"cardano-graphql","hostname":"2f8ed0c5755a",&...
korimusk's user avatar
  • 153
0 votes
1 answer
58 views

Cardano Rosetta API returning 5000 error occurred - Cannot read property 'key_deposit' of undefined

Cardano Rosetta Construction endpoints /construction/preprocess and other endpoints are returning 5000 Error with Cannot read property 'key_deposit' of undefined". Also, /construction/metadata is ...
Kartik Iyer's user avatar
0 votes
1 answer
65 views

How to efficiently query for all transactions involving a particular policy

What is the best way (or perhaps only way) to query db-sync for transactions involving a specific policy?
RelevantData's user avatar
1 vote
2 answers
105 views

Can db-sync be used to "listen" for transactions involving particular smart contracts?

Take JPG store as an example. When someone lists an NFT for sale there, or when someone buys an NFT there, a smart contract governs that transaction. Can sql queries against the db-sync generated ...
RelevantData's user avatar
1 vote
0 answers
43 views

How to query for an executed smart contract in db-sync?

If any DApp allows the user to connect their wallet and make use of a given smart contract, how can I most efficiently find that through queries in db-sync? Select on an address associated with the ...
RelevantData's user avatar
1 vote
1 answer
115 views

What is your comfort level for Number Of Confirmations, and why?

As an example, in Eternl wallet, a new transaction is marked as follows: red (0 to 9 confirmations) yellow (10 to 19 confirmations) green (20+ confirmations) I have been watching blocks in db-sync, ...
RelevantData's user avatar
0 votes
1 answer
20 views

Is my db-sync far behind the latest block/slot?

Looking at the select statement in the screencap below - with the latest info also displayed from cardanoscan - I was expecting to see a direct correlation but my db-sync appears to be far behind ...
RelevantData's user avatar
1 vote
1 answer
105 views

How is Number Of Confirmations derived for a transaction?

In the wallet I use a transaction gets a "number of confirmations" and is indicated as "low" (red), "medium"(yellow), or "high"(green) confidence based on that ...
RelevantData's user avatar
-1 votes
1 answer
42 views

Running db-sync via CLI

While running the db-sync what to pass as a parameters is unclear. PGPASSFILE=config/pgpass-mainnet cabal run cardano-db-sync -- \ --config config/mainnet-config.yaml \ --socket-path /home/...
korimusk's user avatar
  • 153
1 vote
1 answer
65 views

Connecting Node and DB-Sync

I'm running Cardano Node and Cardano GraphQL on the same network/computer. This is how I started the node: cardano-node run \ --topology /home/ubuntu/cardano/cardano-src/cardano-node/mainnet-...
korimusk's user avatar
  • 153
2 votes
1 answer
128 views

Syncing from genesis instead of snapshot

I start the docker as followed in the guide: export NETWORK=mainnet &&\ docker pull inputoutput/cardano-graphql:6.2.0-${NETWORK} &&\ docker pull inputoutput/cardano-graphql-hasura:6.2....
korimusk's user avatar
  • 153
0 votes
2 answers
69 views

No space left on device, cardano-db-sync to blame?

I'm getting errors when starting up my producer suggesting I'm out of storage. It looks like db/immutable is the culprit taking almost 100g of space. I'm not super familiar with what this db is or ...
comrade-kirby's user avatar
0 votes
1 answer
63 views

Can anyone explain how tAda locked with asset is calculated?

I have previously asked a similar question here Get Ada locked with asset from db-sync query? but I'm still really stuck with this and needing some help. After looking at Nami Wallet, Eternl Wallet ...
FoxB's user avatar
  • 1
3 votes
1 answer
98 views

How can I determine which smart contracts / script addresses are associated with which dApps?

I have seen numerous examples of blockchain explorers providing information about the on chain activity of specific dApps. For example: opencnft.io aggregates data about various token marketplaces ...
adjuric's user avatar
  • 125
2 votes
1 answer
61 views

How does db-sync query raw block data if cardano-node doesn't expose them?

I was trying to find a way to get raw block/transaction data and came across this question. The answer was that there is no way to do that currently but db-sync somehow does that. How does it do that? ...
alexk745's user avatar
0 votes
0 answers
38 views

Get Ada locked with asset from db-sync query? [duplicate]

Does anybody know a way to get the locked asset Ada/tAda information from db-sync? identical to the information displayed in Nami wallet? I've tried looking at all the tables, but nothing seems to ...
FoxB's user avatar
  • 1
2 votes
1 answer
104 views

How to query the address that sent a token from cardano-db-sync?

I'm trying to query the token transactions using the schemas of Cardano-db-sync. When querying ADA transactions, I can easily see the input and output addresses with the values sent by joining the tx, ...
TK36's user avatar
  • 21
0 votes
1 answer
24 views

How can db-sync "match" a data_hash to specific outputs?

Looking at the db-sync schema, I see the tx_out table has a data_hash column, but I can't make sense of why this column is not on the tx table instead. From the Alonzo CDDL, I can see the scripts are ...
Pedro Martins Timóteo da Costa's user avatar
1 vote
1 answer
37 views

How can I see if an UTxO holds an NFT in the postgres DB?

Is it possible to find out if an UTxO on the tx_out postgres table holds an NFT? OR in generell which kind of asset this UTxO holds? Thank you!
Pierre Previsionz's user avatar
1 vote
1 answer
115 views

GraphQL syncing takes too much time

Hello everyone I did follow this guide to run GraphQL with docker-compose: https://github.com/input-output-hk/cardano-graphql However, inputoutput/cardano-db-sync:12.0.0 is syncing super slow ...
korimusk's user avatar
  • 153
1 vote
2 answers
48 views

How to Run A DB Sync Server On Daedalus?

So I have been trying to do some fun things with Daedalus, and realised I should be able to query the node from it. This makes me wonder how to set up a limited database / querying system for my own ...
KryptoKing's user avatar
0 votes
1 answer
35 views

Can the price of a Dex pair be tracked using the data in cexplorer / db-sync?

Is there a way to query the price of a pair that's on a dex independent of the dex? For example: MIN/ADA or others? I am trying to see how the data in the cexplorer database could be used to do this.
RelevantData's user avatar
1 vote
1 answer
26 views

How to convert some of the db-sync data types/columns to C# data types?

Specifically, I am using the Npgsql lib in a C# console app, and am reading data just fine so far for the obvious types like bigint, uinteger, boolean, etc. - but for a few different types/columns in ...
RelevantData's user avatar
0 votes
1 answer
41 views

What is the total size of cexplorer on Postgres?

I have a relay node fully synced with the tip of the mainnet chain and DB-sync filling the Postgres database. DB-sync is currently syncing on epoch 321 and the database takes 103 GB of disk space. I ...
George's user avatar
  • 35
0 votes
1 answer
60 views

How can I Convert BlockFrost API Code to Dandelion API?

I have somehow managed to get a lot of code for BlockFrost API, however, I want to build some free applications for people to monitor blockchain data from a website dashboard. To take advantage of the ...
KryptoKing's user avatar
0 votes
1 answer
47 views

Is the Transaction Hash from block frost the same as the transaction id?

When making an API (HTTP) Get request to the blockfrost API service, you can specify an address and get the transactions at the address (https://docs.blockfrost.io/#tag/Cardano-Addresses/paths/~...
KryptoKing's user avatar
1 vote
0 answers
31 views

How to Count plutus transactions?

i'm connected to the cardano-db-sync, someone knows how to count the ammout of transactions that use plutus script? i'm using two methods here select block.epoch_no, count(distinct tx.id) as ...
Bruno N's user avatar
  • 11
3 votes
1 answer
48 views

How to calculate Sundaeswap TVL using DB-sync?

I'm trying to do an exercise where I see if I can calculate Sundaeswap TVL using DB-Sync. Below is what I have managed to pull out from the database so far regarding Sundaeswap. However for the UTXOs ...
Reddspark's user avatar
  • 273