9

How to open the JavaScript console on Parity? guide us to open a console for communicate with Parity.

Inside the console I was not able to unlock my eth.account using personal.unlockAccount(). I faced with following error: Method not found.

personal.unlockAccount("0x75a4c787c5c18c587b284a904165ff06a269b48c")
Unlock account 0x75a4c787c5c18c587b284a904165ff06a269b48c
Passphrase:
Error: Method not found

[Q] How could I prevent this error from error happening in order to unlock my eth.account successfully?

How I run Parity:

parity --chain parity.json --network-id 32344 --reserved-peers myPrivateNetwork.txt --jsonrpc-apis web3,eth,net,parity,parity_accounts,traces,rpc,parity_set,personal -ludp=debug,tcp=debug,sync=debug --author "0x75a4c787c5c18c587b284a904165ff06a269b48d"

Please note that java console sees personal.

> personal.  //press tab
personal._requestManager personal.constructor personal.getListAccounts personal.listAccounts personal.lockAccount personal.newAccount personal.sendTransaction personal.sign personal.unlockAccount

Thank you for your valuable time and help.

alper
  • 8,395
  • 11
  • 63
  • 152
  • 1
    What's the output of eth.accounts? – q9f May 09 '17 at 10:25
  • ["0x00941611ff247dc876d11cd0629b79d818814eb1"] so I guess should I import the private key of the address I want to unlock? if yes, do you know the way? @5chdn – alper May 09 '17 at 11:38
  • 1
    You can't unlock an account without private key. If you have another question, please let's not add them to the comments here. – q9f May 09 '17 at 12:20
  • https://ethereum.stackexchange.com/q/16033/4575 @5chdn – alper May 10 '17 at 06:34

3 Answers3

11

You need to run parity with the appropriate API enabled. The API is the personal API.

For example:

parity --chain ropsten --warp --rpcapi "eth,net,web3,personal,parity"

Thomas Clowes
  • 4,385
  • 2
  • 19
  • 43
  • I am running with following parameters(--jsonrpc-apis web3,eth,net,parity,parity_accounts,traces,rpc,parity_set,personal) but still giving the same error. Java console sees personal interface.@Thomas Clowes – alper May 07 '17 at 17:22
  • I added on my question how I run parity. @Thomas Clowes – alper May 08 '17 at 07:06
  • There is no personal rpcapi. The command above works for me and geth console allows me to unlock the account. Which version are you using. – q9f May 08 '17 at 09:39
  • Parity: version Parity/v1.7.0-unstable-1dddbf3-20170317/x86_64-macos/rustc1.15.1 @5chdn – alper May 08 '17 at 10:40
  • I can't even create a new account: > personal.newAccount("avatar") Error: Method not found @Thomas Clowes – alper May 11 '17 at 21:00
5

The Method not found message is ambiguous / misleading. It basically says, something is wrong. Often the most obvious reasons are:

  1. Mistyped command (happens, unlikely if you use tab-completion).
  2. Unavailable APIs (i.e., you haven't enabled the personal JSONRPC API).
  3. The called method fails for some reason (i.e., there is no account available for unlocking).
q9f
  • 32,913
  • 47
  • 156
  • 395
  • I import my account by using parity gui, on console I see the account I want to un-lock on eth.accounts. but still personal.unlock gives the same error. > `eth.accounts[3] "0x75a4c787c5c18c587b284a904165ff06a269b48c"

    personal.unlockAccount(eth.accounts[3])

    Unlock account 0x75a4c787c5c18c587b284a904165ff06a269b48c Passphrase: Error: Method not found`@5chdn♦

    – alper May 10 '17 at 09:43
  • Wrong passphrase :) – q9f May 10 '17 at 09:49
  • Passphrase I am using unlock the account on the parity gui :( @5chdn♦ – alper May 10 '17 at 10:00
  • Restart your client with --geth flag or use personal_sendTransaction instead. – xds2000 Dec 27 '18 at 05:58
2

I encountered the same issue of "Error: Method not found" and found solution :

example :

parity --chain ropsten --rpccorsdomain http://127.0.0.1:8180 --jsonrpc-apis "web3,eth,personal,pubsub,net,parity,parity_pubsub,traces,rpc,secretstore" --ipc-apis "web3,eth,personal,pubsub,net,parity,parity_pubsub,parity_accounts,traces,rpc,secretstore" --author "0x007afe2ff60fee864e700ece6ddad0be5303f188" --stratum

I put parameters of --jsonrpc-apis and --ipc-apis as above.

See https://github.com/paritytech/parity/wiki/Configuring-Parity for details.