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

Rename metadata file #1856

Merged
merged 4 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/md/en/docs/reference/command-line-tools/subxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You can use the following optional flags with the `subxt` command.

| Flag | Description
| ------- | -----------
| -h, --help | Displays usage information.
| -h, --help | Displays usage information.
| -V, --version | Displays version information.

### Subcommands
Expand All @@ -47,7 +47,7 @@ You can use the following subcommands with the `subxt` command-line interface.

| Command | Description
| ------- | -----------
| `codegen` | Generates runtime API client code from metadata.
| `codegen` | Generates runtime API client code from metadata.
| `metadata` | Downloads metadata from a Substrate node for use with `subxt` codegen.

### Output
Expand Down Expand Up @@ -141,8 +141,8 @@ To save the metadata from the local node encoded in bytes to a file, run the fol

To save the metadata from the Rococo network to a JSON file, run the following command:

`subxt metadata --url https://rococo-rpc.polkadot.io:443 > metadata.json`
`subxt metadata --url https://rococo-rpc.polkadot.io:443 > <contract_name>.json`

To query type `125` from the array of types in the metadata and output in JSON, run the following command:

`subxt metadata --format json | jq '.[1].V14.types.types | .[125]'`
`subxt metadata --format json | jq '.[1].V14.types.types | .[125]'`
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ To create a new project for your smart contract:
1. Verify that the program compiles and passes the trivial test by running the following command:

```bash
cargo contract test
cargo test
```

You can ignore any warnings because this template code is simply a skeleton.
Expand Down Expand Up @@ -251,7 +251,7 @@ To update the smart contract:
1. Check your work using the `test` subcommand:

```bash
cargo contract test
cargo test
```

The command should display output similar to the following to indicate successful test completion:
Expand Down Expand Up @@ -306,7 +306,7 @@ To add the public function to the smart contract:
1. Check your work using the `test` subcommand:

```bash
cargo contract test
cargo test
```

## Add a function to modify the storage value
Expand Down Expand Up @@ -346,7 +346,7 @@ To add a function for incrementing the stored value:
1. Check your work using the `test` subcommand:

```bash
cargo contract test
cargo test
```

The command should display output similar to the following to indicate successful test completion:
Expand Down Expand Up @@ -383,7 +383,7 @@ To build the WebAssembly for this smart contract:

- incrementer.contract (code + metadata)
- incrementer.wasm (the contract's code)
- metadata.json (the contract's metadata)
- incrementer.json (the contract's metadata)
```

## Deploy and test the smart contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ To build the WebAssembly for this smart contract:

- flipper.contract (code + metadata)
- flipper.wasm (the contract's code)
- metadata.json (the contract's metadata)
- flipper.json (the contract's metadata)
```

The `.contract` file includes both the business logic and metadata. This is the file that tooling (e.g UIs) expect
when you want to deploy your contract on-chain.

The `metadata.json` file describes all the interfaces that you can use to interact with this contract. This file
The `.json` file describes all the interfaces that you can use to interact with this contract. This file
contains several important sections:

- The `spec` section includes information about the functions—like **constructors** and **messages**—that can be
Expand Down