StorageKey keyword mentioned in the RPC substrate docs and polkadotJS RPC API docs https://polkadot.js.org/docs/substrate/rpc#getkeyskey-storagekey-at-blockhash-vecstoragekey
How to get this StorageKey?
Substrate and Polkadot Stack Exchange is a question and answer site for developers building blockchains with the Substrate SDK. It only takes a minute to sign up.
Sign up to join this communityStorageKey keyword mentioned in the RPC substrate docs and polkadotJS RPC API docs https://polkadot.js.org/docs/substrate/rpc#getkeyskey-storagekey-at-blockhash-vecstoragekey
How to get this StorageKey?
You can also use the apps UI to create keys, generally if these are single items this is a quick approach. In the apps UI via the storage page, you can see the encoded keys based on the input parameters (along with a breakdown on the right as to which component is due to which part)
Additionally (and this is most probably not applicable for your case, however I'm including it here for future reference), you can also do it programatically via the JS API.
console.log(
// each api.query.<module>.<method> has .key exposed that
// generates an encoded storage key
api.query.system.account.key(
// any parameters that you would need
'1363HWTPzDrzAQ6ChFiMU6mP4b6jmQid2ae55JQcKtZnpLGv'
)
);
The above would output the same details as found in the apps UI screenshot above, i.e 0x26aa...2f28
which is the key for that specific account at this storage location.
Great question!
If you have a prefix of a storage key that you are looking for, you can specify in the first argument like so:
Note that if you specify
0x
you will get all the keys!
If you want to know how the storage keys are created I recommend reading: