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

web3.eth.personal.sign gives error Unhandled rejection Error: Returned error: Method not found #1220

Closed
aas312 opened this issue Dec 8, 2017 · 10 comments
Assignees
Labels
Needs Clarification Requires additional input

Comments

@aas312
Copy link

aas312 commented Dec 8, 2017

var Web3 = require('web3');

var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));

web3.version //prints 1.0.0-beta.26

web3.eth.personal.sign('Hello World',account,password).then((signature)=>{console.log(signature)});

Promise {
_bitField: 0,
_fulfillmentHandler0: undefined,
_rejectionHandler0: undefined,
_promise0: undefined,
_receiver0: undefined }

Unhandled rejection Error: Returned error: Method not found
at Object.ErrorResponse (node_modules/web3-core-helpers/src/errors.js:29:16)
at node_modules/web3-core-requestmanager/src/index.js:137:36
at XMLHttpRequest.request.onreadystatechange (node_modules/web3-providers-http/src/index.js:64:13)
at XMLHttpRequestEventTarget.dispatchEvent (node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest._setReadyState (node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (node_modules/xhr2/lib/xhr2.js:509:12)
at IncomingMessage. (node_modules/xhr2/lib/xhr2.js:469:24)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)

> web3.eth.personal.sign
{ [Function: send]
method:
Method {
name: 'sign',
call: 'personal_sign',
params: 3,
inputFormatter:
[ [Function: inputSignFormatter],
[Function: inputAddressFormatter],
null ],
outputFormatter: undefined,
transformPayload: undefined,
extraFormatters: undefined,
requestManager: RequestManager { provider: [Object], providers: [Object],subscriptions: {} },
accounts: undefined,
defaultBlock: 'latest',
defaultAccount: null },
request: [Function: bound ],
call: 'personal_sign' }

@captnseagraves
Copy link

captnseagraves commented Dec 13, 2017

I am having the same problem with slightly different instantiation of web3 and a slightly different error.

Instantiation:
`var Web3 = require('web3');
var web3 = new Web3('http://localhost:8545');

web3.eth.personal.sign('hello world', '0xe87529a6123a74320e13a6dabf3606630683c029', 'password')
.then((result) => {
console.log(result);
})`

Error:
Unhandled rejection Error: Returned error: Error: Method personal_sign not supported.

@captnseagraves
Copy link

captnseagraves commented Dec 14, 2017

I've since implemented in the browser instead of running on Node in the Terminal and have had success. I'm guessing there is something that MetaMask is doing in the background that makes it work, and perhaps the latest version of web3 isn't supported by the latest version of testrpc?

@aas312
Copy link
Author

aas312 commented Dec 15, 2017

I am using https://github.com/dstarcev/parity-poa-playground where I have set he usd_per_tx to 0.

@hrishikeshio
Copy link

hrishikeshio commented Jan 16, 2018

Having same problem in node with web3@1.0.0-beta.27 and latest beta parity.

@nivida
Copy link
Contributor

nivida commented Aug 9, 2018

Is this error still present in the latest version? @hrishikeshio @aas312 @captnseagraves

@nivida nivida self-assigned this Aug 9, 2018
@iisaint
Copy link

iisaint commented Aug 30, 2018

Having the same error with web3@1.0.0-beta.35.

@erniu
Copy link

erniu commented Sep 5, 2018

Having the same error with web3@1.0.0-beta.36.

@ghost
Copy link

ghost commented Nov 16, 2018

Why is this closed? I'm having the same problem with 1.0.0-beta.36.
I'm running a node remotely using:
--rpcapi db,eth,net,web3,personal,web3

Ideas?

@nivida
Copy link
Contributor

nivida commented Apr 16, 2019

It will work if the personal API is activated and if you use the latest version of Web3.

@JimLynchCodes
Copy link

@nivida it doesn't work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Clarification Requires additional input
Projects
None yet
Development

No branches or pull requests

7 participants