-
Notifications
You must be signed in to change notification settings - Fork 9
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
node/cli: export genesis metadata #148
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
pepyakin
commented
Dec 21, 2023
pub struct ExportGenesisMetadataCmd { | ||
#[allow(missing_docs)] | ||
#[command(flatten)] | ||
pub shared_params: sc_cli::SharedParams, |
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 don't really like this one, because it makes the CLI output to look like below. Spot the needed commands.
Options:
--chain <CHAIN_SPEC>
Specify the chain specification.
It can be one of the predefined ones (dev, local, or staging) or it can be a path to a file with the chainspec
(such as one exported by the `build-spec` subcommand).
--dev
Specify the development chain.
This flag sets `--chain=dev`, `--force-authoring`, `--rpc-cors=all`, `--alice`, and `--tmp` flags, unless
explicitly overridden. It also disables local peer discovery (see --no-mdns and --discover-local)
-d, --base-path <PATH>
Specify custom base path
-l, --log <LOG_PATTERN>...
Sets a custom logging filter (syntax: `<target>=<level>`).
Log levels (least to most verbose) are `error`, `warn`, `info`, `debug`, and `trace`.
By default, all targets log `info`. The global log level can be set with `-l<level>`.
Multiple `<target>=<level>` entries can be specified and separated by a comma.
*Example*: `--log error,sync=debug,grandpa=warn`. Sets Global log level to `error`, sets `sync` target to debug
and grandpa target to `warn`.
--detailed-log-output
Enable detailed log output.
Includes displaying the log target, log level and thread name.
This is automatically enabled when something is logged with any higher level than `info`.
--disable-log-color
Disable log color output
--enable-log-reloading
Enable feature to dynamically update and reload the log filter.
Be aware that enabling this feature can lead to a performance decrease up to factor six or more. Depending on
the global logging level the performance decrease changes.
The `system_addLogFilter` and `system_resetLogFilter` RPCs will have no effect with this option not being set.
--tracing-targets <TARGETS>
Sets a custom profiling filter.
Syntax is the same as for logging (`--log`).
--tracing-receiver <RECEIVER>
Receiver to process tracing messages
[default: log]
Possible values:
- log: Output the tracing records using the log
-r, --raw
Write output in binary. Default is to write in hex
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
I am reluctant to do something about it though.
This commit adds a new subcommand to the CLI that exports metadata from the compiled-in runtime, similar to the existing subcommands like `export-genesis-state` and `export-genesis-wasm`. A typical usage would be ```bash sugondat-node export-genesis-metadata --raw binary_metadata.scale subxt codegen --file binary_metadata.scale | \ rustfmt --edition=2021 --emit=stdout > src/metadata.rs ``` Ideally, it would be solved by [paritytech/polkadot-sdk#2745] and thus we could just take the wasm blob (either exported by `export-genesis-wasm`) and just get it from there via simple of the shelf tools. Until then, we will have this command. [paritytech/polkadot-sdk#2745]: paritytech/polkadot-sdk#2745
pepyakin
force-pushed
the
pep-export-genesis-metadata
branch
from
December 21, 2023 16:41
cd327db
to
3f05f8a
Compare
rphmeier
approved these changes
Dec 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a new subcommand to the CLI that exports metadata from
the compiled-in runtime, similar to the existing subcommands like
export-genesis-state
andexport-genesis-wasm
.A typical usage would be
Ideally, it would be solved by paritytech/polkadot-sdk#2745 and thus we could
just take the wasm blob (either exported by
export-genesis-wasm
) and just getit from there via simple of the shelf tools. Until then, we will have this command.
Closes #142