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

Update Pendulum metadata #485

Merged
merged 9 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
40 changes: 32 additions & 8 deletions clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ To run the vault directly with the provided standalone chain use:
```
cargo run --bin vault --features standalone-metadata -- --keyring alice --stellar-vault-secret-key-filepath <secret_key_file_path> --stellar-overlay-config-filepath <cfg_file_path>
```

To see examples of the config file, check [here](stellar-relay-lib/resources/config).
An example of the secret key file path is found [here](stellar-relay-lib/resources/secretkey).

Expand Down Expand Up @@ -80,28 +81,32 @@ cargo test --test '*' --package vault --features integration-test
* ```
ERROR vault::redeem: Error while sending request: error sending request for url (https://horizon-testnet.stellar.org/accounts/GA6ZDMRVBTHIISPVD7ZRCVX6TWDXBOH2TE5FAADJXZ52YL4GCFI4HOHU): error trying to connect: dns error: cancelled
```
* but this does not mean that the test fails.
The `test_redeem` integration test only checks if a `RedeemEvent` was emitted and terminates afterwards.
This stops the on-going withdrawal execution the vault client started leading to that error.
The withdrawal execution is tested in the `test_execute_withdrawal` unit test instead.
* but this does not mean that the test fails.
The `test_redeem` integration test only checks if a `RedeemEvent` was emitted and terminates afterwards.
This stops the on-going withdrawal execution the vault client started leading to that error.
The withdrawal execution is tested in the `test_execute_withdrawal` unit test instead.

* ```
ERROR offchain-worker::http: Requested started id=1630 method=POST uri=https://dia-00.pendulumchain.tech:8070/currencies
ERROR dia_oracle::pallet: Failed to Update Prices HttpRequestFailed
```
* these errors can be ignored
* these errors can be ignored

## Updating the metadata

When any changes are made to elements associated with the pallets, such as extrinsic names or parameters, it is necessary to regenerate the metadata. Subxt is employed specifically for this purpose.
When any changes are made to elements associated with the pallets, such as extrinsic names or parameters, it is
necessary to regenerate the metadata. Subxt is employed specifically for this purpose.
Note: The `--version 14` flag is required when connecting to runtime nodes that are running older Substrate
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe need a definition of what "old" is.
Substrate v0.9.42 and below? Below Substrate version 1.0?
Or
old repo vs new repo ?

Copy link
Member Author

@ebma ebma Feb 6, 2024

Choose a reason for hiding this comment

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

I think this commit is the relevant one and it seems to only be included starting with polkadot-v1.0.0 and not even polkadot-v0.9.43. I updated the description.

dependencies.

```
cargo install [email protected]

// fetching from an automatically detected local chain
subxt metadata -f bytes > runtime/metadata-{your-chain-name}.scale
subxt metadata -f bytes > runtime/metadata-{your-chain-name}.scale --version 14

// fetching from a specific chain
subxt metadata -f bytes --url http://{chain-url} > runtime/metadata-{your-chain-name}.scale
subxt metadata -f bytes --url http://{chain-url} > runtime/metadata-{your-chain-name}.scale --version 14
```

### Updating the standalone-metadata file
Expand All @@ -118,6 +123,25 @@ Once the local node is running, run this command from the clients directory:
subxt metadata -f bytes > runtime/metadata-standalone.scale --version 14
```

### Updating the metadata of the supported runtimes (Pendulum/Amplitude/Foucoco)

To update the metadata of the supported parachains, run the following commands:

```
subxt metadata -f bytes --url wss://rpc-pendulum.prd.pendulumchain.tech:443 > runtime/metadata-parachain-pendulum.scale --version 14
subxt metadata -f bytes --url wss://rpc-amplitude.pendulumchain.tech:443 > runtime/metadata-parachain-amplitude.scale --version 14
subxt metadata -f bytes --url wss://rpc-foucoco.pendulumchain.tech:443 > runtime/metadata-parachain-foucoco.scale --version 14
```

To facilitate comparison of changes in metadata, it is recommended to also convert the metadata to JSON format. This can
be done using the following commands:

```
subxt metadata -f json --url wss://rpc-pendulum.prd.pendulumchain.tech:443 > runtime/metadata-parachain-pendulum.json --version 14
subxt metadata -f json --url wss://rpc-amplitude.pendulumchain.tech:443 > runtime/metadata-parachain-amplitude.json --version 14
subxt metadata -f json --url wss://rpc-foucoco.pendulumchain.tech:443 > runtime/metadata-parachain-foucoco.json --version 14
```

## Troubleshooting

### Invalid spec version
Expand Down
Loading
Loading