@@ -126,6 +126,14 @@ in {
126
126
type = lib . types . nullOr lib . types . str ;
127
127
default = "/var/lib/cexplorer" ;
128
128
} ;
129
+ disableLedger = lib . mkOption {
130
+ type = lib . types . bool ;
131
+ default = false ;
132
+ description = ''
133
+ Disables the leger state. Drastically reduces memory usage
134
+ and it syncs faster, but some data are missing.
135
+ '' ;
136
+ } ;
129
137
dbSyncPkgs = lib . mkOption {
130
138
type = lib . types . attrs ;
131
139
default = import ../. { } ;
@@ -177,6 +185,16 @@ in {
177
185
( if ( cfg . environment . nodeConfig . RequiresNetworkMagic == "RequiresNoMagic" )
178
186
then "--mainnet"
179
187
else "--testnet-magic $(jq '.networkMagic' ${ cfg . environment . nodeConfig . ShelleyGenesisFile } )" ) ;
188
+ dbSyncCommand = ''
189
+ exec ${ exec } \
190
+ --config ${ configFile } \
191
+ --socket-path "$CARDANO_NODE_SOCKET_PATH" \
192
+ --schema-dir ${ self . schema } \
193
+ ${ if cfg . disableLedger then
194
+ "--disable-ledger"
195
+ else
196
+ "--state-dir ${ cfg . stateDir } " }
197
+ '' ;
180
198
in {
181
199
pgpass = builtins . toFile "pgpass" "${ cfg . postgres . socketdir } :${
182
200
toString cfg . postgres . port
@@ -225,12 +243,7 @@ in {
225
243
fi
226
244
227
245
mkdir -p log-dir
228
- exec ${ exec } \
229
- --config ${ configFile } \
230
- --socket-path "$CARDANO_NODE_SOCKET_PATH" \
231
- --schema-dir ${ self . schema } \
232
- --state-dir ${ cfg . stateDir } \
233
- '' ${EXTRA_DB_SYNC_ARGS:-}'' ;
246
+ ${ dbSyncCommand } '' ;
234
247
} ;
235
248
systemd . services . cardano-db-sync = {
236
249
wantedBy = [ "multi-user.target" ] ;
0 commit comments