Skip to content
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 genesis create-cardano command #3832

Merged
merged 1 commit into from
May 3, 2022
Merged

Conversation

cleverca22
Copy link
Contributor

  • combines generation of byron and shelley eras genesis
  • auto generates a config based on a node config template
  • slot timing and start time parameters override template
  • generates all keys in byron era and converts to shelley era

fixed #3798

* combines generation of byron and shelley eras genesis
* auto generates a config based on a node config template
* slot timing and start time parameters override template
* generates all keys in byron era and converts to shelley era
@disassembler
Copy link
Contributor

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 3, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit c7cd1e4 into master May 3, 2022
@iohk-bors iohk-bors bot deleted the genesis-create-cardano branch May 3, 2022 12:36
@@ -42,6 +46,7 @@ library
-- we create wrapper types for the ledger types
-- in this module
Cardano.Api.Orphans
Cardano.Api.SerialiseTextEnvelope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be exposed @cleverca22. I will be undoing this in a future PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how else is this code going to convert keys into json?

@@ -663,7 +663,9 @@ module Cardano.Api (

chainPointToSlotNo,
chainPointToHeaderHash,
makeChainTip
makeChainTip,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be exposed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, these could be moved until a cardano-cli utils file

Nothing -> fail msg
Just a -> pure a

parseFilePath :: String -> String -> Opt.Parser FilePath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these do not belong in Cardano.Api. They should live in cadano-cli.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, these could be moved until a cardano-cli utils file

@@ -148,6 +171,7 @@ runGenesisCmd (GenesisVerKey vk sk) = runGenesisVerKey vk sk
runGenesisCmd (GenesisTxIn vk nw mOutFile) = runGenesisTxIn vk nw mOutFile
runGenesisCmd (GenesisAddr vk nw mOutFile) = runGenesisAddr vk nw mOutFile
runGenesisCmd (GenesisCreate gd gn un ms am nw) = runGenesisCreate gd gn un ms am nw
runGenesisCmd (GenesisCreateCardano gd gn un ms am k slotLength sc nw bg sg ag mNodeCfg) = runGenesisCreateCardano gd gn un ms am k slotLength sc nw bg sg ag mNodeCfg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be on a newline

toCounter = LBS.toStrict . textEnvelopeToJSON Nothing . snd

generateShelleyNodeSecrets :: [SigningKey GenesisDelegateExtendedKey] -> [VerificationKey GenesisKey]
-> IO (Map (Hash GenesisKey)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indent

--

runGenesisCreateCardano :: GenesisDir
-> Word -- ^ num genesis & delegate keys to make
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indent

@Jimbo4350 Jimbo4350 mentioned this pull request May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] - Fix genesis generation for new clusters
4 participants