Skip to content

Commit

Permalink
update docs to reflect --state-dir --disable-ledger changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cmdv committed Mar 17, 2023
1 parent 64e9677 commit f359eca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions cardano-db-sync/app/cardano-db-sync.hs
Expand Up @@ -28,15 +28,18 @@ main = do
(Just _, True ) -> run params
(Nothing, False ) -> run params
(Just _, False ) -> Text.putStrLn $
"Error: Using `--dissable-ledger` doesn't require having a --state-dir. " <> moreDetails
"Error: Using `--dissable-ledger` doesn't require having a --state-dir. " <> moreDetailsDisableLedger
(Nothing, True) -> Text.putStrLn $
"Error: If not using --state-dir then make sure to have --dissable-ledger. " <> moreDetails
"Error: If not using --state-dir then make sure to have --dissable-ledger. " <> moreDetailsStateDir
where
knownMigrationsPlain :: [(Text, Text)]
knownMigrationsPlain = (\x -> (hash x, filepath x)) <$> knownMigrations

moreDetails :: Text
moreDetails = "For more details view https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/configuration.md#--disable-ledger"
moreDetailsDisableLedger :: Text
moreDetailsDisableLedger = "For more details view https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/configuration.md#--disable-ledger"

moreDetailsStateDir :: Text
moreDetailsStateDir = "For more details view https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/syncing-and-rollbacks.md#ledger-state"

run :: SyncNodeParams -> IO ()
run prms = do
Expand Down
2 changes: 1 addition & 1 deletion doc/configuration.md
Expand Up @@ -30,7 +30,7 @@ When this flag is enabled, some features are missing and some DB tables are left

Warning: Running db-sync with this flag and then restarting it without the flag will cause crashes and should be avoided.

Known issues: When this flag in enabled, the `--state-dir` option still needs to be provided, even though db-sync will completely ignore it.
Warning: It was previously required to still have a `--state-dir` option provided when in conjunction with `--disable-ledger`. This is no longer the case and now an error will occure if they are both present at the same time.

If used with docker, this flag can be provided as an extra flag to docker image.

Expand Down
2 changes: 2 additions & 0 deletions doc/syncing-and-rollbacks.md
Expand Up @@ -26,6 +26,8 @@ argument to `db-sync`. This ledger state directory must persist across machine r
Each ledger state is valid only for a specific block. It is not valid for any block before
or any block after the block it is valid for.

The option `--state-dir` can be ommited when one doesn't want to use local ledger, for the omittion to work a `--disable-ledger` flag should be used, more information on what this flag does can be found [here](./configuration.md#--disable-ledger).


## Concurrency

Expand Down

0 comments on commit f359eca

Please sign in to comment.