-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump codegen and cli to 0.2 * Add CLI README.md
- Loading branch information
Showing
4 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# subxt-cli | ||
|
||
Utilities for working with substrate metadata for `subxt` | ||
|
||
``` | ||
USAGE: | ||
subxt <SUBCOMMAND> | ||
FLAGS: | ||
-h, --help | ||
Prints help information | ||
-V, --version | ||
Prints version information | ||
SUBCOMMANDS: | ||
codegen Generate runtime API client code from metadata | ||
help Prints this message or the help of the given subcommand(s) | ||
metadata Download metadata from a substrate node, for use with `subxt` codegen | ||
``` | ||
|
||
## Metadata | ||
|
||
Use to download metadata for inspection, or use in the `subxt` macro. e.g. | ||
|
||
`subxt metadata -f bytes > metadata.scale` | ||
|
||
``` | ||
USAGE: | ||
subxt metadata [OPTIONS] | ||
OPTIONS: | ||
-f, --format <format> the format of the metadata to display: `json`, `hex` or `bytes` [default: json] | ||
--url <url> the url of the substrate node to query for metadata [default: http://localhost:9933] | ||
``` | ||
|
||
## Codegen | ||
|
||
Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the the runtime API and types. Useful | ||
for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility of customizing the | ||
generated code if the macro does not produce the desired API. e.g. | ||
|
||
`subxt codegen | rustfmt --edition=2018 --emit=stdout` | ||
|
||
``` | ||
USAGE: | ||
subxt codegen [OPTIONS] | ||
OPTIONS: | ||
-f, --file <file> | ||
the path to the encoded metadata file | ||
--url <url> | ||
the url of the substrate node to query for metadata for codegen | ||
``` | ||
|
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
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