Consensys / quorum

A permissioned implementation of Ethereum supporting data privacy
https://www.goquorum.com/
GNU Lesser General Public License v3.0
4.69k stars 1.3k forks source link

Geth Error: account unlock with HTTP access is forbidden #1035

Closed mamunbond07 closed 4 years ago

mamunbond07 commented 4 years ago

Dear Good people, I am trying to set up a 5 nodes cluster following the link: https://docs.goquorum.com/en/latest/Getting%20Started/Creating-A-Network-From-Scratch/ However, when I issue:

geth attach node0/data/geth.ipc

It shows me prompt. Then I query for

eth.accounts

After it shows me the account I try to unlock it in order to run a transaction script (e.g., https://github.com/jpmorganchase/quorum-examples/blob/master/examples/7nodes/public-contract.js), and it shows the following:

Output

Welcome to the Geth JavaScript console!

instance: Geth/v1.9.7-stable-f78f9a01(quorum-v2.6.0)/linux-amd64/go1.14.4 coinbase: 0x0cee5b38d9a0120007e18bd8146b23ed3eb66c5b at block: 0 (Wed, 08 Jul 2020 08:05:01 PDT) datadir: /home/bc/quorum/quorum/fromscratchistanbul/istanbul-tools/node0/data modules: admin:1.0 debug:1.0 eth:1.0 istanbul:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

loadScript("public-contract.js") err creating contract Error: authentication needed: password or unlock true eth.accounts ["0xadd436de30adc2ee6c25d18afc6fca3817abf650"] personal.unlockAccount("0xadd436de30adc2ee6c25d18afc6fca3817abf650","abc"); Error: account unlock with HTTP access is forbidden

System information

Geth

Version: 1.9.7-stable Git Commit: f78f9a0156e4c016e5aa8734e492368a608b2a1b Git Commit Date: 20200706 Quorum Version: 2.6.0 Architecture: amd64 Protocol Versions: [64 63] Network Id: 1337 Go Version: go1.14.4 Operating System: linux GOPATH= GOROOT=/usr/local/go

Branch, Commit Hash or Release:

On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add ..." to include in what will be committed)

node0/
node1/
node2/
node3/
node4/
private-contract.js
public-contract.js
startall.sh

Please kindly help me to resolve this.

zzy96 commented 4 years ago

Hi @mamunbond07

From Quorum 2.6.0 onwards, unlocking accounts by external RPC is disabled by default due to security reasons. If you still want to enable it. Please add --allow-insecure-unlock flag in the start command.

mamunbond07 commented 4 years ago

Thanks a lot for your response. I have tried the option like the following already in my terminal:

geth attach node0/data/geth.ipc allow-insecure-unlock

Then it shows the prompt like this:

Welcome to the Geth JavaScript console!

instance: Geth/v1.9.7-stable-f78f9a01(quorum-v2.6.0)/linux-amd64/go1.14.4 coinbase: 0x0cee5b38d9a0120007e18bd8146b23ed3eb66c5b at block: 0 (Wed, 08 Jul 2020 08:05:01 PDT) datadir: /home/bc/quorum/quorum/fromscratchistanbul/istanbul-tools/node0/data modules: admin:1.0 debug:1.0 eth:1.0 istanbul:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

If I try now this script: https://github.com/jpmorganchase/quorum-examples/blob/master/examples/7nodes/public-contract.js OR this script: https://github.com/jpmorganchase/quorum-examples/blob/master/examples/7nodes/private-contract.js It shows me the error

loadScript("public-contract.js") err creating contract Error: authentication needed: password or unlock true

loadScript("private-contract.js") err creating contract Error: private transaction manager is not in use true

Please kindly help me.

mamunbond07 commented 4 years ago

Even I tried with this, to unlock the account:

geth attach node0/data/geth.ipc allow-insecure-unlock Welcome to the Geth JavaScript console!

instance: Geth/v1.9.7-stable-f78f9a01(quorum-v2.6.0)/linux-amd64/go1.14.4 coinbase: 0x0cee5b38d9a0120007e18bd8146b23ed3eb66c5b at block: 0 (Wed, 08 Jul 2020 08:05:01 PDT) datadir: /home/bc/quorum/quorum/fromscratchistanbul/istanbul-tools/node0/data modules: admin:1.0 debug:1.0 eth:1.0 istanbul:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

web3.personal.listAccounts ["0xadd436de30adc2ee6c25d18afc6fca3817abf650"] web3.personal.unlockAccount(web3.personal.listAccounts[0],"password", 15000) Error: account unlock with HTTP access is forbidden

zzy96 commented 4 years ago

You should add --allow-insecure-unlock flag in your starting command. Please refer to https://github.com/jpmorganchase/quorum-examples/blob/02d43d6fb79707993ec1f62cf2c81062fd895450/examples/7nodes/istanbul-start.sh#L125.

zzy96 commented 4 years ago

@mamunbond07 Please reopen if you still have doubts.