<blockquote>
<p>What should I pass to --state-dir? I did pass ledger folder where my node stores data.</p>
</blockquote>
<p>This should not be the same as any directory the <code>node</code> uses. Its for <code>db-sync</code> and related programs only.</p>
<blockquote>
<p>I'm going to subscribe blocks to read information such as from &amp; to addresses, amount etc. If I pass --disable-ledger would it be a problem?</p>
</blockquote>
<p>This is documented. <code>--disable-ledger</code> means you will get all on-chain data but you don't get reward payments from the reward account associated with each address (until after they have been withdrawn), you don't get the epoch stake distribution and a couple of other minor things.</p>
<blockquote>
<p>While running db-sync I'd like to pass the latest snapshot in here how do I pass it?</p>
</blockquote>
<p>Its <a href="https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/state-snapshot.md" rel="nofollow noreferrer">documented</a>. You make sure <code>db-sync</code> is not running, restore the snapshot, then you run <code>db-sync</code>.</p>
<blockquote>
<p>How do I pass port which db-sync runs?</p>
</blockquote>
<p>Port for what? The PostgreSQL port for accessing the database? That is set by the PostgreSQL configuration.</p>

CC BY-SA 4.0
2022-07-26T21:24:15.240Z
2022-07-26T21:58:27.280Z
2022-07-26T21:58:27.280Z
Erik de Castro Lopo
<p>While running the <code>db-sync</code> what to pass as a parameters is unclear.</p>
<pre><code>PGPASSFILE=config/pgpass-mainnet cabal run cardano-db-sync -- \
    --config config/mainnet-config.yaml \
    --socket-path /home/ubuntu/cardano/cardano-src/cardano-node/data/node.socket \
    --state-dir /home/ubuntu/cardano/cardano-src/cardano-node/data/ledger \
    --schema-dir schema/ \
    --disable-ledger
</code></pre>
<ol>
<li>What should I pass to <code>--state-dir</code>? I did pass ledger folder where my node stores data.</li>
<li>I'm going to subscribe blocks to read information such as from &amp; to addresses, amount etc. If I pass <code>--disable-ledger</code> would it be a problem?</li>
<li>While running <code>db-sync</code> I'd like to pass the latest snapshot in here how do I pass it? (<a href="https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13/" rel="nofollow noreferrer">https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13/</a>)</li>
<li>How do I pass port which <code>db-sync</code> runs? When I was running it via docker it was <code>3100</code> by default.</li>
</ol>
<p>Thanks in advance!</p>

<cardano-db-sync>
Running db-sync via CLI
# Running db-sync via CLI

(Asked by: username_0 on 2022-07-26)

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/ubuntu/cardano/cardano-src/cardano-node/data/node.socket \
    --state-dir /home/ubuntu/cardano/cardano-src/cardano-node/data/ledger \
    --schema-dir schema/ \
    --disable-ledger


What should I pass to --state-dir? I did pass ledger folder where my node stores data.
I'm going to subscribe blocks to read information such as from & to addresses, amount etc. If I pass --disable-ledger would it be a problem?
While running db-sync I'd like to pass the latest snapshot in here how do I pass it? (https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13/)
How do I pass port which db-sync runs? When I was running it via docker it was 3100 by default.

Thanks in advance!

**Tags:** cardano-db-sync

---

## 1 answers

### Answer by username_1 on 2022-07-26. Score: 1

> What should I pass to --state-dir? I did pass ledger folder where my node stores data.

This should not be the same as any directory the `node` uses. Its for `db-sync` and related programs only.

> I'm going to subscribe blocks to read information such as from & to addresses, amount etc. If I pass --disable-ledger would it be a problem?

This is documented. `--disable-ledger` means you will get all on-chain data but you don't get reward payments from the reward account associated with each address (until after they have been withdrawn), you don't get the epoch stake distribution and a couple of other minor things.

> While running db-sync I'd like to pass the latest snapshot in here how do I pass it?

Its [documented](https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/state-snapshot.md). You make sure `db-sync` is not running, restore the snapshot, then you run `db-sync`.

> How do I pass port which db-sync runs?

Port for what? The PostgreSQL port for accessing the database? That is set by the PostgreSQL configuration.


---

