web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

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

Open aas312 opened this issue 8 years ago • 10 comments

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' }

aas312 avatar Dec 08 '17 17:12 aas312

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 avatar Dec 13 '17 00:12 captnseagraves

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?

captnseagraves avatar Dec 14 '17 00:12 captnseagraves

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

aas312 avatar Dec 15 '17 19:12 aas312

Having same problem in node with [email protected] and latest beta parity.

hrishikeshio avatar Jan 16 '18 10:01 hrishikeshio

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

nivida avatar Aug 09 '18 14:08 nivida

Having the same error with [email protected].

iisaint avatar Aug 30 '18 05:08 iisaint

Having the same error with [email protected].

erniu avatar Sep 05 '18 08:09 erniu

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?

ghost avatar Nov 16 '18 07:11 ghost

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

nivida avatar Apr 16 '19 09:04 nivida

@nivida it doesn't work...

JimLynchCodes avatar Nov 01 '21 20:11 JimLynchCodes