-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default path for GenesisFile
and make path relative to configuration yaml file
#648
Conversation
Can't build it with nix, got an error:
When using cabal to build the error above is marked as a warning:
|
aae9f30
to
4c564eb
Compare
e32a54f
to
23a1c00
Compare
…nd the `GenesisFile` specified needs to be an absolute path or a relative path, relative to where the config is, not the current working dir
23a1c00
to
fccd44a
Compare
bors r+ |
Build succeeded |
parseNodeConfigurationFP :: ConfigYamlFilePath -> IO NodeConfiguration | ||
parseNodeConfigurationFP (ConfigYamlFilePath fp) = do | ||
nc <- decodeFileThrow fp | ||
let genFile = unGenesisFile $ ncGenesisFile nc | ||
exists <- doesFileExist genFile | ||
case exists of | ||
-- Genesis file is an absolute path | ||
True -> pure nc | ||
-- Genesis file is a relative path (relative to configuration yaml filepath) | ||
False -> do let d = takeDirectory fp | ||
pure $ nc { ncGenesisFile = GenesisFile $ d </> genFile } | ||
|
||
-- TODO: Make genesisfile relative to configuration file as above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is unnecessary. All we need to do is takeDirectory fp </> genFile
. That will make it relative to the config file's dir if the file is relative, but if it's absolute it'll remain unchanged.
There is no need to do this probing to see if files exist.
Issue
Add
SocketPath
andGenesisFile
fields to yaml #611This PR does not result in breaking changes to upstream dependencies.
Checklist
This PR contains all the work required to resolve the linked issue.
The work contained has sufficient documentation to describe what it does and how to do it.
The work has sufficient tests and/or testing.
I have committed clear and descriptive commits. Be considerate as somebody else will have to read these.
I have added the appropriate labels to this PR.