polkadot-developers / substrate-docs

Substrate Developer Hub. Substrate is powered by best in class cryptographic research and comes with peer to peer networking, consensus mechanisms, and much more.
https://docs.substrate.io
BSD Zero Clause License
131 stars 274 forks source link

Metadata v14 content #385

Open nuke-web3 opened 3 years ago

nuke-web3 commented 3 years ago

With the new scale-info features, many need to migrate and in general we should discuss and inform builders of it.

Migration guide: https://gist.github.com/ascjones/0d81a4c44e84cacd9f714cd34a6de823

nuke-web3 commented 3 years ago

@ascjones could I ask you to add a few links/resources in this issue so we can make this content? :pray: Any key things we should point out?

ascjones commented 3 years ago

I had promised to write some docs on this which I have failed to do so far. I will do a session on this at the retreat so need to do some prep this week and can send over my unedited notes for this as a start.

JoshOrndorff commented 3 years ago

The scale-info crate docs are helpful too https://docs.rs/crate/scale-info/1.0.0

And great tip from @wischli in https://gist.github.com/ascjones/0d81a4c44e84cacd9f714cd34a6de823#gistcomment-3931135

I would like to add that you should add #[scale_info(skip_type_params(T))] for structs which lazily use the pallet's Config as generic such as pub struct Example - if this statement is correct. This would have saved me quite some time when debugging our upgrade to 0.9.11 sweat_smile

nuke-web3 commented 2 years ago

Pro tip for easy grabbing of a local node ( or remote with RPC unsafe ports open?):

curl -H "Content-Type: application/json" -d '{ "id": 1, "jsonrpc": "2.0", "method": "state_getMetadata"}' http://localhost:9933
nuke-web3 commented 2 years ago

@ascjones - I still woudl love to see more formal content around this - are you able to help out here? :grinning:

ascjones commented 2 years ago

Yes but realistically I won't get around to it until August. It is on my list.

nuke-web3 commented 2 years ago

https://docs.substrate.io/main-docs/build/application-dev/#metadata-system what we have so far

494 related