cli icon indicating copy to clipboard operation
cli copied to clipboard

Add a flag to scaffold a module with no registration in `app`

Open lumtis opened this issue 3 years ago • 4 comments

Add a flag --no-registration to only scaffold module without registering it to the app.go so the module is part of the codebase but not part of the blockchain

Example usage: spn, the monitoring-testnet module exists but will only be used by chains that connect to spn General usage: a utilitary module used by a remote chain

We already not register when an error happen with app so implementation must be trivial

starport s module foo --no-registration

lumtis avatar Nov 18 '21 16:11 lumtis

I like the idea. --no-import is a bit shorter.

fadeev avatar Nov 18 '21 21:11 fadeev

I like the idea. --no-import is a bit shorter.

This is to stay consistent with our current flag --require-registration

lumtis avatar Nov 19 '21 07:11 lumtis

@lubtd @fadeev I want to work on this bug can you tell me how to do it? Thanks

championshuttler avatar Dec 03 '21 11:12 championshuttler

@lubtd @fadeev I want to work on this bug can you tell me how to do it? Thanks

Hey @championshuttler, sure you can if you're interested in this👍 This is not a bug but rather a feature

For the implementation it should be few lines of codes. The package services/scaffolder contains logic for scaffolding command. We want to add a flag to the starport s module command defined in cmd/scaffold_module.go so that the app.go file modification is skipped: https://github.com/tendermint/starport/blob/ff59c3a333854573df3c1b23e6fcc957804e376b/starport/services/scaffolder/module.go#L220

lumtis avatar Dec 03 '21 12:12 lumtis