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

Embed metadata into the wasm binary #2745

Open
pepyakin opened this issue Dec 19, 2023 · 3 comments
Open

Embed metadata into the wasm binary #2745

pepyakin opened this issue Dec 19, 2023 · 3 comments

Comments

@pepyakin
Copy link
Contributor

Note

This is a copy of paritytech/substrate#8870 that was not copied over, but I still believe is worthwhile to persue.

paritytech/substrate#7327 and paritytech/substrate#8688 were about embedding the version information into the wasm binary. We can leverage the same technique for the metadata.

That would enable a simpler way to get the metadata. The user will need to only obtain the wasm binary and then fetch a specific section. No instantiation of the wasm runtime is required.

@xlc
Copy link
Contributor

xlc commented Dec 19, 2023

This may or maynot be blocked by #1139

@bkchr
Copy link
Member

bkchr commented Dec 19, 2023

Can be done as part of #291, because there we will already need to fetch the metadata from the built runtime.

@pepyakin
Copy link
Contributor Author

Agree! That said, I would still leave this one opened until addressed.

pepyakin added a commit to thrumdev/blobs that referenced this issue Dec 21, 2023
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 added a commit to thrumdev/blobs that referenced this issue Dec 21, 2023
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
rphmeier pushed a commit to thrumdev/blobs that referenced this issue Dec 22, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants