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

[RPC] insertKey method is not expecting a Substrate URI #1709

Open
EclesioMeloJunior opened this issue Jul 28, 2021 · 5 comments
Open

[RPC] insertKey method is not expecting a Substrate URI #1709

EclesioMeloJunior opened this issue Jul 28, 2021 · 5 comments

Comments

@EclesioMeloJunior
Copy link
Member

EclesioMeloJunior commented Jul 28, 2021

Issue summary

  • I noticed that at insertKey RPC method the polkadot ui are sending the suri (aka Substrate URI, aka //Allice, //Bob...) but our RPC method is expecting a hexadecimal seed (if you type subkey inspect //Allice you will get the hex seed for the suri //Allice), the error the ui got is:
could not byteify non 0x prefixed string: null
  • The api.rpc.author.insertKey polkadot js API is expecting a suri as paramater as well:
insertKey: RpcPromiseResult
 (keyType: string | Text, suri: string | Text, publicKey: string | Bytes | Uint8Array)

Screenshots

  1. Sending a suri but got error response
    image
    the log what gossamer node are receiving:
    image

  2. Trying to send a hex seed, got the same error response:
    image
    the log what gossamer node are receiving:
    image

Other information and links

@EclesioMeloJunior EclesioMeloJunior changed the title [RPC] insertKey method is not expecting the Substrate URI (suri) [RPC] insertKey method is not expecting a Substrate URI Jul 28, 2021
@decentration
Copy link

you won't be able to get the mnemonic seed from subkey inspect, the inspect element only provides the public information of the key. You would have to generate a key and then keep the seed in a safe place.

@EclesioMeloJunior
Copy link
Member Author

@decentration thanks for clarifying that!

@EclesioMeloJunior
Copy link
Member Author

I've tryied to call this RPC call using the https://polkadot.js.org/apps on polkadot and kusama networks and to both nets the RPC call author.insertKey outputs:

1: author.insertKey
-32601: Method not found

And I look at smoldot implemented rpc calls and I noticed that author_insertKey is not implemented yet

@timwu20 @danforbes fyi

@danforbes
Copy link
Contributor

@EclesioMeloJunior does this documentation help clarify the format that the Substrate implementation expects? https://github.com/substrate-developer-hub/substrate-docs/blob/e537cc2de3618d283e58e308c30ae6c436d0569e/v3/tutorials/05-private-network/e-launch-custom-chain/index.mdx#option-1-use-the-polkadot-js-apps-ui

@EclesioMeloJunior
Copy link
Member Author

@danforbes yes, helps a lot! Thanks!

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

5 participants