0

How to get accounts from dev node?
By default dev node start with accounts derived from mnemonic
bottom drive obey lake curtain smoke basket hold race lonely fit walk
As mentioned here How can I get predefined built-in account‘s key pair from polkadotjs app? Such as Alice and Bob
However you can also change those accounts (derivation path) or mnemonic.

polkadot.js.org app gets those accounts using direct storage calls. For example Alice account is fetched by state.getStorage('0x5c0d1176a568c1f92944340dbfed9e9c530ebca703c85910e7164cb7d1c9e47b')
Which more flexible solution than hardcoding mnemonic in app. However I don't know where that storage key comes from.. Any idea how to programmatically fetch all managed accounts?

EDIT: What I'm trying to do - I want to get those accounts with RPC call.
It is possible to change those accounts in dev node (in code) and I don't want to reflect those changes in testing env. It is for sure possible cuz polkadot.js.org (using on local node) gets those accounts. accounts

6
  • 2
    I think you need to better clarify your question. Practically speaking, a node does not have any "managed" accounts. What is exactly you are trying to do or do you want to know?
    – Shawn Tabrizi
    Commented Sep 17, 2022 at 21:16
  • @ShawnTabrizi so how it is possible that I can submit tx using those accounts without using private key (just specifying address)? That because node has knowledge about private key of that account - that is why I call it "managed".
    – l00k
    Commented Sep 18, 2022 at 13:36
  • 1
    The node does NOT have knowledge of the private key, so no. You will still need to submit a signed message which is signed externally to the blockchain.
    – Shawn Tabrizi
    Commented Sep 20, 2022 at 17:48
  • @ShawnTabrizi did you ever run dev node? I don't pass any private key to UI also it even don't ask me about private key. I just open polkadot.js.org (with local node set) and see account and can submit tx without any private key on front side.
    – l00k
    Commented Sep 21, 2022 at 9:43
  • 1
    This is because Polkadot JS detects these dev accounts, and provides them to you through the UI, not the node. Its like a global agreement that these accounts are well known in the Substrate and Polkadot community, and thus they show up everywhere.
    – Shawn Tabrizi
    Commented Sep 21, 2022 at 21:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.