Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

account password? #14

Closed
drandreaskrueger opened this issue Aug 20, 2018 · 13 comments
Closed

account password? #14

drandreaskrueger opened this issue Aug 20, 2018 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@drandreaskrueger
Copy link

s.th.'s wrong with the password?

geth attach http://localhost:8545

Welcome to the Geth JavaScript console!
instance: Geth/v1.8.13-stable-225171a4/linux-amd64/go1.10.3
coinbase: 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
at block: 74 (Mon, 20 Aug 2018 14:31:46 BST)
 modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0

eth.accounts
["0x8cc5a1a0802db41db826c2fcb72423744338dcb0"]

personal.unlockAccount("0x8cc5a1a0802db41db826c2fcb72423744338dcb0")
Unlock account 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
Passphrase: pass
Error: The method personal_unlockAccount does not exist/is not available

personal.unlockAccount("0x8cc5a1a0802db41db826c2fcb72423744338dcb0")
Unlock account 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
Passphrase: word
Error: The method personal_unlockAccount does not exist/is not available

personal.unlockAccount("0x8cc5a1a0802db41db826c2fcb72423744338dcb0", "pass")
Error: The method personal_unlockAccount does not exist/is not available

web3.personal
{
listAccounts: undefined,
ecRecover: function(),
getListAccounts: function(callback),
importRawKey: function(),
lockAccount: function(),
newAccount: function github.com/ethereum/go-ethereum/console.(*bridge).NewAccount-fm(),
openWallet: function github.com/ethereum/go-ethereum/console.(*bridge).OpenWallet-fm(),
sendTransaction: function(),
sign: function github.com/ethereum/go-ethereum/console.(*bridge).Sign-fm(),
unlockAccount: function github.com/ethereum/go-ethereum/console.(*bridge).UnlockAccount-fm()
}

personal.unlockAccount
function github.com/ethereum/go-ethereum/console.(*bridge).UnlockAccount-fm()

@drandreaskrueger
Copy link
Author

drandreaskrueger commented Aug 20, 2018

my workaround was to not even try to unlock, but that meant to switch off the unlocking in my own code.

but would be better if personal.unlockAccount() would just be working.

@drandreaskrueger
Copy link
Author

drandreaskrueger commented Aug 20, 2018

perhaps this is the reason?

modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0

might mean that not all rpc apis are accessible, right?

please by default open all those apis; this setup is not for production but for development only anyways, right?

@javahippie
Copy link
Owner

You do not need to unlock the account, as it is already unlocked by default in the Images. Geth is started with the --unlock flag.

@javahippie
Copy link
Owner

As I understand that it is not ideal to have all nodes automatically unlocked, would it help if the first node was unlocked by default and the other nodes needed to be unlocked via RPC?

@drandreaskrueger
Copy link
Author

You do not need to unlock the account

Yes, looks like case by case this differs. And in this case not.

What if my standard chainhammer code always does that, at the beginning?

Looks like I really have to include all kind of situation specific exceptions, have a look = that is prone to future problems, though.

@drandreaskrueger
Copy link
Author

was unlocked by default and the other nodes needed to be unlocked via RPC

IMHO account unlocking should be done by the client, i.e. my chainhammer. Simply for not to seduce a coder into assuming any account is wide open. There is a personal.unlockAccount() call for that, and it works well (and even in parity with parity --geth switch).

BUT I think for this great dev tool that you are supplying us with .... I think all RPC APIs could be made accessible, not only eth:1.0 net:1.0 rpc:1.0 web3:1.0

@javahippie
Copy link
Owner

javahippie commented Aug 24, 2018

I think you are right. Being auto unlocked is almost never a use case which is useful. I will change this.

I am happy that the tool is helpful! I will create another task to enable all RPC API, and try to update it asap.

@javahippie javahippie self-assigned this Aug 24, 2018
@javahippie javahippie added the enhancement New feature or request label Aug 24, 2018
javahippie pushed a commit that referenced this issue Aug 24, 2018
#14 - remove permanent unlocking for all nodes
@javahippie
Copy link
Owner

Changes merged in; accounts are no longer unlocked permanently.

@javahippie
Copy link
Owner

Unfortunately, for the clique consensus protocol the nodes need to be unlocked in order to start mining. I enabled the unlocking again for the miner-1 and miner-2, the node behind miner-3 is not mining anyways and can be used for all applications which need to unlock manually.

@drandreaskrueger
Copy link
Author

for the clique consensus protocol the nodes need to be unlocked in order to start mining.

Oh, oops ;-)

which need to unlock manually.

All good as long as the personal.unlockAccount() function call is working. More a "which want to unlock manually" instead of "which need to unlock manually".

@drandreaskrueger
Copy link
Author

drandreaskrueger commented Aug 28, 2018

one more "oops":

https://github.com/javahippie/geth-dev/blob/master/miner/Dockerfile#L27

your 32c5455 is not part of master yet?

because I get this:

geth-miner-1             | INFO [08-28|08:53:54.162] Commit new mining work                   number=1 uncles=0 txs=0 gas=0 fees=0 elapsed=72.186µs
geth-miner-1             | WARN [08-28|08:53:54.162] Block sealing failed                     err="authentication needed: password or unlock"

and

geth attach http://localhost:8545
Welcome to the Geth JavaScript console!

instance: Geth/v1.8.14-stable-316fc7ec/linux-amd64/go1.10.3
coinbase: 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
at block: 0 (Thu, 22 Feb 2018 17:25:57 GMT)
 datadir: /root/.ethereum
 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

> eth.blockNumber
0
> eth.blockNumber
0

javahippie pushed a commit that referenced this issue Aug 28, 2018
javahippie pushed a commit that referenced this issue Aug 28, 2018
@javahippie
Copy link
Owner

You are right. I am not sure what happened there, I committed the changes and merged to master

@drandreaskrueger
Copy link
Author

perhaps forgot to git push ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants